Jump to content
We've recently updated our Privacy Statement, available here ×

lazybee26

Members
  • Posts

    2
  • Joined

  • Last visited

lazybee26's Achievements

Newbie

Newbie (1/14)

  • First Post Rare
  • Conversation Starter Rare
  • Week One Done
  • One Month Later
  • One Year In

Recent Badges

0

Reputation

  1. Thanks Sanda. Appreciate your help. That gives me a good headstart and I'll take a look at the examples. Quick question.... Correct me if I'm wrong here.... JasperPrint jasperPrint = JasperFillManager.fillReport(reportFileName, parameters, new WebappDataSource()); In the line above, lets say I've set the parameters object to use a virtualizer and WebappDataSource() class has implemented JRDataSource. Is it true that fillReport will get all the data from database to fill the JasperPrint Object? So even though i'm using virtualizer to prevent outofmemory exception and performance problem, it's still going to get ALL the records from the database. So if I have 1 million recs, it'll get all those records from DB. Is there a way to prevent this and get ONLY the records specific to the page I'm requesting (assume I'm using JRExporterParameter.PAGE_INDEX) Thanks
  2. I'm new to Jasper Reports and haven't tried any code yet. I'm just trying to read and understand the capabilities, before I dive in. Problem definition I want to understand how I can implement external pagination using Jasper Reports. FYI I have read about virtualizer, printobjects a little bit. Example using simple webapp Lets say I have a customer table, with 1 million records. I want to simply display the list of customers, with 1000 records per page. So I have 1000 pages, with 1000 records on each page. If I implement this in a standard web application, I will first figure out number of records in customer table and decide number of pages depending on records per page (1000) etc... On the UI side, I'll have navigation buttons like Next, Previous, Start, End. Depending on what user clicks, I can figureout the page number and accordingly, only query 1000 records from the customer table, for that specific page. In this scenario, I have control over the clicks and know exactly the page user has requested. So my resultset will always have only 1000 records retrieved from database for display. So this way I can implement external pagination in a plain vanilla webapplication. .........Now how do I do this in JasperReports? I read about Virtualizer and PrintObject. My understanding is that the virtualizer will get all the results, in chunks to avoid outofmemory exception and feed it to printobjects. So in my example, it'll get all 1 million records and feed them to printobjects. Once printobjects are created, the information can be displayed to the browser. When user clicks next or previous, the printobject can be accessed from session and so the db is not queried again. BUT, what if I only want the records of the specific page to be retrieved (which is 1000 records), instead of getting all 1 million records. Unfortunately I've understood the functionality only half way....I need to write code to get a better understanding. Regardless, I thought I'll throw this question out there, just to get some direction. Again, I want to figureout how to implement external pagination in jasper reports. As another example, lets say I have to generate a crosstab report using JasperReport, that has like 40,000 records to process, whats the best way to implement it such that the output is fast and gets data only for the specific page? Example - Display zipcodes of cities in each state of United States, where state is a row, city is column and cell has the zip code. Thanks Amit Post Edited by lazybee26 at 09/14/2010 05:40
×
×
  • Create New...