Share on Google+Share on Google+

swarupa.paruchuri
Displaying empty pdf with jasper reports using spring framework
0 Answer(s)      5 years ago
Posted in : Spring

Hi,

I am working with spring jasper integration to generate the jasper reports. Spring 3.0.5RELEASE,ireport 4.5.0

I generated a report template using the ireport.My spring controller class is returning the view and i am using the view resolver in the dispatcher-servlet.xml.I placed the views.properties file in the classpath of my project to render the view in pdf format.The below lines of code i am using in the views.properties file.

packageWisePdfView.class=org.springframework.web.servlet.view.jasperreports.JasperReportsPdfView packageWisePdfView.url=/WEB-INF/packagewisereport1.jrxml

Where packageWisePdfView is my jsp name which is returned by the spring controller class.Using .class i am telling that render the pdf view.Using url i am telling where my jrxml is located.

Main thing is my packageWisePdfView.jsp is empty because i dont know what code i have to place over there.I am thinking that if i configure the view class in my views.properties file then it will automatically render the view to my packageWisePdfView.jsp.I dont know i am thinking in the correct way or not.But if i do like this i am getting the emptypage.Anything more i have to do.I am new to the jasper as well as spring also.Can any one help me regarding this.Please.....

Below is my controller class code:

public ModelAndView addTemplate(@ModelAttribute("reports") RaReports model, HttpServletRequest request,HttpServletResponse response) throws Exception {

String pdfFile =request.getSession().getServletContext().getRealPath("/") +"packagewisereport.pdf";

String jasperFile = request.getSession().getServletContext().getRealPath("/") + "packagewisereport1.jrxml";

JasperDesign jasperDesign = JRXmlLoader.load(new File(jasperFile));

JasperReport jasperReport = JasperCompileManager.compileReport(jasperDesign);

JasperPrint print = JasperFillManager.fillReport(jasperReport, map, conn);

JRPdfExporter jrPdfExporter = new JRPdfExporter();

jrPdfExporter.setParameter(JRExporterParameter.JASPER_PRINT,print);

jrPdfExporter.setParameter(JRExporterParameter.OUTPUT_FILE_NAME,pdfFile);

jrPdfExporter.exportReport();

return new ModelAndView("packageWisePdfView");

}

packageWisePdfView.jsp is empty i dont know what to write over there.Its very urgent to me can anyone please help me....

Thanks In Advance...

Ads

View Answers









Related Tutorials/Questions & Answers:
Displaying empty pdf with jasper reports using spring framework
Displaying empty pdf with jasper reports using spring framework  Hi, I am working with spring jasper integration to generate the jasper reports. Spring 3.0.5RELEASE,ireport 4.5.0 I generated a report template using
Jasper Reports - Java Beginners
Jasper Reports  Hi, I'm new to Jasper Reports. Please help me by giving a simple example of Jasper report generating. Thank You, Umesh .../), it is free and based o JasperReports. It lets you create sophisticated reports
Advertisements
Displaying image using jsp and spring.
Displaying image using jsp and spring.  how to display an image stored in WEB-INF/images folder on the browser using jsp and spring
Jasper Reports - Development process
Jasper Reports  I can't find any Jasper report tutorial in this site. Can any one one provide me the code on how to use jasper report in net beans ide and how to develop a report by connecting to database
Reports to pdf conversion
Reports to pdf conversion  I need to convert reports into pdf format using java.. Will i get any sample code
Generating pdf in Spring
Generating pdf in Spring  Sir/Madam, I need your help in generating a pdf by fetching the data form database and by using unicode in spring framework
JDBC using Spring framework - JDBC
JDBC using Spring framework  Hi, I am using Spring framework in my project. I am making a call to the DB2 procedure using datasource and it returns... the code i'm using... HashMap params = new HashMap(); params.put("Username
Crystal Reports with Spring: problem
Crystal Reports with Spring: problem  Hi all, having successfully... tool, I would like to integrate Crystal Reports into my existing spring MVC and hibernate web app using: 1)new versione of Crystal Reports' API CRJ
Generating PDF reports - JSP-Servlet
Question I am try to generate a pdf report using jsp .... i want to export values stored in sql server DB on to a pdf files so please do reply its very...Generating PDF reports  Hello everyone i have submitted several
Spring Framework
Spring Framework  using Spring framework how to get filename output with date example:NSR_CURRENTDATE.TXT <property name="resource" value="F:/garryworkspae/NseSpring/output/output% schedule.date%.txt"/> how to get
Displaying database values in pdf format
Displaying database values in pdf format  Hi All, I am developing a struts application.I am having one registration form when i am submitting... database values should be shown as pdf or excel format. Thanks in advance
jasper report
jasper report  Sir, I have created report using ireport3 in netbeans but i am not able to show the report in jsp and also want to show the dynamicaly generated reports and aslo show in pdf and excel Please help Thanks
generate pdf in spring
generate pdf in spring  HOw do i generate pdf in a spring application, so that my click should query the database and a pdf should be generated and downloaded to the client side
generate pdf in spring
generate pdf in spring  HOw do i generate pdf in a spring application, so that my click should query the database and a pdf should be generated and downloaded to the client side
Using Jasper Report files in java projects using Eclipse IDE
Using Jasper Report files in java projects using Eclipse IDE  Hello all, I am using iReports for generating reports from Database. I am able to get the .jasper with .jrxml files. I am developing a web portal in Eclipse which
SPRING FRAMEWORK
SPRING FRAMEWORK  I need any Spring MVC project with complete description, so that I can understand about Spring framework   Please visit the following links: http://www.roseindia.net/tutorial/spring/spring3/jdbc
Displaying html code in pdf with itext - Java Beginners
Displaying html code in pdf with itext   Hi , I am... in the database i need to display this data in the pdf . i am using itext to create the pdf . i am using HTMLWorker to convert the html data . but styles
Spring Framework Training - Spring
Spring Framework Training  THinking of taking spring framework training from Intertech. Here's the class... does this give me what I need? http://www.intertech.com/Courses/Course.aspx?CourseID=99468
Jasper
Jasper  hii, What is Jasper?   hello, Jasper is Tomcat's JSP Engine. Jasper parses JSP files to compile them into Java code as servlets (that can be handled by Catalina). At runtime, Jasper is able
What is Spring framework?
What is Spring framework?  Hi, What is Spring Framework? Thanks
Spring framework
Spring framework  Explain MVC architecture. i am new to learn spring,mvc
Spring - Framework
Spring  can anyone explain me how spring mvc works.plz give some example so that it is easy to understand  Hi friend, For read more information on spring : http://www.roseindia.net/spring/ Thanks
how to implement Single Sign On in enterprise application using spring framework
how to implement Single Sign On in enterprise application using spring framework  how i can implement the single sign on in my spring based web app..i am new to spring frame work..any help will be appreciated as its urgent
How to insert and retreive an image in mysql database using spring mvc framework???
How to insert and retreive an image in mysql database using spring mvc framework???  I ve solved this problem based on the Product Search Application... <!-- The front controller of this Spring Web application, responsible
An introduction to spring framework
SPRING Framework... AN INTRODUCTION.... Much of the philosophy and approach of Spring framework, however, predates... and EJB-3. Spring is not a Persistence technolgy but a framework which allows plug
spring - Framework
spring  what is stateless service objects?in spring it is written that singleton mode ideal for stateless service objects?can anyone give me the brief idea about
What is Spring Framework Architecture ?
What is Spring Framework Architecture ?  Hi, What is Spring Framework Architecture ? Thanks
What are the benefits of Spring framework?
What are the benefits of Spring framework?  Hi, What are the benefits of Spring framework? Thanks
What are the Features of Spring Framework?
What are the Features of Spring Framework?  Hi, What are the Features of Spring Framework? Thanks
What is Spring framework?
What is Spring framework?  What is Spring framework? How to learn Spring Framework? Thanks   Hi, Spring framework is open source framework for the development of enterprise web applications. Read more at Complete
Form Handling in Spring Framework
empty. Can you send me some code for handling form in spring framework.  ...Form Handling in Spring Framework  I have created spring project.I created the form. When I entered the values to the form, the values should
Tutorials   
Java Spring Hibernate Struts Training spring inteview question You Spring Project is not running java lang incompatibleclasschangeerror quartz spring - Error resolved exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'transactionManager' is defined The import javax.validation cannot be resolved java.lang.NoSuchMethodError: javax.persistence.spi.PersistenceUnitInfo.getSharedCacheMode()Ljavax/persistence/SharedCacheMode java.lang.NoClassDefFoundError: org/hibernate/ejb/HibernatePersistence Solving java.lang.ClassNotFoundException: org.springframework.orm.hibernate4.LocalSessionFactoryBean issue What is the maven dependency for spring batch? Hibernate Session Attribute java.lang.ClassNotFoundException: org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean nested exception is java.lang.ClassNotFoundException: org.springframework.jdbc.datasource.DriverManagerDataSource Testing spring with junit and mock testing in Spring MVC, i would like to download my Mysql database table in pdf,msword,excel formats. java.lang.NoClassDefFoundError: org/hibernate/engine/FilterDefinition error package org.springframework.scheduling.quartz does not exist jquery dependency dropdown box in spring hibernate my sql Server side validation on dynamically generated fields from more than one table on spring framework. What are the new features of Spring 4.1? Append Arguments to the URL quartz schedular in spring mvc Where to download spring framework zip file? Integrating spring 4 with hibernate 4 Learn spring Multiple files upload code using spring mvc 2.0 with xml configuration without using annotations Spring 4 features I need Spring 2.5 example. Please point me towards a good Spring transactional tutorial Could anyone point me towards some good Spring tutorials, Please? What is Spring framework? Spring and hibernate based Online Shopping project with source code How to populate collection like map with annotation in mybatis? Spring Abstraction with Redis Spring framework How to insert and retreive an image in mysql database using spring mvc framework??? CRUD operations in spring mvc 2.5 meenakshi Meenakshi how many scenarios is having to developing web based application by using spring mvc. getting voucherPin parent and child dropdown Spring 3 Spring 3 MVC Login Form Example with Database MySql What is Spring Integration? How to configure Spring using Annotation What is Spring IOC Container ? What is difference between singleton and prototype bean? What are the differences between EJB and Spring What is Spring's JdbcTemplate ?

Ads

 
Advertisement null

Ads