How do I get a 3 page report in Jaspersoft iReport Designer 4.7 - jasper-reports

First of all: I've read this question but it is not working for me.
What I need:
I have an SQL query that returns a 3 column set with about 50 rows that looks like this:
year | month | number
2012 | 1 | 35
2012 | 2 | 24
2012 | 3 | 127
and so on. Now I need two different representations of this data. The first one is a 2D bar chart and the second one a table with the numbers presented. I managed to do both, but what I'd like to have for the whole report is, to have 3 pages in total.
First page should be a simple cover page with the title of the report, which I can get by simply adding the title band, as far as I've understood. The second page should be the bar chart (filling the whole page) and the third page should be the table (also filling the whole page).
I've tried the following and didn't get the result I need:
Created 2 subreports (1 for bar, 1 for table), added them both in a main report (in the details band) with a page break in between. The result was 2 pages, but the chart and the table filled only half of their page. When I tried to resize the subreports to the full size of the page I got the error message that they're out of range...
Created 1 report with 2 detail bands. Added the chart into the detail band 1 and the table into the detail band 2. This worked for both elements to be the full size of the page, but the whole compiled report now has 100 pages --> 2 pages for one row in my sql set
So how can I accomplish what I need!? Is it even the right tool to use? Or should I simply create two reports, export them as PDFs and combine the PDFs by hand?

My suggestion - in your SQL query, add a fourth column that concatentates your year and month (let's call that year-month). Create a detail band with the following fields: year, month, number. Create a summary band for your chart with year-month as your x-axis and number as your y-axis. Make the title and summary bands the size of your output paper. In iReport, right-click on the name of your report and go to the Properties box for the report. Check the box for "Summary on a new page."

Related

SSRS Double row headers and data display for printing

** I'm using SSRS2008 R2
I have a report that the users would like to see in a printable pdf.
Problem is there are several columns, potentially too many to fit on a printed 8.5x11 paper.
One of the concepts they suggested was a stacked header/data display, like breaking the columns into 2 rows, so 2 rows of data (for John and Bill) would look like this:
NAME START_DATE STATE COMPANY
ACCOUNT BALANCE END_DATE
-------------------------------------------------------
John 1/20/2016 NY GE
10076 $100.00 2/20/2016
-------------------------------------------------------
Bill 5/13/2016 MA Netflix
00013 $150.00 12/31/2016
-------------------------------------------------------
This leads me to 2 questions:
Is there a way to do this with a tablix?
AND/OR in addition, is there a way to set a default property on the report so when the report is exported to pdf and to print, that it defaults to fit all columns on one page (therefor shrinking the font size to fit on page?)
For anyone that cares - Apparently this can easily be achieved by dragging a Tablix onto the work area, right clicking the header row, adding a new row underneath (basically becomes header row 2), then do the same thing to the details row - however make sure to insert row - Inside group. That allows you to have stacked header and data rows and you can copy / paste headers and row values in whichever row you'd prefer.
it will work if you make all the columns on the same height not unequal. If all the columns has same height, then while exporting to pdf/excel and print it will come in the same page.

Conditional Printing for Front and Back page

I'm using iReport 5.2.0 and I have 2 reports that I want to print.
Both reports contain dynamic data and can be of multiple pages. However, number of pages of first report is always equal to number of pages in second report.
In my current setup, the first report is always printed completely and then all the pages of the second report are printed.
However, my requirement is that the report should print in the following sequence:
Page 1 of Report 1.
Page 1 of Report 2.
Page 2 of Report 1.
Page 2 of Report 2.
Page 3 of Report 1.
Page 3 of Report 2.
...
Is there any way I could achieve this with JasperReports?
Lets say , report 1 uses X query with X_SQL and report 2 uses Y query with Y_SQL.
If both of the query has same number of column then it is great otherwise add additional column with respect to X_SQL and Y_SQL in order to union both query.
Remember you have to generate one number series column and one dummy column in your sql. You can generate number series dynamically in your sql.
X_SQL with two new column (number_series,'detail1'as dummy)
union
Y_SQL with two new column (number_series,'detail2'as dummy)
order by number_series, dummy
OUTPUT of SQL:
X_SQL column , 1 as number_series, 'detail1' as dummy
Y_SQL column , 1 as number_series, 'detail2' as dummy
X_SQL column , 2 as number_series, 'detail1' as dummy
Y_SQL column , 2 as number_series, 'detail2' as dummy
Now add two detail band in your new report. Height of report is only one detail band height + top and bottom padding.
1 detail band = first report design
2 detail band = second report design
U can use subreport if your jrxml is too complex.
Now in print when expression of detail band use
detail band 1 : $F{dummy}.equals('detail1')
detail band 2 : $F{dummy}.equals('detail2')
Note:
1) you need to order by in your sql query.
2) height of report need to choose properly.
If still you are having issue then i suggest to post your jrxml.

Cross tab issues / Crystal Report

I am using SAP crystal report(version 13.0.8.1216) for VS2010.
I have made a cross tab which shows cost centers income month wise for one year.
jan feb mar
Costcenter1 10000 1000 1200
CostCenter2 120 1300 0
Similarly I have to show expense accordingly.
My two reports work fine separately but when i make one report, subreport of the other( as my selection criteria for both cross tabs is different even though they use same tables).
The subreport cross tab doesnt not extends to the second page. Only data that can come in first page of the main report is shown .
1. 'Keeping Object Together' is unchecked ( for all sections and all reports)
2. Suppress is also off
Any ideas? I tried placing my subreport in different sections also.. nothing seems to work .
Thanks

Dynamic vertical lines in Crystal Reports 10.5

Crystal Reports Ver 10.5
I have a crystal report which shows up to 9 fields, but user can choose between 1 to 9 fields. I have implemented this using check boxes on a form and user can select any box from 1 to 9 and generate a report. So the report can show from 1 field to 9, and any columns can be any field at a given time. (for eg. the user might select ID, Name, Phone from the form and view report. So the first column in the report becomes ID and so on. If he selected Name and Phone, the first column becomes Name and so on. I have done this using Parameter fields.
Now I would like to bring a vertical separation between columns and Only if the columns has data (Remember there can be 1 to 9 columns having data). I can't put the lines beforehand because they will be shown regardless of the number of fields shown.
Anybody has an idea of how to bring this vertical line between ?
Thanks in advance.

SSRS - Display a tablix across a single page

I am using Report Builder 3 to create a simple report. My report is formatted to be printed in Landscape mode on letter sized paper.
I have a single 3 column tablix, that returns about 100 results from a dataset. Instead of breaking to a new page, I want the data to continue displaying in a new set of columns across the page, so that it all fits on a single page. I'm not sure how to accomplish this.
add three tablix on the one page then divided the data on it..