on 2024 Mar 14 9:30 PM
I want to use crystal report from a java application, with pre configured reports just pass them the parameter to the report, we allredy doing it like this but currently the report are created by a seprate c# service this one should be merged to the main java application
chat gpt says it should look like this
import com.crystaldecisions.sdk.occa.report.application.ReportClientDocument; import com.crystaldecisions.sdk.occa.report.exportoptions.ExportOptions; import com.crystaldecisions.sdk.occa.report.exportoptions.PDFExportFormatOptions; public class CrystalReportsExporter { public static void main(String[] args) { try { ReportClientDocument reportClientDoc = new ReportClientDocument(); reportClientDoc.open("YourReportFile.rpt", 0); // Export the report to PDF ExportOptions exportOptions = new ExportOptions(); PDFExportFormatOptions pdfExportFormatOptions = new PDFExportFormatOptions(); exportOptions.setExportFormatType(com.crystaldecisions.sdk.occa.report.exportoptions.ReportExportFormatEnum.PDF); exportOptions.setFormatOptions(pdfExportFormatOptions); reportClientDoc.getReportSource().getExportOptions().setExportOptions(exportOptions); reportClientDoc.getReportSource().export("YourReportOutput.pdf"); // Display the exported PDF report using an appropriate PDF viewer library // Code for displaying PDF in Java application goes here } catch (Exception e) { e.printStackTrace(); } } }
what is pretty simular like we to it now in c#
where i will get the sdk for this
Request clarification before answering.
User | Count |
---|---|
51 | |
6 | |
5 | |
5 | |
5 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.