Print detail record on next page, although there is room on previous page - jasper-reports

I have following problem.
I have main report with subreport. Subreport has detail band with group header and footer, with keepTogether = true. Each detail can have different number of rows.
Then I run the reports and on first page of result PDF there is:
Detail record nr. 1
Detail record nr. 2
White space
On next page there is
Detail record nr. 3
But detail 3 record has so height, that it could be printed on first page as:
Detail record nr. 1
Detail record nr. 2
Detail record nr. 3
with no records on next page. But it is not so. Why ? Maybe there is any explanation for it, could you help me ? When I set page height longer then A4 paper size, there are all three records on first page. Depend it on height of subreport, as it is designed ?
Thank you

Related

Crystal Report Sub Report paging/positioning

I am creating a report that has 2 sub-reports,
First Subreport - top to middle main report, 12 rows max, and rows after 12 will be on next page. I used the "Next Page After" with Formula: (Remainder(GroupNumber, 12) = 0 And Not ONLASTRECORD).
The Second Subreport will have same requirement, 12 rows max and rows after 12 will be no next page.
My problem I cannot make the second Subreport display at middle of page on 2nd page.
If I put the 2 Subreports in same section the the data of both subreports is displayed at top of page (overlapping).
If I put the 2 subreports in different Sections (Report Footer a and b). The Second Subreport is starting after last page the First SubReport.
Report Design:
enter image description here
Thanks.
Best Regards,
Dennis
Right-click the 2nd subreport object,
select the menu option of 'Format Subreport...' and,
under the 'Common' tab, turn of the option of 'Keep Object Together'.

Jasper report template related issue with columnFooter

I have a requirement where I need to have a template design in certain way that I can print few info section on first page only and few info would be dynamic and will continue on other pages. Here is the design I have
[Page Header] will be repeated on each page
[column header] will print only on first page
[detail band] will have dynamic table which will expand to
multiple page based on the table rows
[column footer] have info which I need only on page one
[page footer] will be displayed on each page
[Last page footer] will have some different info which will be
on the last page only
My issue is that everyone thing is working but [column footer] is causing a problem. Column footer is printing the value on first page but occupying blank space on the other pages and because of that other pages have information printed on half page and half page is blank.
I saw the info in Jasper that column footer will not be collapsed. What is the solution to fix this issue.
Please give some suggestions for it.
As my requirements are little different then given solution. Here is I explain
The information which I have in ColumnFooter should be on first page only.
Above the ColumnFooter I have detail band which contains a table. The table in detail band is dynamic and it can have any number of rows.
set the printWhenExpression property of Column footer
<printWhenExpression><![CDATA[$V{PAGE_NUMBER}==1]]></printWhenExpression>

Form prints multiple times when more than one record is pulled in sub report 2

In Crystal reports I am making a summary statement and I got all of it but 2 parts are giving me trouble... I have two sections that needed to be totaled so I made subreports and put them in detail a and detail b. Each section potentially can have multiple sections or no sections. whenever there is more than one line in detail b or sub report 2 it prints the whole report that many times. So if there is only one record in Detail B it prints like
header a
detail a
footer a
header b
detail b
footer b
But if there is 2 records in detail b it prints
header a
detail a
footer a
header b
detail b
footer b
header a
detail a
footer a
header b
detail b
footer b
And the pattern continues if there is 3 records in detail b.
I also need to subtract the total of detail b from detail a. I can grab the number i need from detail b but whenever i try to get the total from detail a it comes back as a 0 instead of the number. Please Help me! Thanks
review your links or create a group on your subreport, so it won't show same info 2ice. Take in consideration that if you are using shared or global variables to show totals from your subreport, it should be place in a different section of your subreport. For example:
If your subreport is on Details Section A, you should place your variable in Section B.
try placing those subreports in your report header rather than your details. Create another 2 RH sections and place them on it

Set size of detail section in Crystal Report

I m generating Bill report using crystal report in VS2008..in that, details section size is dynamic.
i.e. depend on number of records, it changes. so if I've 10 records the report view is full page that is k ..but if i have 2 records in details sections, then whole page footer section getting stick to details page..so whole alignment is getting change
so is there any way to set details section fixed i.e. for 10 records and if records exceed more, then all records on same page and remaining data will go on next page i.e report footer,page footer.
Is there any setting in crystal report
Ok, i can give you some tips on how you can approach your desired outcome.
The Crystal Reports engine has the following characteristics.
The Report Header appears on the top side of the first page only.
The Page Header appears on the top side of every page (on the first page it is under the Report Header).
The Report Footer appears only once, on the bottom side of the detail section on the last page.
The Page Footer appears on the bottom side of every page.
There is a capability in every section that allows you to suppress it if you don't need it. It can be done by right clicking the bar of the section that you want to suppress and pressing the suppress choice from the menu that will appear.
Consider the 2 following cases.
If you want to achieve the first case, change the height of the Page Footer to a value that will allow only 10 records to show on the Details section, include all the footer information in the Page Footer and suppress the Report Footer. If you want the same result but with the footer information appearing only on the last page, right click the bar of the Page Footer and select Section Expert. From there, press the x+2 sign next to the Suppress CheckBox and add the following code there.
if pagenumber <> totalpagecount then
true
else
false
If you want to achieve the second case, change the height of the Page Footer to a value which will allow only 10 records to show on the Details section and include all the footer information in the Report Footer section.
In both cases the Report Header is suppressed.
Go to Section Expert
select report footer
Tick the Print at bottom page and Keep together option
Problem will be solved
First of all fix height detail section by right click on detail section Detail Section->Section Expert click on paging Tab->Check in New Page Before checkbox and beside it (x+2)button write formula-> (Suppose you want 8 rows to display in your report per page and additional rows(9th row,10th row and so on... to another page) IF Remainder (RecordNumber, 9) = 0 THEN TRUE ELSE FALSE so now your height is fixed.. and for blank rows suppose 2 records/rows are coming from data table/data source then from 8 fixed rows , 6 rows should be blank rows for that.. design your detail section with fields and keep report footer(section 4) blank with with some spaces(i want 8 rows fixed so keep size of 8 rows blank assuming in report footer) and put footer details in your section 5(page footer)..
if your header or footer is not visible on another page then put all header parts details in page header and footer details in page footer
:)

Set the height of Details section Crystal Reports

The no of items in my invoice never gets more than 10. When its only one item in invoice(one row in details section) the report footer shows very up.
I want that I should fix 10 rows for the details section, when there are less rows, the remaining rows to make it 10 should be showed as blank lines.
I need the footer to appear at the same place all the time, irrespective of how many items are there in the invoice(never gets more than 10).
Please suggest solution.
Just use Sub Report and Fix the height of the sub report
then you will be able to display fix page.
I am not exactly sure what you are asking, but I will make some guesses with possible solutions.
If you print multiple invoices per report, you can group on the invoice designator, and set the report to start every invoice on a new page. In addition, you can force a new page when the record count goes over 10 rows. There are various ways to do this, but the simplest would be to add a counter that is set/reset at the start of an invoice, and then conditionally force a "new page before" if that counter reaches 11. You can also set this to force a new page for every n + 1 records (the 11th record, the 21st record, the 31st record, etc.)
If you just don't want the report footer to show up, you can either suppress it or issue a "new page before" on report footer. This is handy if you keep a summary page for reference (# of invoices in run, total balances, etc.).
If you just don't want a floating footer, you can select "print at bottom of page" for any section. This is handy for group totals. That, with "Repeat Group Header on Each Page", you can get some very nice looking invoices.
to fix height of detail section ..suppose i want size of 8 rows/records then
right click on detail section ->section expert ->on paging tab-> check on New page before beside button (x+2) write formula below given..
IF Remainder (RecordNumber, 8) = 0 THEN
TRUE
ELSE
FALSE
I know this question is really stale, but here's how to do what the OP asked.
You need to do 2 things. Find out the amount of real estate you need on the page for the 10 rows, and create a group footer that is that size directly beneath the detail line (e.g 2" or 5 cm).
Then, go into the section expert for the detail line and check the Underlay Following Sections box.
If you are ever going to have more than 10 detail lines, you also need to go to New Page after on the Paging tab and put in 10.
Put all fields Top = 0
Decrease section height.
Now, you have to set fields top dynamically.
Like this:
cr.Section1.ReportObjects.Item("Line1").Top = 0
cr.Section1.ReportObjects.Item("Line2").Top = cr.Section1.ReportObjects.Item("Line1").Top + cr.Section1.ReportObjects.Item("Line1").Height