Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi ,
I want send jasper report outputs as email attachments
I am using tjasperReportExec. The job looks as shown below. If I have to send the report output as an attachment to multiple email addresses, how do I do it? As of now it stores the output in a directory. Also, if I have 10 different email and the report output differs for each email, how do I pick the relevant attachment and send it in tsendmail component?
Also what is the difference between tjasperoutputexec, tjasperreportexec and tjasperoutput?
Any ideas on this will be of great help
Thanks
Rathi
Hi fdenis, I figured it out
I had to use ((String)globalMap.get("tJasperReportExec_1_OUTPUT_FILE")) this in the attachment section of tsendmail.
Now, I have another problem. The job runs fine on windows, when I run it on linux, I get the error
java.lang.Exception: No Connection or JRDataSource available to fill the report
But, I have used to tmysqlconnection to populate the connection details
Any help on this please?
for multiple Email you can use semicolon( as a separator. Also to send different to differ user user you can use Trigger then runif strategy.
to send multiple reports, generate multiple report name using globalMap value of the tflowtoiterate.
Hi Aashish,
I want it to loop, so I have used the tflowtoiterate. I want the report generated 10 times, each one containing the data specific for the email ID.
So, the relevant attachment needs to go to the correct email ID
My requirement is exactly the same as the solution in the video https://community.jaspersoft.com/blog/report-bursting-jasperreports-server
I read in a couple of articles that tjasperserverexec is not to be used as it is not updated regularly, hence using tjasperreportexec
Thanks
Rathi
Hi fdenis,
Thanks, but, how do I attach it in the tsendmail? And how do I pick what is the relevant one for the specific email ID?
when you attache the document just add the output name of the report.
Define it unchecking "Use Default Output Name"
Fill Output name using distinct globalMap value as an email_id
Hi fdenis,
In the attachment section of the tsendmail, I have used the code "C:/Users//report_out"+"_"+ ((Long)globalMap.get("row1.id"))+".xls"
And the tjasperreportexec has outputted these files already in the location mentioned above, report_out_1.xls, report_out_2.xls etc.
But I get the java.io.FileNotFoundException: error.
I don't understand where is the error?
Users//report --> Users/report
Apologies, that was a typing error. The code used is Users/report and I get the file not found exception