on 06-12-2013 9:14 AM
Hi!
I need to export a report to PDF using the PageServer and not using RAS (not use RAS is a requisite), but I need to pass parameters to the report.
There is any way to pass parameters to the report using a code like this?
SessionMgr sessionMgr = new SessionMgr();
EnterpriseSession enterpriseSession = sessionMgr.Logon();
InfoStore infoStore = (InfoStore)enterpriseSession.GetService("InfoStore");
PSReportFactory ps = (PSReportFactory)enterpriseSession.GetService("PSReportFactory").Interface;
InfoObject infoObject = infoStore.Query("SELECT * FROM ci_infoobjects WHERE si_name LIKE '%" + "CrystalReport" + "%'")[1];
ReportSource rs = (ReportSource)ps.OpenReportSource(infoObject.ID);
PDFExportFormatOptions fo = new PDFExportFormatOptions();
fo.StartPageNumber = 1;
fo.EndPageNumber = 1;
ExportOptions export = new ExportOptions();
export.ExportFormatType = CrReportExportFormatEnum.crReportExportFormatPDF;
export.FormatOptions = fo;
//Se exporta el informe a un stream de datos, y éste a un array de bytes, que es finalmente el que se escribe en pantalla.
byte[] contenido = (byte[])rs.Export(export, new RequestContextClass());
Response.ClearHeaders();
Response.ClearContent();
Response.ContentType = "application/pdf";
Response.AddHeader("Content-Disposition", "attachment; filename=" + "Jur.pdf");
Response.BinaryWrite(contenido);
Regards,
César
Hi,
Has someone found a solution for that issue ?
I've got the same question.
Best regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
81 | |
24 | |
11 | |
9 | |
7 | |
5 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.