Results 1 to 3 of 3
  1. #1
    xampos20 is offline Member
    Join Date
    May 2010
    Posts
    5
    Rep Power
    0

    Default jasperReports from jstpto jsP...

    Hello i am new to java-forum.......

    i would like tou now how can i show my helloworld.pdf (its a stupid pdf i know ) when i click a jsp button ....what code maybe have to write to servlet in order to go to another page2.jsp and show my pdf :D


    thnx in advance....

    i made a java application with a main class and i ran it.....


    public class ReportDriver {
    public static void main(String[] args) {
    JasperDesign jasperDesign;


    try {
    jasperDesign = JRXmlLoader.load("C:\\report1.jrxml");
    JasperReport jasperReport = JasperCompileManager.compileReport(jasperDesign);
    jasperReport.getWhenNoDataType();
    JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport,null,new JREmptyDataSource());
    JasperExportManager.exportReportToPdfFile(jasperPr int,"C:\\report1.pdf");
    JasperViewer.viewReport(jasperPrint);
    } catch (JRException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
    }


    }
    }


  2. #2
    r035198x is offline Senior Member
    Join Date
    Aug 2009
    Posts
    2,388
    Rep Power
    7

    Default

    Google "File Servlet"

  3. #3
    xampos20 is offline Member
    Join Date
    May 2010
    Posts
    5
    Rep Power
    0

Similar Threads

  1. JasperReports dataSource.
    By hendrix79 in forum Advanced Java
    Replies: 0
    Last Post: 01-29-2009, 10:54 AM
  2. JasperReports, pdf and others.
    By hendrix79 in forum New To Java
    Replies: 0
    Last Post: 01-28-2009, 10:33 PM
  3. JasperReports 2.0.5
    By JavaBean in forum Java Software
    Replies: 0
    Last Post: 03-14-2008, 06:29 PM
  4. Reports in JasperReports
    By Jack in forum Advanced Java
    Replies: 2
    Last Post: 07-04-2007, 03:09 AM
  5. JasperReports 1.3.4
    By levent in forum Java Software
    Replies: 0
    Last Post: 06-19-2007, 05:10 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •