Im creating a jsp in which I have button to export the data into pdf format like below which was working fine:
I wanted to have header and footer for the pdf. So I created two .png files and changed the above line to below.
But I could’t get the pdf. I think I did’t put the png files in the correct path.
Can anybody tell me how to handle this? PLease tell me where to have the png files. I have “dhtmlxgrid_export.js” in my import.
unfortunately it doesn’t provide header/footer supporting. To add header/footer in generated pdf you should use local export script at your server. There you may configure paths to images and print header and footer images.
I will appreciate if you can explain - how to use the local export script at my server. I am really new to dhtmlxgrid, so if you can provide a small example then it would be of great help.
where ‘your_server_is_here’ must be replaced with your server name.
If you use Java then you should deploy war-package (it may be done by several ways according Java-server which you use, please read more about deploying projects yourself). After that you should configure export url:
As per your suggestion given I am able to deploy grid-pdf(the war file as provided at dhtmlx.com) on my local server. In addition, the pdf is coming up correctly, however displaying the header image, i.e. a logo or some other text, above the table and to set the column width is still not happening.
Attached is the screenshot of what grid-pdf workspace structure looks like. I tried placing .jpg files, wherever I can think of, however I am still getting the error as below:-
“java.io.FileNotFoundException: \header.jpg (The system cannot find the file specified)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.(FileInputStream.java:120)
at java.io.FileInputStream.(FileInputStream.java:79)
at com.dhtmlx.xml2pdf.PDFWriter.printFooter(PDFWriter.java:348)
at com.dhtmlx.xml2pdf.PDFWriter.generate(PDFWriter.java:77)
at PDFGenerator.doPost(PDFGenerator.java:18)”
Please help me in resolving the header/footer issue.
The jsp code from where I am calling is as below:-
Also I have attached dhtmlxgrid_export.js which I have included in the jsp page.