Custoim email action bad render
Posted: Tue Aug 04, 2020 1:23 pm
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,
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,