Send jasper report email via workflow

Help is preferred to those who publish their work as Open Source and not as private branches rejecting collaboration. Such projects are not maintainable and shall be deleted.
Forum rules
This forum is personally pruned to avoid redundant posts. Related topics are grouped together. IF YOU HAVE REGISTERED, you need to send email to red1(a)red1.org with your username in the subject title to get me to activate you.

Send jasper report email via workflow

Postby arehman » Fri Jul 06, 2012 7:43 pm

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,
A.Rehman
arehman
 
Posts: 23
Joined: Fri Mar 18, 2011 9:42 pm

Re: Send jasper report email via workflow

Postby globalqss » Fri Jul 06, 2012 10:51 pm

Is it a process or a document form?
globalqss
Senior
 
Posts: 590
Joined: Thu Dec 29, 2005 4:15 am
Location: Bogotá, Colombia

Re: Send jasper report email via workflow

Postby arehman » Sun Jul 08, 2012 10:02 pm

its a document form/report made on jasper
arehman
 
Posts: 23
Joined: Fri Mar 18, 2011 9:42 pm

Re: Send jasper report email via workflow

Postby arehman » Tue Jul 10, 2012 1:27 am

my friend i have done this by writing some code. Thanks for giving me a good response. I think it is not a part of original Adempiere version. But you can add in into your patches and modified it so it become more generic and then other community member can get benefit from it.

Thanks and Best Regards,
A.Rehman
arehman
 
Posts: 23
Joined: Fri Mar 18, 2011 9:42 pm

Re: Send jasper report email via workflow

Postby globalqss » Tue Jul 10, 2012 12:42 pm

Thanks, if you want you can share the code in jira.idempiere.com opening a ticket and attaching the patch there.
globalqss
Senior
 
Posts: 590
Joined: Thu Dec 29, 2005 4:15 am
Location: Bogotá, Colombia

Re: Send jasper report email via workflow

Postby arehman » Tue Jul 10, 2012 3:51 pm

i have post the code into jira.idempiere.com by opening new issue with tag improvement. Please improve it as per standard and add it in your patches, i don't know how to create patches etc. i always change the code in customiztion project if any body wants any type of help which i can provide then i am always available
arehman
 
Posts: 23
Joined: Fri Mar 18, 2011 9:42 pm

Re: Send jasper report email via workflow

Postby 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
arehman
 
Posts: 23
Joined: Fri Mar 18, 2011 9:42 pm


Return to HELP ME!!!

Who is online

Users browsing this forum: No registered users and 2 guests