A sorry error is generated when trying to export some of our new reports. It appears to be tied to there being a large amount of data in the export. We are able to reproduce this when there was a search criteria on 439 records. We were able to export this report to pdf when doing so directly from the web server. Has anyone else run across this error and if so how did you resolve it?
reportViewer1.ExportReport(
"DOC"
,
new
Hashtable()); // BAD
reportViewer1.ExportReport(
"XLS"
,
new
Hashtable()); // OK
reportViewer1.ExportReport(
"PDF"
,
new
Hashtable()); // OK
<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>
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);
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;
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);