by arehman » Tue Jul 10, 2012 3:52 pm
i am also posting here
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());
pi.setIsBatch(true);
pi.setAD_PInstance_ID(pInstanceId.get_ID());
ReportStarter rptSt = new ReportStarter();
boolean success = rptSt.startProcess(getCtx(), pi, null);
if(success){
return pi.getPDFReport();
}else{
return null;
}// end of createPDF