Custom name is not taken when running a core PDF report programatically
Description
When you are generating a report programmatically within a plug-in and set the report name to the ProcessInfo. The report engine is not taking that name and assigns a generic one every time.
The following code should generate a PDF report with the document no as the name of the file, but instead generates an Invoice_Header.pdf report.
When you are generating a report programmatically within a plug-in and set the report name to the ProcessInfo. The report engine is not taking that name and assigns a generic one every time.
The following code should generate a PDF report with the document no as the name of the file, but instead generates an Invoice_Header.pdf report.
MProcess orderPrintout = MProcess.get(Env.getCtx(), 110); ProcessInfo pi = new ProcessInfo(orderPrintout.getName(), orderPrintout.getAD_Process_ID()); pi.setRecord_ID(order.getC_Order_ID()); pi.setAD_Client_ID(Env.getAD_Client_ID(Env.getCtx())); pi.setTable_ID(order.get_Table_ID()); pi.setPDFFileName(order.getDocumentNo() + ".pdf"); .... File file = pi.getPDFReport();
When the report that you’re running programmatically is a jasper report the Process Info file name works perfectly.