Custoim email action bad render

Stimulsoft Reports.WEB discussion
Post Reply
tancoffm
Posts: 3
Joined: Tue Aug 04, 2020 1:06 pm

Custoim email action bad render

Post by tancoffm »

We builded our own mail send action. When the user chooses "send mail" from MVCviewer wil go to an action where i want to send the report by mail:

These are the lines supossed to do that:

StiReport reporterenderizado=new StiReport();
reporterenderizado.Load(Server.MapPath("~/Customizado/Reportes/" + reporte));
((StiSqlDatabase)reporterenderizado.Dictionary.Databases["MSSQL1"]).ConnectionString = CadenaConexionCliente.cadenaconexion();//cadena de conexion para la base
reporterenderizado["ParamSolicitud"] = idEntidad;
reporterenderizado.Render();
while (reporterenderizado.IsRendering==true)
{
Thread.Sleep(500);
};

MemoryStream stream = new MemoryStream();
StiPdfExportSettings settings = new StiPdfExportSettings
{
StandardPdfFonts = false

};
StiPdfExportService service = new StiPdfExportService();
Export.Pdf.AllowImportSystemLibraries = true;
service.ExportPdf(reporterenderizado, stream, settings);

System.IO.File.WriteAllBytes("temp.pdf", stream.ToArray());

The problem is that the file TEMP.PDF is not being renderized correctly. It bring wrong data, like the variable "ParamSolicitud" where never setted.

Thanks,
Lech Kulikowski
Posts: 6247
Joined: Tue Mar 20, 2018 5:34 am

Re: Custoim email action bad render

Post by Lech Kulikowski »

Hello,

Please send us a sample project that reproduces the issue for analysis.

Thank you.
tancoffm
Posts: 3
Joined: Tue Aug 04, 2020 1:06 pm

Re: Custoim email action bad render

Post by tancoffm »

Solved it by replacing this:

StiReport reporterenderizado=new StiReport();
reporterenderizado.Load(Server.MapPath("~/Customizado/Reportes/" + reporte));
((StiSqlDatabase)reporterenderizado.Dictionary.Databases["MSSQL1"]).ConnectionString = CadenaConexionCliente.cadenaconexion();//cadena de conexion para la base

With

StiReport reporterenderizado=StiMvcViewer.GetReportObject();
Lech Kulikowski
Posts: 6247
Joined: Tue Mar 20, 2018 5:34 am

Re: Custoim email action bad render

Post by Lech Kulikowski »

Hello,

Thank you for the information.
Post Reply