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

marciopd

Members
  • Posts

    21
  • Joined

  • Last visited

marciopd's Achievements

Apprentice

Apprentice (3/14)

  • Week One Done
  • One Month Later
  • One Year In
  • First Post Rare
  • Collaborator Rare

Recent Badges

0

Reputation

  1. Hi, maybe you could pass your data to thereport as a LazyList (a list that gets its data on demand). There's an example here: http://www.ilikespam.com/blog/paging-large-data-sets-with-a-lazylist) You will just have to remember clearing the loaded data in order to avoid memory usage problems. Doing this way, you would implement at least two methods: one for retrieving how many results there is in the list; and another for querying the data to be presented, page by page. You can do some tests to figure out the right page size. hope it helps, cheers
  2. A question: when should "complementary" pages be printed? 1) just after their "left" pages? 2) or should they be printed after all "left" pages were printed. In this case, could anything be done to help the user to join the pieces together? At an implementation point of view, maybe (1) is the best option.
  3. "But what about tables with several levels of column header grouping? Let's say we have a column header spanning 3 columns. In case the page cut occurs somewhere in between these 3 columns, what should happen with the wrapping column header? Should it be cut?" In this case, maybe the columns of the header that fit in the page should be printed there and the others would be printed in another page. About the wrapping column header, it would be cut. If we did something like: "Or should all 3 columns move to the next page so that their common header stay in one piece?" there's always a risk that the header's columns don't fit in the fresh new page, and then we would be forced to use the first approach.
  4. Unless there's an jasperreports api implemented in .NET, I think the only way to do this (excluding webservices) is to use something like suggested in http://www.devx.com/interop/Article/19945 . I had the opposite problem once (running a dll from java code) and used com4j (https://com4j.dev.java.net/). Worked fine. Good luck there.
  5. Take a look at this post: http://jasperforge.org/plugins/espforum/view.php?group_id=102&forumid=103&topicid=76965&topid=77042#77042 Maybe what you really need is a JRBeanDataSource. Very simple to use. You pass a collection of your own beans to the reports as a datasource, so the fileds of the report are your bean's fields (whth getter and setters). hope it helps
  6. About http://jasperforge.org/projects/jasperreports/tracker/view.php?id=4368 : yes, I think that's what I was looking for.. I way to tell jasper that it must put what doesn't fit in one page into another. already voted :D thx a lot
  7. By dynamic columns I mean that I have to do a query in order to know which columns and data must be printed in the report. The data is fed depending on the columns.
  8. Guys, I have a report which columns are dynamic and the number of columns can be big enough so they don't fit all in one page. I though the best way to implement this was using crosstabs, because they deal with column breaks automatically. The problem with crosstabs is that if the data being rendered is a really big datatable, then the crosstab will eat all memory and crash the report no matter if you're using a virtualizer. What's the best solution for this situation? (dynamic columns + page column breaks + lots of data) Thanks
  9. About having to use a subreport to use the list you're right. The list you're passing is a list of objects Speed, where the class Speed has getSpeed() and setSpeed() methods? Did you declare the field "speed" in your subreport? I think this should do it.
  10. Maybe DynamicJasper could help you. Take a look: http://dynamicjasper.sourceforge.net/docs/HOWTO%20Add%20Subreports2.html
  11. I think you should take a look at JRBeanCollectionDataSource: http://jasperreports.sourceforge.net/api/net/sf/jasperreports/engine/data/JRBeanCollectionDataSource.html It's a datasource provided by jasper which you can initialize with a collection of your own java beans. Look at the example code below. Then the attributes of "YourClass" could be used as fields in the detail section of the report. Hope it helps! Code:...List<YourClass> yourBeanCollection = queryData();JRDataSource beanCollectionDataSource = new JRBeanCollectionDataSource(yourBeanCollection);JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, reportParams, beanCollectionDataSource);...
  12. Maybe you could use a value object to wrap the crosstab data.
  13. In my case, i'm dealing with large tables. I used crosstabs because it deals well with dynamic columns and when theses columns gets larger than the page width. Can I design a report so that its columns are dynamic and jasper will deal automatically with column breaks? Thanks for helping
  14. CrossTabDataVO.java Code:package model; import java.io.Serializable; /** * Data to be used inside crosstab. */public class CrossTabDataVO implements Serializable { /** serial. */ private static final long serialVersionUID = 3785582945804552430L; private String state; private String city; private String amount; public String getState() { return state; } public void setState(String state) { this.state = state; } public String getCity() { return city; } public void setCity(String city) { this.city = city; } public String getAmount() { return amount; } public void setAmount(String amount) { this.amount = amount; }}
  15. QueryLazyList.java Code:/** * */package model; import java.util.ArrayList;import java.util.List; /** * Test implementation for a lazy list. */public class QueryLazyList extends AbstractLazyList<CrossTabDataVO> { /** * Total number of results. */ int totalNumberResults = Integer.MAX_VALUE; public QueryLazyList(int pageSize) { super(pageSize); } @Override public int getTotalQueryResultsSize() { return totalNumberResults; } @Override public List<CrossTabDataVO> queryPage(int position, int pageSize) { List<CrossTabDataVO> resultsPage = new ArrayList<CrossTabDataVO>(pageSize); for(int i = position; i < position + pageSize; i++) { CrossTabDataVO crossTabDataVO = new CrossTabDataVO(); crossTabDataVO.setState("State " + i); crossTabDataVO.setCity("City " + i); crossTabDataVO.setAmount(i + ",00"); resultsPage.add(crossTabDataVO); } return resultsPage; }}
×
×
  • Create New...