Send jasper report email via workflow

  • Hello All,

    I have created a purchase order report in jasper (iReport).
    I want to send it to vendor via workflow approval. (means when manager approve purchase order its report should send to the vendor.

    Workflow can send the report which is created on adempiere report; But my report is created on jasper report.

    How can i do this?

    Thanks and Best Regards,

  • Solution

    I have just added following code in the model class of required table which must have to implement DocAction
    After writing all the required method of DocAction interface, i have change the following method:

    public File createPDF (File file)
    * Author: Abdur Rehman Habib
    * You can get process id from query. I have just hard coded the process id.
    int ProcessId = 1000032;
    MProcess process = MProcess.get(getCtx(), ProcessId);
    MPInstance pInstanceId = new MPInstance(process, get_ID());
    ProcessInfo pi = new ProcessInfo("Order", ProcessId, Table_ID, get_ID());
    ReportStarter rptSt = new ReportStarter();
    boolean success = rptSt.startProcess(getCtx(), pi, null);

    return pi.getPDFReport();
    return null;
    }// end of createPDF

  • FarooqSha

    hi …Abdur Rehman Habib .. am aslo doing Purchase Order .. can u help here ..