Parameter in report code is always empty
Posted: Fri Apr 10, 2015 8:52 am
Hi
I'm trying to export to PDF using his code:
I have a method in the report's code called "LoadImage", I pass a base64 string for it and convert it to object of type Image, the passed string is taken from the BusinessObject I'm passing (above in the exporting code I wrote), and in the report in the image I want to display I put this in its "Image Data":
The problem is in LoadImage method the parameter (it should be passed by ReportModel.ImageBase64String) is always empty, although I know it has value.
LoadImage is static method in the report's code.
What's the problem
I'm trying to export to PDF using his code:
Code: Select all
var reportVM = GetData();
StiReport report = new StiReport();
report.Load("Path to .mrt file");
report.RegBusinessObject(@"ReportViewModel", reportVM);
report.Render();
StiPdfExportService spes = new StiPdfExportService();
StiPdfExportSettings settings = new StiPdfExportSettings();
settings.ImageQuality = 1.0f;
settings.EmbeddedFonts = true;
FileStream stream = new FileStream("Path where to save the PDF file", FileMode.OpenOrCreate, FileAccess.ReadWrite);
spes.ExportPdf(report, stream, settings);
stream.Close();
Code: Select all
{LoadImage(ReportModel.ImageBase64String)}
LoadImage is static method in the report's code.
What's the problem