Page 1 of 1

Blank page on retrieving report with simple data

Posted: Mon Jul 16, 2012 7:45 am
by _Sergey
Hi. I get a blank page when exporting to PDF format.

Code: Select all

var report = new StiReport();
report.LoadDocument(Server.MapPath("~/Content/reports/report2.mrt"));
report.Render();
var stream = new MemoryStream();
report.ExportDocument(StiExportFormat.Pdf, stream);
byte[] byteInfo = stream.ToArray();
stream.Write(byteInfo, 0, byteInfo.Length);
stream.Position = 0;
return File(stream, "application/pdf", "report.pdf");
The report contains the ReportTitleBand with "Hello World" text field.
Thanks.

Re: Blank page on retrieving report with simple data

Posted: Mon Jul 16, 2012 2:24 pm
by Vladimir
Hello, Sergey

Please use the report.Load() method instead of report.LoadDocument().

The report.LoadDocument() method is used to load .mdc files (rendered reports).

Thank you.