Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

tJasperReportExec produces empty / blank DOCX

Hi,

Been trying to use exchange component tJasperReportExec, I am new to jasper reports and not hugely experienced in Talend so likely a dumb error on my part, but...

My aim would be to use this component to produce a DOCX using a parameter to pass a value to the query used to populate the report. I have a simple PoC report which works i generate from  jasper reports studio where I have given the parameter a default value. In my talend job I have given the parameter defined in the component a different static value.

My talend job runs without error, the DOCX is saved but is empty. I tried Output Type: PDF and that is empty too. 

I removed the parameter definition in the Talend component, re ran the job and the DOCX is populated using the default parameter value defined in the JRXML. So seems to be something in the way I am passing / receiving the parameter 

Some wisdom to move me froward would be greatly appreciated.


Cant add a live link but JRXML is available to FTP from here (HTTP:// removed) : support.domino-printing.com/sendfile/4283_agiledoctest3.jrxml
0683p000009MGAI.png

0683p000009MGAN.png

Labels (2)
9 Replies
Anonymous
Not applicable
Author

It looks like you an out dated release of this component. Could you please check to download a newer one.
The newer release has an option to check the given parameters if they find their counterpart within the report and fail if not.
If you do not find in Exchange the last release you can download it also here:
http://jan-lolling.de/talend/components/tJasperReportExec.zip
Anonymous
Not applicable
Author

Hi Jan,
Thank you for your prompt response and creating this useful component.
I had originally sourced a copy from talend exchange, but replaced it with a copy from the link you provided with no change.  The good news is I have identified the issue, the query used in the JRXML queried a view that is quite slow to yield results. I tried a different query that was much faster and the Docx is rendered by the   tJasperReportExec component using the parameter passed from talend whereas in Jasper it uses the default parameter value.
Is there a timeout set I should check the report query should return within?

Regards
Adrian
Anonymous
Not applicable
Author

The handover of parameters works well in this component, I use this in various projects - I am sure about that.
Did you checked the Check Parameters option? This option checks if the given parameter exists in the report and let the job fail if not.
This way we can prevent spelling errors. Without this option a spelling error will not be recognized and the value silently does not reach the report.
Anonymous
Not applicable
Author

Hi Jan
Yes I agree parameter handover is working well this was not the cause of my problem, I checked the 'check parameters' box, no errors are reported.  
The issue seems to be caused by the execution time of the query defined in the JRXML. My original test job was querying a view which takes around 48 seconds to return results.  Here I get the empty DOCX.
I made a new test to a different JRXML where I query a different table with an SQL query execution time of typically 0.08 seconds. The DOCX report is rendered correctly.
Clearly I need to look at the view to see if it can be improved to speed up execution time. 
But was curious if you had built in a timeout i.e. what is the maximum query execution time the component will tolerate?
Thanks agin for your prompt response.
Adrian
Anonymous
Not applicable
Author

Hi Adrian, there is no timeout at all (perhaps whole connecting to the database but for sure not for restricting queries!).
If you run the query in a normal plain SQL tool you get a correct answer - you said. 
Are you expecting a large result set (number rows?). I am not sure how the JasperLibrary handles SQL queries. It could be they do not use the fetch size - I will check that. Which kind of database do you use?
Anonymous
Not applicable
Author

Hi Jan,
Its an oracle 11i database.
Both queries I have tried are written to return a single row. So no large data set expected
Both queries give the correct answer in my SQL tool
Both queries give the  the correct answer in Jasper Reports Studio in data-set query editor dialog  (and render the report preview and export to DOCX correctly)
It's only in the talend component the I see the issue with the longer running query. Having said that I have manged to recreate the view in a slightly more efficient form with  SQL execution around 11 seconds and the DOCX gets rendered correctly by the component. So I have an effective workaround now.

Thanks for all the support
Adrian
Anonymous
Not applicable
Author

It could be a matter of the used JDBC driver. Could you please execute the query inside a tOracleInput component (with an example parameter)? It would be great to know if you get here also the expected result. 
Anonymous
Not applicable
Author

Hi Jan,
So ran the test you requested: toracleinput component with same parameter value set as a context variable in the same SQL as used in the JRXML, output to tlogrow is correct.
But, The view I am querying has been changed and returns results faster, which as reported yesterday doesn't seem to be a problem when using your japser component anymore. So is probably not a representative test.
Anonymous
Not applicable
Author

I guess it is a problem with the JasperLibrary and the way they setup the statement. In a normal Oracle component you can have a fetch size and I am not sure if the JasperLibrary does the same. I will take a look at it. It should never be a matter of this library to decide a query runs to long.