One Star

[tJasperOutput] Empty report with exported job (as autonomous job)

Hi Everyone,
I use the community version of Jaspersoft (iReport and JasperReport) and TOS (4.1.2) on a Windows plateform (XP).
I generally have no problem using it in local.
Since I've tried to export my job as autonomous job (.jar), it is a bit more difficult.
The aim in my case is to produce jobs and put them on a web server in order to lauch them from a php script.
I've already succeeded in droping the job on my webserver (Apache on a debian lenny plateform) and lauching it from a php script (using the shell_exec() function on the .sh produced file).
Here is the point :
- when I test/lauch the job in local (on the windows plateform) with local paths (D:/example.jrxml, D:/...) no problem.
- then I change the path in order to inform the webserver path ( /home/project/example.jrxml, /home/project/...). The job does'nt found the files (seems to be normal)
- So I export and put the job on my webserver, then lauch my php script ==> everything is produced (example.jasper, example.csv, example.pdf), the .csv is full of data (the ones I want) but the .pdf is empty.
You can find my job attached (I tried with and without tJasperOutputExec, it's the same)
I really don't understand where it comes from.
If somebody as a clue, it would be great!
7 REPLIES
Community Manager

Re: [tJasperOutput] Empty report with exported job (as autonomous job)

Hi
the .csv is full of data (the ones I want) but the .pdf is empty.

Which component output the pdf file? is it tJasperoutputExec? If so, I think the source file is empty and there is no rows. For me, you don't need the tJasperoutputExec component, select 'pdf' in the report type list of tJasperOutput component.
Best regards
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: [tJasperOutput] Empty report with exported job (as autonomous job)

In fact, I've tried the both :
- a job with only tJasperOutput
- a job with tJasperOutput and tJasperOutputExec
Unfortunatly, the both produce an empty pdf and a full data .csv...
Could it be a bug?
Is anyone have accurate documentation about how works tJasperOutput component, please?
Regards
Thomas
Community Manager

Re: [tJasperOutput] Empty report with exported job (as autonomous job)

Hi
How do you generate a *.csv file? There is no csv type in the report type list.
Best regards
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: [tJasperOutput] Empty report with exported job (as autonomous job)

The .csv file is automatically produced as a temp file (that's why it's been asked to inform a temporary repository).
the .csv contains data (so no problem with any database connection).
One Star

Re: [tJasperOutput] Empty report with exported job (as autonomous job)

Hi
the .csv is full of data (the ones I want) but the .pdf is empty.

Which component output the pdf file? is it tJasperoutputExec? If so, I think the source file is empty and there is no rows. For me, you don't need the tJasperoutputExec component, select 'pdf' in the report type list of tJasperOutput component.
Best regards
Shong

Shong , I have same kind of issue where i am reading data from .csv file and tJasperoutputExec for report generation, .csv file having data , but empty .pdf file is generating, the i open the .csv file in excel and i expand all columns )(alignment )and saved as same .csv file , then i got the .pdf with data , i didn't changed any data in .csv , only thing i did is just expand all columns and save it again
Seventeen Stars

Re: [tJasperOutput] Empty report with exported job (as autonomous job)

I wouldn't use this component because of it lack of support of parameters and sub reports.
Consider using the tJasperReportExec component which only needs a database connection and parameters if needed in your report. The goal of this component is to use a normal jrxml file and process it exactly in the way iReport would do.
A different approach could be configuring the report in JasperServer and start the report there with the tJasperServerReportStarter component to schedule the report (e.g. immediatly) on the server. The component provides the necessary link as result.
Both components are available in Talend Exchange.
Of course you can configure all possible output file types in these component.
One Star

Re: [tJasperOutput] Empty report with exported job (as autonomous job)

I had a similar problem and with a lot of work and some other helpful forum posts figured out what the problem is.
I created jasper reports that run fine on my windows box in the iReport application. And then they run fine when I run Talend on my windows box, but when I export the job and run it on a Linux box, the report is empty. It doesn't crash, it doesn't print any errors, it is created but has no data except the column titles. I think the problem is that Talend sets the line separators at compile time, not at run time. So when I move my compiled job to a unix system, it is still looking for windows line separators and the jasper program doesn't work.
The fix: this is irritating. A hack. An opportunity for Talend to improve.
Go to your Talend-Install_dir\plugins\org.talend.designer.components.localprovider_5.1.1.r84309\components\tJasperOutput\ dir. Adjust the path for your Talend version number.
Edit the file tJasperOutput_end.javajet, which sets the line separators. After the code that exists that conditionally sets it depending on os.name, I just added:
ds_<%=cid%>.setRecordDelimiter("\n");
Save this. Now you have to clear the component cache so the change will take effect.
Close Talend.
delete Talend-install-dir\configuration\ComponentsCache.javacache
Start Talend.
Open your job, save the job.
Now you should be able to export the job and have it work on a linux system. Of course, you'll have to reverse all this to test any new work on your windows box.