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

dejanr

Members
  • Posts

    6
  • Joined

  • Last visited

dejanr's Achievements

Rookie

Rookie (2/14)

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

Recent Badges

0

Reputation

  1. I've managed to solve this by breaking each subreport into multiple details. This solution solves issue of page break after title or column band as well as before summary band. With this workaround you need to know total record count before rendering report ($F{totalRecordCount}). So, instead of just having title band, column band, detail band and summary band these are steps to solution: created additional 3 detail bands (now there are 4 in total)Column band now has printing condition : $F{totalRecordCount} > 1 && $V{REPORT_COUNT} > 01st detail band contains title elements + column elements + detail elements (fields to print)1st detail band has print condition: $F{totalRecordCount} > 1 && $V{REPORT_COUNT} == 12nd detail band contains just detail elements (original details band with fields to print)2nd detail band has print condition: $F{totalRecordCount} > 1 && $V{REPORT_COUNT} > 1 && $V{REPORT_COUNT} < $F{totalRecordCount}3rd detail band contains detail elements (fields to print) + summary elements3rd detail band has print condition: $F{totalRecordCount} > 1 && $V{REPORT_COUNT} == $F{totalRecordCount}4th detail band contains title elements + column elements + detail elements (fields to print) + summary elements. It is printed just in case there is 1 record to print4th detail band has print condition: $F{totalRecordCount} == 1remove title and summary band, their elements are printed in detailsI am still having following issue - column band (step 1) sometimes prints, sometimes it does not. In some situations printing condition $F{totalRecordCount} > 1 && $V{REPORT_COUNT} > 0 works properly, and sometimes you need to change it to $F{totalRecordCount} > 1 && $V{REPORT_COUNT} > 1 to properly work. This looks like some sort of race condition. If anyone knows how to solve this, I would appreciate it. Kind regards, Dejan
  2. Two rows: First nameLast nameContactJohnDoe111-222-333 john.doe@example.com121-212-654 john.doe.private@example.com JaneSmithAlso, I've solved it...I am pretty sure I've tried it on Friday, but all I've needed to set is list's Dataset "Use a JRDatasource expression" property to ((net.sf.jasperreports.engine.data.JsonQLDataSource)$P{REPORT_DATA_SOURCE}).subDataSource("contact")
  3. Hmmm...I've added tables here in response to make it look good, but it is just rubbish now...
  4. Hi all, I am having subreport with JSON data source. I am using jsonql language for query as it has more options than normal json. Here is the example structure of JSON: { "users": [ { "firstName": "John", "lastName": "Doe", "contact": [ { "phone": "111-222-333", "email": "john.doe@example.com", "type": "business" }, { "phone": "121-212-654", "email": "john.doe.private@example.com", "type": "private" } ] }, { "firstName": "Jane", "lastName": "Smith", "contact": [ { "phone": "123-321-102", "email": "jane.smith@example.com", "type": "business" }, { "phone": "123-321-102", "email": "jane.smith@example.com", "type": "private" } ] } ]}[/code]My main dataset query is "users.*". and fields are "firstName" and "lastName". I would like to show contact details (array of contacts) in a list element as third column in the report. I am having issues rendering contact data in list that way. I create subdataset "ContactDataset", in "Dataset and Query Dialog" I get fields "phone", "email" and "type". When I go to data preview I can actually see those data. When I add list to report I can set it's dataset "ContactDataset" and in editor add fields to list itself. But, when I try to run preview I don't get anything. I tried setting list's Dataset "Use a JRDatasource expression" property to "((net.sf.jasperreports.engine.data.JsonQLDataSource)$P{REPORT_DATA_SOURCE}).subDataSource("users.contact.*")" but it does not work. Does anyone have any idea how to use JSON object subarray ("contact") to show list element in detail band?
  5. Hi all, I have report with 9 subreports, each represents one table. It's page format is A4 landscape. In Details band are some details, and in Summary band are those 9 subreports, set to Position Type: Float and with equal height of 30px. Subreports contain Title (30px height), Column Header (40px height), Details (20px height) and Summary band (30px height). When I run report sometimes there is a page break after subreport's Title or before subreport's Summary band and it ends up on different page. I found posts explaining to avoid that behaviour you should set subreport component height to be higher, so it won't have page break after Title or before Summary band. So I should set subreport's height to be higher than it's Title (30px height) + Column Header (40px height) + Details band (20px height) = 90px to be able to print without unwanted page breaks. So the question is if there is some other way to achieve this? If not, how am I supposed to put 9 subreports each at least 90px high into A4 landscape report which has height 595px? Kind regards, Dejan
×
×
  • Create New...