Click here to Skip to main content
15,888,984 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I am getting a crystal report from the server and I need to save the pdf file automatically into database.
How can I get the exported crystal report as ByteArrayOutputStream

What I have tried:

Java
ReportExportControl exportControl = new ReportExportControl();

exportControl.setReportSource(reportSource);
exportControl.setParameterFields(parameterFields);
exportControl.setDatabaseLogonInfos(oConnectionInfos);
exportControl.setExportAsAttachment(true);
exportControl.setOwnPage(true);
exportControl.setProductLocale(new Locale("en", "US"));

ExportOptions exportOptions = new ExportOptions();
exportOptions.setExportFormatType(ReportExportFormat.PDF);

exportControl.setExportOptions(exportOptions);

XBoeTools.getInstance().setOutHeadderForResponse(request, response, "PDF");

exportControl.processHttpRequest(request, response, getServletConfig().getServletContext(), null);
Posted
Updated 18-Apr-18 17:26pm
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900