Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

[resolved] Problem open PDF File

Hi,
I have install the tFileOutputPDF component from  exchange.talend.com and it work great.
But when I try to open the pdf file at the end of my process, I have an error message like this one:

Starting job LaunchAPP at 10:22 09/09/2015.
[statistics] connecting to socket on port 3711
[statistics] connected
Exception in component tJava_1
java.lang.NullPointerException
at java.io.File.<init>(Unknown Source)
at lar_test.launchapp_0_1.LaunchAPP.tJava_1Process(LaunchAPP.java:1683)
at lar_test.launchapp_0_1.LaunchAPP.tMsgBox_1Process(LaunchAPP.java:1599)
at lar_test.launchapp_0_1.LaunchAPP.tRowGenerator_1Process(LaunchAPP.java:1447)
at lar_test.launchapp_0_1.LaunchAPP.runJobInTOS(LaunchAPP.java:1944)
at lar_test.launchapp_0_1.LaunchAPP.main(LaunchAPP.java:1796)
[statistics] disconnected
Job LaunchAPP ended at 10:22 09/09/2015. [exit code=1]


In the tJava

try {
Desktop.getDesktop().open(new File(((String)globalMap.get("tFileOutputPDF_1_FILE_NAME"))));
} catch (IOException e) {e.printStackTrace();}

advanced settings
import java.awt.Desktop;
import java.io.File;


If I try with just the XLS file it works without problem.

LAR_TEST.zip.zip

Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Hi,
Thank's I understand now 0683p000009MA9p.png

I have do this to open the PDf file:

try {
Desktop.getDesktop().open(new File(context.OutputFile));
} catch (IOException e) {e.printStackTrace();}

And for the XLS


try {
Desktop.getDesktop().open(new File(((String)globalMap.get(tFileOutputDelimited_1_FILE_NAME"))));
} catch (IOException e) {e.printStackTrace();}

Idea from :  Link

Thank's
Burnside.

View solution in original post

5 Replies
Anonymous
Not applicable
Author

It looks like the component does not fill the global variable correctly. Check in the source code if this var will be set or not.
To do so, select the  tFileOutputPDF component and switch to the Code tab below the job design.
Anonymous
Not applicable
Author

HI,
I don't understand very well where I must click/Go!
I have click on tFileOutputPDF, Click on Tab Run and on the tab under on the right I have choose : Debug Run.
I join the TalendJob
LaunchAPP.zip


Regards
Burnside.
Anonymous
Not applicable
Author

Hi Burnside,
Next to the Designer tab there is a Code tab which enables you to visualize the code and highlights the possible language errors.

Best regards
Sabrina

0683p000009MGgn.png
Anonymous
Not applicable
Author

Hi,
Thank's I understand now 0683p000009MA9p.png

I have do this to open the PDf file:

try {
Desktop.getDesktop().open(new File(context.OutputFile));
} catch (IOException e) {e.printStackTrace();}

And for the XLS


try {
Desktop.getDesktop().open(new File(((String)globalMap.get(tFileOutputDelimited_1_FILE_NAME"))));
} catch (IOException e) {e.printStackTrace();}

Idea from :  Link

Thank's
Burnside.
Anonymous
Not applicable
Author

Hi Burnside,

Thanks for sharing your solution with us.

Best regards
Sabrina