I have implemented a JasperReports report (using iReport) which consist of multiple crosstabs in the summary band which works successfully with the following stricture
Summary {
Crosstab 1
Page Break
Crosstab 2
Page Break
Crosstab 3
Page Break
Crosstab 4
Page Break
Crosstab 5
}
The user requirement is to remove the page break and show crosstabs one by one without breaks like this structure :
Summary {
Crosstab 1
Crosstab 2
Crosstab 3
Crosstab 4
Crosstab 5
}
But when I removed the page break, the crosstabs get overlapped.
Any suggestions ?
Try setting property Position Type to Float or Fix relative to bottom, I think float should solve your problem. If that doesn't work you'll probably have to make crosstab elements large enough to fit the actual data.
Related
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.
Is it possible in Ireport to have a band layout like the one below without using subreport? Or is there any other workaround. I tried to use subreport but unfortunately I cannot solve my issue. These have separate queries and I use php to fill in data to each details. Please help me.
Column Header 1
Detail 1
Column Footer 1
Column Header 2
Detail 2
Column Footer 2
Try to use Table elements in your report. You can use there the same dataset too.
I'd like to have two crosstabs grouped with 1 section similar to this
Region A
Crosstab1
Crosstab2
Region B
Crosstab 1
Crosstab 2
Region c.... etc..
How can I accomplish this?
Thanks!
Create Crosstab 1
Section on Region
Unlock the report
Create Crosstab 2 underneath Crosstab 1, but within the "Section" container
Create a Master-Detail relationship in Crosstab 2 to match Crosstab 1 (I find it's useful to turn the icon for these on via Tools->Visual Aids
Note the Crosstabs will format separately; you may find adding fixed widths on the columns may help presentation
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."
I have develped a crystal report. It must have 4 pages as default and additional 2 depending on the condition.
When the condition is success its showing all the text objects in 5th and 6th pages correctly, but in else condition, its displaying 4 pages with appropriate data and empty pages having page header in last 2 pages.
How to suppress/completely hide last 2 pages?
Pls advice
Thanks
Your best bet would be to create a report with multiple report footer sections. You can then either adjust each report footer section to be 1 page high and add the relevant conditions and objects or alternatively add a subreport to each report footer section containing the fields/logic.
I would probably create 8 report footer sections (2 being blank) then decide whether to show the 2 blank ones or the 2 with relevant objects.
In section expert, next to suppress use the below formula
if pagenumber in [99,100] then true
else false
Note; Assuming 99 and 100 are last 2 pages of the report.