Initial language based on BPartner. In all cases, you should be able to retrieve a AD_User record which should be linked to a BPartner and so, be able to read language there.
If no BPartner or if BPartner.Language is empty, you can use the language defined at Tenant level.
For the customizable file name, I think we need here a common approach.
When you download a report, you can only select the type (Excel, Pdf, ...). A textbox (pre-filled with 'default file name' - which should already be defined on the print format AFAIR) would be really useful.
must it be consistent with ReportEngine.get ?
public File createPDF (File file)
{
ReportEngine re = ReportEngine.get (getCtx(), ReportEngine.INVOICE, getC_Invoice_ID(), get_TrxName());
if (re == null)
return null;
MPrintFormat format = re.getPrintFormat();
// We have a Jasper Print Format
// ==============================
if(format.getJasperProcess_ID() > 0)
{
ProcessInfo pi = new ProcessInfo ("", format.getJasperProcess_ID());
pi.setRecord_ID ( getC_Invoice_ID() );
pi.setIsBatch(true);
ServerProcessCtl.process(pi, null);
return pi.getPDFReport();
}
// Standard Print Format (Non-Jasper)
// ==================================
return re.getPDF(file);
} // createPDF
public File createPDF (File file)
{
return null;
} // createPDF
class PO {
private boolean m_canCreatePdf = false;
private int m_type = -1; (...)
public File createPDF (File file) {
if(!m_canCreatePdf) return null; ReportEngine re = ReportEngine.get (getCtx(), m_type, getC_Invoice_ID());
// Jasper related stuff gets handled by ReportEngine.get() if (re == null) return null; return re.getPDF(file); } // createPDF }
being jasper part of core at this moment - maybe would be good to check if these options are valuable for trunk instead of creating a new plugin ?
... Not to replace the entire report engine.