ys reddy

Greenhorn
+ Follow
since Jul 08, 2024
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by ys reddy

nothing (i feel) with print queue as jasper generates PDF output and shows on browser. any other clue to understand the problem. I suspect the problem with jar (v 7.0.0) files placed in the lib folder vs JDK (21) I have. But the same jasper file is running well inside jasper studio.
Hi

I have created a jasper report using jasperstudio 7.0. Report is woking fine inside the jasperstudio. But when call this jasper report from my java servlet, i am getting blank pdf ouput. jasperviewer shows "failed to load PDF document". when i export the PDF file, it is zero KB file. Below is my code with viewer and request your support to address my issue.

JasperReport jReport = (JasperReport) JRLoader.loadObjectFromFile("d:\\reports\\test.jasper");
JasperPrint jPrint = JasperFillManager.fillReport(jReport, null, myConnection);
JasperViewer.viewReport(jPrint,false);

I have below jar files in lib folder
commons-beanutils-1.9.4.jar
commons-codec.jar
commons-collections4-4.5.0.jar
commons-digester-2.1.jar
commons-logging-1.1.2.jar
jasperreports-7.0.0.jar
jasperreports-data-adapters-7.0.0.jar
jasperreports-groovy-7.0.0.jar
jasperreports-pdf-7.0.0.jar

I am using JDK-21.
Thanks. I have checked the dbconnection and parameters. Report is working fine within jasper studio on same computer (I am using one development computer for all webserver, dbserver and jasper studio). I have added jasperreports, itext and commons jar files into lib folder and classpath.
6 months ago
Hi,

I am using the below code to display the jasper report from my servlet. I am getting the blank pdf output. I have created this report using JasperStudio and able to run this report within studio. please help me.

        FileInputStream fis = new FileInputStream("D:\\Tomcat10\\webapps\\tester\\reports\\test.jasper");
        Class.forName("com.mysql.jdbc.Driver");
        Connection connection = DriverManager.getConnection("jdbc:mysql://localhost:3306/tester?user=test&password=test123");
        JasperReport jasperReport = (JasperReport) JRLoader.loadObject(fis);
        JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, null, connection);
        JasperViewer.viewReport(jasperPrint,false);
        fis.close();

Thanks in advance.
6 months ago