Telerik Forums
Reporting Forum
1 answer
122 views
i am using the following code: which returns error invalid uri unknown format.  What i want to do is when my print button is selected on my winform i want the report to show and be editable maintaining format that is passed to it.  Also need to know how to pass data to various textboxes on the reports.
<FONT size="2" face="Consolas"><FONT size="2" face="Consolas"><FONT size="2"
face="Consolas"><FONT size="2" face="Consolas">
<P>Telerik.Reporting.</P>
<P></FONT> </P>
<P></P>
<P></FONT> </P>
<P><FONT color="#2b91af" size="2" face="Consolas"><FONT color="#2b91af" size="2"
face="Consolas"><FONT color="#2b91af" size="2"
face="Consolas">UriReportSource</FONT></FONT></FONT><FONT size="2" face="Consolas"><FONT
size="2" face="Consolas"> Telrpt = </FONT></FONT><FONT color="#0000ff" size="2"
face="Consolas"><FONT color="#0000ff" size="2" face="Consolas"><FONT color="#0000ff"
size="2" face="Consolas">new</FONT></FONT></FONT><FONT size="2"
face="Consolas"><FONT size="2" face="Consolas">
Telerik.Reporting.</FONT></FONT><FONT color="#2b91af" size="2"
face="Consolas"><FONT color="#2b91af" size="2" face="Consolas"><FONT color="#2b91af"
size="2" face="Consolas">UriReportSource</FONT></FONT></FONT><FONT size="2"
face="Consolas"><FONT size="2" face="Consolas">();</FONT></FONT></P>
<P><FONT size="2" face="Consolas"><FONT size="2" face="Consolas"> </P>
<P> Telerik.Reporting.</P>
<P></FONT> </P>
<P></P>
<P></FONT> </P>
<P><FONT color="#2b91af" size="2" face="Consolas"><FONT color="#2b91af" size="2"
face="Consolas"><FONT color="#2b91af" size="2"
face="Consolas">UriReportSource</FONT></FONT></FONT><FONT size="2" face="Consolas"><FONT
size="2" face="Consolas"> Telrpt2 = </FONT></FONT><FONT color="#0000ff" size="2"
face="Consolas"><FONT color="#0000ff" size="2" face="Consolas"><FONT color="#0000ff"
size="2" face="Consolas">new</FONT></FONT></FONT><FONT size="2"
face="Consolas"><FONT size="2" face="Consolas">
Telerik.Reporting.</FONT></FONT><FONT color="#2b91af" size="2"
face="Consolas"><FONT color="#2b91af" size="2" face="Consolas"><FONT color="#2b91af"
size="2" face="Consolas">UriReportSource</FONT></FONT></FONT><FONT size="2"
face="Consolas"><FONT size="2" face="Consolas">();</FONT></FONT></P>
<P><FONT size="2" face="Consolas"><FONT size="2" face="Consolas"> </P>
<P> Telrpt.Uri = </P>
<P></FONT> </P>
<P></P>
<P></FONT> </P>
<P><FONT color="#a31515" size="2" face="Consolas"><FONT color="#a31515" size="2"
face="Consolas"><FONT color="#a31515" size="2"
face="Consolas">"TelRptContractTest.trdx"</FONT></FONT></FONT><FONT size="2"
face="Consolas"><FONT size="2" face="Consolas">;<BR><FONT size="2" face="Consolas"><FONT
size="2" face="Consolas"></P>
<P>System.Drawing.Printing.</P>
<P></FONT></P>
<P></P>
<P></FONT></P>
<P><FONT color="#2b91af" size="2" face="Consolas"><FONT color="#2b91af" size="2"
face="Consolas"><FONT color="#2b91af" size="2"
face="Consolas">PrinterSettings</FONT></FONT></FONT><FONT size="2" face="Consolas"><FONT
size="2" face="Consolas"> printerSettings = </FONT></FONT><FONT color="#0000ff"
size="2" face="Consolas"><FONT color="#0000ff" size="2" face="Consolas"><FONT
color="#0000ff" size="2" face="Consolas">new</FONT></FONT></FONT><FONT size="2"
face="Consolas"><FONT size="2" face="Consolas">
System.Drawing.Printing.</FONT></FONT><FONT color="#2b91af" size="2" face="Consolas"><FONT
color="#2b91af" size="2" face="Consolas"><FONT color="#2b91af" size="2" face="Consolas">PrinterSettings</FONT></FONT></FONT><FONT
size="2" face="Consolas"><FONT size="2" face="Consolas">();</FONT></FONT></P>
<P><FONT size="2" face="Consolas"><FONT size="2" face="Consolas"> </P>
<P> System.Drawing.Printing.</P>
<P></FONT></P>
<P></P>
<P></FONT></P>
<P><FONT color="#2b91af" size="2" face="Consolas"><FONT color="#2b91af" size="2"
face="Consolas"><FONT color="#2b91af" size="2"
face="Consolas">PrintController</FONT></FONT></FONT><FONT size="2" face="Consolas"><FONT
size="2" face="Consolas"> standardPrintController = </FONT></FONT><FONT color="#0000ff"
size="2" face="Consolas"><FONT color="#0000ff" size="2" face="Consolas"><FONT
color="#0000ff" size="2" face="Consolas">new</FONT></FONT></FONT><FONT size="2"
face="Consolas"><FONT size="2" face="Consolas">
System.Drawing.Printing.</FONT></FONT><FONT color="#2b91af" size="2" face="Consolas"><FONT
color="#2b91af" size="2" face="Consolas"><FONT color="#2b91af" size="2" face="Consolas">StandardPrintController</FONT></FONT></FONT><FONT
size="2" face="Consolas"><FONT size="2" face="Consolas">();</FONT></FONT></P>
<P><FONT size="2" face="Consolas"><FONT size="2" face="Consolas"> </P>
<P> Telerik.Reporting.Processing.</P>
<P></FONT></P>
<P></P>
<P></FONT></P>
<P><FONT color="#2b91af" size="2" face="Consolas"><FONT color="#2b91af" size="2"
face="Consolas"><FONT color="#2b91af" size="2"
face="Consolas">ReportProcessor</FONT></FONT></FONT><FONT size="2" face="Consolas"><FONT
size="2" face="Consolas"> reportProcessor = </FONT></FONT><FONT color="#0000ff"
size="2" face="Consolas"><FONT color="#0000ff" size="2" face="Consolas"><FONT
color="#0000ff" size="2" face="Consolas">new</FONT></FONT></FONT><FONT size="2"
face="Consolas"><FONT size="2" face="Consolas">
Telerik.Reporting.Processing.</FONT></FONT><FONT color="#2b91af" size="2" face="Consolas"><FONT
color="#2b91af" size="2" face="Consolas"><FONT color="#2b91af" size="2" face="Consolas">ReportProcessor</FONT></FONT></FONT><FONT
size="2" face="Consolas"><FONT size="2" face="Consolas">();</FONT></FONT></P>
<P><FONT size="2" face="Consolas"><FONT size="2" face="Consolas"> </P>
<P> Telrpt.Parameters.Add(</P>
<P></FONT></P>
<P></P>
<P></FONT></P>
<P><FONT color="#0000ff" size="2" face="Consolas"><FONT color="#0000ff" size="2"
face="Consolas"><FONT color="#0000ff" size="2"
face="Consolas">new</FONT></FONT></FONT><FONT size="2" face="Consolas"><FONT
size="2" face="Consolas"> Telerik.Reporting.</FONT></FONT><FONT color="#2b91af"
size="2" face="Consolas"><FONT color="#2b91af" size="2" face="Consolas"><FONT
color="#2b91af" size="2" face="Consolas">Parameter</FONT></FONT></FONT><FONT
size="2" face="Consolas"><FONT size="2" face="Consolas">(</FONT></FONT><FONT
color="#a31515" size="2" face="Consolas"><FONT color="#a31515" size="2" face="Consolas"><FONT
color="#a31515" size="2" face="Consolas">"txtLocation"</FONT></FONT></FONT><FONT
size="2" face="Consolas"><FONT size="2" face="Consolas">,
Location));</FONT></FONT></P>
<P><FONT size="2" face="Consolas"><FONT size="2" face="Consolas"> </P>
<P> Telerik.Reporting.</P>
<P></FONT></P>
<P></P>
<P></FONT></P>
<P><FONT color="#2b91af" size="2" face="Consolas"><FONT color="#2b91af" size="2"
face="Consolas"><FONT color="#2b91af" size="2"
face="Consolas">InstanceReportSource</FONT></FONT></FONT><FONT size="2" face="Consolas"><FONT
size="2" face="Consolas"> instanceReportSource = </FONT></FONT><FONT color="#0000ff"
size="2" face="Consolas"><FONT color="#0000ff" size="2" face="Consolas"><FONT
color="#0000ff" size="2" face="Consolas">new</FONT></FONT></FONT><FONT size="2"
face="Consolas"><FONT size="2" face="Consolas">
Telerik.Reporting.</FONT></FONT><FONT color="#2b91af" size="2"
face="Consolas"><FONT color="#2b91af" size="2" face="Consolas"><FONT color="#2b91af"
size="2" face="Consolas">InstanceReportSource</FONT></FONT></FONT><FONT size="2"
face="Consolas"><FONT size="2" face="Consolas">();</FONT></FONT></P>
<P><FONT size="2" face="Consolas"><FONT size="2" face="Consolas"> </P>
<P> </P>
<P> </P>
<P> reportProcessor.PrintController = standardPrintController;</P>
<P> </P>
<P> reportProcessor.PrintReport(Telrpt, printerSettings); </P>
<P></FONT></FONT></FONT></FONT></P>
<P><FONT size="2" face="Consolas"><FONT size="2"
face="Consolas"></FONT></FONT></FONT></FONT> </P><FONT size="2" face="Consolas"><FONT
size="2" face="Consolas"></FONT></FONT><FONT size="2" face="Consolas"><FONT
size="2" face="Consolas"></FONT></FONT><BR>
IvanY
Telerik team
 answered on 18 Jun 2013
3 answers
122 views
ActiveReports has this option to display report:
pdfReport.Options.DisplayMode = DataDynamics.ActiveReports.Export.Pdf.DisplayMode.FullScreen;

Does telerik reporting have a similar option?  I can not seem to locate it .  So far I have tried the following:
Telerik.Reporting.Report Telrpt = new TelRptContract();
                    Telerik.Reporting.Processing.ReportProcessor TelContractrp = new Telerik.Reporting.Processing.ReportProcessor();
                    System.Collections.Hashtable deviceInfo = new System.Collections.Hashtable();
                    Telerik.Reporting.InstanceReportSource TelContractirs = new Telerik.Reporting.InstanceReportSource();
                    TelContractirs.ReportDocument = Telrpt;
                    Telerik.Reporting.Processing.RenderingResult result = TelContractrp.RenderReport("PDF", TelContractirs, deviceInfo);
                    string dContract = DateTime.Now.ToString().Replace("/", "");
                    dContract = dContract.Substring(0, 9);
                    string fileName2 = result.DocumentName + "_" + dContract + "." + result.Extension;
                    //string path2 = "c:\\Users\\akinw\\Desktop\\";
                    //string path2 = System.IO.Path.GetTempPath();
                    string path2 = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);
                    string filePath2 = System.IO.Path.Combine(path2, fileName2);
                    FileStream fs = new FileStream(filePath2, FileMode.Create);
                    fs.Write(result.DocumentBytes, 0, result.DocumentBytes.Length);
                    fs.Close();
                    //fs = File.Open(filePath2, FileMode.Open);                   
                    System.IO.File.Open(filePath2, FileMode.Open);

The commented out part is an option I have tried.  The report converts and is saved to my desktop but does not open. What is missing?  Thanks in advance.
Peter
Telerik team
 answered on 18 Jun 2013
1 answer
138 views

I want to declare a telrik report and then start passing data to it for display.  In the following code it is seen that my activereports- which reside in another project) are seen.  but when i do similar code for telrik report it can not find the report and the telrik report resides in the same project that the activereports are.  What is the solution.  When I add Telrpt.Uri = "name of report"; at debug an error occurs stateing it can not find the uri. 

So this is two pronged 1. How can I do similar with telerik (Telerik.Reporting.Report = new TelRptContractTest(); as is done with activereport (DataDynamics.ActiveReports.ActiveReport rpt = new RptCustomerContract();)
2.  How can i pass data to telrik report in similar way as [((RptCustomerContract)rpt).MinContractYear = cheader.DeliveryBeginDate.Value.Year;]
The telrik reports have been added to the project and Telerik.Reporting is in the reference file of the application.

DataDynamics.ActiveReports.ActiveReport rpt = new RptCustomerContract();
DataDynamics.ActiveReports.ActiveReport rpt2 = new RptCustomerContractLocationDetail();
Telerik.Reporting.UriReportSource Telrpt = new Telerik.Reporting.UriReportSource();
((RptCustomerContract)rpt).MinContractYear = cheader.DeliveryBeginDate.Value.Year;

 

Squall
Top achievements
Rank 1
 answered on 17 Jun 2013
2 answers
565 views
When i run the following code a pdf is created but it will not open.  When i try to open it manually by double clicking on it an error which says that adobe can not open the file because it has been corrupted somehow . . . . . . .
The commented out lines are things that I have tried.
Telerik.Reporting.Report Telrpt = new TelRptContract();
                    Telerik.Reporting.Processing.ReportProcessor TelContractrp = new Telerik.Reporting.Processing.ReportProcessor();
                    System.Collections.Hashtable deviceInfo = new System.Collections.Hashtable();
                    Telerik.Reporting.InstanceReportSource TelContractirs = new Telerik.Reporting.InstanceReportSource();
                    TelContractirs.ReportDocument = Telrpt;
                    Telerik.Reporting.Processing.RenderingResult result = TelContractrp.RenderReport("PDF", TelContractirs, deviceInfo);
                    string fileName2 = result.DocumentName + "." + result.Extension;
                    //string path2 = "c:\\Users\\akinw\\Desktop\\";
                    //string path2 = System.IO.Path.GetTempPath();
                    string path2 = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);
                    string filePath2 = System.IO.Path.Combine(path2, fileName2);
                    FileStream fs = new FileStream(filePath2, FileMode.Create);       
                    fs.Close();
                    //fs = File.Open(filePath2, FileMode.Open);
                    System.IO.File.Open(filePath2, FileMode.Open);
William
Top achievements
Rank 1
 answered on 17 Jun 2013
3 answers
292 views
Hi,

I have been playing around with Telerik Reporting to see if we could use it to produce pdfs/printouts of data from our application that is displayed in a RadGridView.

A few of our grids have a sparkline column and I was trying to reproduce this in a report but I was having some trouble.

We have a data object that represents a single row in the report/RadGridView. This data object has a number of properties of various types for the different fields and one property which is a list of points used to create a sparkline.

I can get the values for the simple properties to display fine using textboxes and selecting the data we want using [=Field1] etc. However I can't see how to assign a data property to a GraphSeries so that the date from that property is plotted on the graph.

Any help you could give me on this matter would be greatly appreciated.

Thanks,

Steven
IvanY
Telerik team
 answered on 14 Jun 2013
4 answers
192 views
We are planning to use load balancer to improve our web service application performance. Since we are going to use this load balancer, we prefer not to use any session state in our application which means the session state will be completely disabled by default. The problem is now our web service application also hosts the Telerik Reporting WCF service. We just found out that this reporting service requires the session state to be enabled. Is there anyway for us to avoid this session state?
Stef
Telerik team
 answered on 14 Jun 2013
1 answer
120 views

 Hi,

I have a masterPageA and a contentPageB

on the master page i have

<script type="text/javascript">
        function noBack() {
            window.history.forward();
        }
 
</script>
 
<body onload="noBack();" onprerender="if (event.persisted) noBack();" onunload="">

The content page is of the structure
<asp:MultiView
 <asp:View
  <asp:Button Button1
  <asp:Button Button2 
  <asp:Table
  <telerik:ReportViewer
 </asp:View
When the button1 or button2 is clicked the table and the reportviewer update to show the
correct report. The reportviewer reports have only graph. The table shows the data. 

User action.

1) Home page
2) load the content page (default view is report A which corresponds to button 1)
3) clicks on button2
4) clicks on browser back button...

What Happens,
It gets back to the reportA but only the table has data in the report viewer 
I  get an error message


Report is unavailable or session has expired.

Please, refresh the page.


How do I solve this.

Thanks
KS
Top achievements
Rank 1
 answered on 14 Jun 2013
2 answers
130 views
Hi,

I'm just looking at the latest domos for Reporting.  If I use IE8 the charts don't display.  They do display in Firefox and in IE10.  Attached  two screenshots.
Joan
Top achievements
Rank 1
 answered on 13 Jun 2013
5 answers
722 views
I am evaluating Reporting for a client application...I like a lot of the features BUT it wont print properly to a Zebra...even Access will do this.

I have a 4" x 1" label... I created a report in VB and set page size and the report previews perfectly BUT the print out looks like the text is sitting on its side going from bottom to top! on the left side... Printing to the zebra is as simple as printing a proerly sized report in Access!!

Has anyone ever gotten Reports to print on a zebra!!??


Thanks,

Stef
Telerik team
 answered on 13 Jun 2013
2 answers
242 views
I appreciate the training videos for using Telerik reporting with Visual Studio.  But, I am a novice who has only used VB and NOT C#.  Are there videos available that use VB.  I do not know how to traslate some of the C# behind code to VB.

Forgive my lack of knowlege.  Any advice is appreciated.

-Jennifer
Jennifer
Top achievements
Rank 1
 answered on 13 Jun 2013
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?