Parameter in report code is always empty

Stimulsoft Ultimate discussion
Post Reply
dabbas
Posts: 4
Joined: Fri Apr 10, 2015 6:55 am

Parameter in report code is always empty

Post by dabbas »

Hi
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();
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":

Code: Select all

{LoadImage(ReportModel.ImageBase64String)}
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
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Parameter in report code is always empty

Post by Alex K. »

Hello,

Please send us a sample project which reproduce the issue for analysis.

Thank you.
dabbas
Posts: 4
Joined: Fri Apr 10, 2015 6:55 am

Re: Parameter in report code is always empty

Post by dabbas »

Thanks you for replying, it was a mistake from me that the name of registered business model is wrong.
It works now.
But have another problem with fonts, the font in "Preview" is a little bit different (more bold) when I export to PDF, what could be the problem ?
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Parameter in report code is always empty

Post by Alex K. »

Hello,

Please clarify which component you are use for the preview.
Also please try to set the TextQuality property to the Wysiwyg.

Thank you.
Post Reply