Results 1 to 4 of 4

Thread: Empty View using Jasper

  1. #1
    Join Date
    Jul 2005
    Posts
    5

    Default Empty View using Jasper

    Hi,

    I was struggling all day to find out the problem, but I found nothing.
    I'm using now Acegi, Spring MVC, and Jasper.

    And what I have, I want to pass the result of my searching in to the view, which invokes JasperReportsMultiFormatView.

    What I get is only an empty page for all formats, pdf, excel, and html.
    The JasperReportsMultiFormatView is invoked, because the application doesn't send any error, but like I said, it returns an empty pdf file, empty xls file, also empty html file.

    I tried with some jrxml files, which also work in another application. So I think the problem is not in jrxml file.

    Can somebody help me ?

    steve

  2. #2
    Join Date
    Jul 2005
    Posts
    5

    Default Error exception in Jasper Spring

    Hi,

    I think, no one has the same problem as I.
    I just found the hidden error, so the view displays the pdf, xls or html without error. But the page is empty.

    And like I said, I tried all possibility. I tried also using another jrxml, which works in other page. It still displayed an empty page.
    I tried implement subclass from Jasper view class, didn't work.
    I checked the whole library, there was no problem.

    And I checked into the code, what I found. The code doesn't return any error if the page empty. And in may case I found the error in reportDataKey. This property accepts the data to be reported, but it doesn't proof whether the data ok or not.

    So I just used another constructor to to build the data
    //JRDataSource xmlDataSource = new JRXmlDataSource(docw3c, "/ino:response/xql:result/contract");
    JRDataSource xmlDataSource = new JRXmlDataSource(docw3c);
    And it works, I think the XPath that I'd given in JRXMLDataSource was wrong. But Spring doesn't return any error.

    I'll check in again and let you know.

    sjtirtha

  3. #3

    Default Same problem

    Hi sjtirtha

    I had exatcly same problem as you, thanks for your investigation. It works now

  4. #4
    Join Date
    Oct 2011
    Posts
    1

    Default

    I am using something like,

    InputStream fUECReportStream = getServletConfig().getServletContext()
    .getResourceAsStream("/reports/FUECReport.jasper");
    JRXmlDataSource xmlDataSource = new JRXmlDataSource(stringToDom(xmlResult));
    where xmlResult is an XML string which gets converted to DOM from stringToDom function.

    JasperRunManager.runReportToPdfStream(fUECReportSt ream,
    servletOutputStream, parameterMap, xmlDataSource);

    response.setContentType("application/pdf");
    servletOutputStream.flush();
    servletOutputStream.close();


    public static Document stringToDom(String xmlSource) throws SAXException, ParserConfigurationException, IOException {
    Document document = null;
    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    DocumentBuilder builder = factory.newDocumentBuilder();
    document=builder.parse(new InputSource(new StringReader(xmlSource)));
    }
    The PDF gets opened, but I don't see any data?

    Is there any mistake somewhere?

Similar Threads

  1. Replies: 4
    Last Post: Dec 9th, 2005, 02:13 PM
  2. Replies: 9
    Last Post: Nov 1st, 2005, 10:36 PM
  3. jasper view dynamic report name
    By sergioD in forum Web
    Replies: 3
    Last Post: Aug 19th, 2005, 04:36 AM
  4. PageCompononentListener Hooks...JIRA issue?
    By amcauley in forum Swing
    Replies: 9
    Last Post: Apr 15th, 2005, 06:10 AM
  5. Content Provider vs View Model
    By Martin Kersten in forum Swing
    Replies: 21
    Last Post: Mar 10th, 2005, 02:25 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
  •