Fix Page Header Height in Crystal reports - crystal-reports

Is it possible to fix the height of page header or any other solutions?
My problem is I need to do this list of persons in page header
Boy Janna
Girl Leo
Ana Erick
Mina Carlo
Lea Shena
But it must be like this
(for page 1)
Boy Janna
Girl Leo
Ana Erick
(next page)
Mina Carlo
Lea Shena
If number of person is 6 or lower it will only appear in first page (if two page report the second page must have blank person). If the number of person is more than 6 the number 7 person and up will appear to next pages and so on.
The maximum row is 3 per page
This Sub report is in Page header in main report
I put this code in supress of Sub Report for Persons. If I don't tick the Can Grow and adjust the text box (it only shows 6 names) and other names are now missing and not appearing in the next page. If I tick can grow and remove the below supression code what happens is it shows repeated name each page.
if PageNumber = 1 then
false
else if PageNumber = TotalPageCount then
true
else
true
Thanks in advance

yes you can do it in group header or footer and the process you followed won't give you correct results. Follow below process.
In grouper header or footer take a sub report and place only those fields in the sub report that you want to display.
In sub report place the field in detail section and then go to
Right click Details --> section expert --> paging --> tick the check box visible records
In the space provided input number of records you want to view per page and no go to preview.
You can see those many records per page in group.
This is working solution I tried group header and group footer of a group.
Let me know if you face any issue.

Related

Page Header, Page counter and Page Footer layout not working

I have a main report and a subreport i.e main.jrxml and sub.jrxml with the following problems:
On second page the current page number is not incremented
On second page and onwards the Title and Page Header are not fully removed
On last page the Disclaimer and page number is missing
.jasper file is not always re-generated for subreport in Jasper Studio, how can I make sure this is per default always re-generated
I run the reports with the Sample DB. How can I fix this?
CLARIFICATION:
For the page numbering on the TextField I use:
msg("Page {0} of {1}", $V{V_CURRENT_PAGE_NUMBER}, $V{PAGE_NUMBER})
V_CURRENT_PAGE_NUMBER is defined as follows:
Expression 1
Initial Value Exppression $V{PAGE_NUMBER}
Increment type Page
Reset type Report
In the end I used Composite Elements for both current and total page info.
UPDATE:
Point 2: Moved Page Header content into Title.
Point 3: I solved by repeating Disclaimer and page number also in Last Page Footer. I have it now in both Page Footer and Last Page Footer.
Use the Page X of Y element from the Composite Elements of the Palette view.
Only the Page Header repeats on subsequent pages. You can show it only on first page with a Print When Expression like: $V{PAGE_NUMBER} == 1
Duplicate the Footer elements in the Last Page Footer.
From the top menu select Project > Build Automatically

Fix the size of details section in crystal report

I m using crystal report in vs2010.
I m generating Tax invoice report..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
Try changing the print at bottom of page property in the select expert. That should do the trick.
1)First of all fix height of detail section by right click on detail section ->section expert->New Page Before checked->beside button of (x+2) write formula(Suppose you want 7 records in per page and further on another page -> IF Remainder (RecordNumber, 8) = 0 THEN TRUE ELSE FALSE
2)under detail section (suppose section3) is your detail section then leave report section blank with needed space and else for footer put it in page footer .. i think this will solve your problem.. mine is solved..
In my case in the New Page Before checked add:
IF Remainder (RecordNumber, 18) = 0 THEN TRUE ELSE FALSE

Jasper Reports subreport on a new page

I have a jasper report that consists of 6 subreports. Each of these subreports has its own title section. Now I need each report to start on the new page. I tried adding page breaks but it did not work for me.
While researching the problem I cam across a trick to set isTitleNewPage to true at
http://www.dzone.com/snippets/jasperreports-subreport-new. So I added the attribute isTitleNewPage="true" to all the subreports, but now the subreport's Title remains on the previous page and Details and Summary of that subreport are being displayed on a new page.
How can i solve this problem??
Simplest solution is to set runToBottom flag to true in subreport tags.
<subreport runToBottom="true">
This forces the subreport to fill the whole page, so the next subreport will start on a new page.
Flag isTitleNewPage won't do the trick because like you noticed, it will split the subreport's title band with the rest of the subreport content (unless you're using a blank title band).
In the initial tag:
<jasperReport
put:
isTitleNewPage="true"
I had the same problem that the title remains on the previous page.
But I have a solution:
put the stuff from the title in the "page header" band
set isTitleNewPage="true"
add a Integer variable to the subreport with the initial value 0
inkrement type "page"
expression $V{vari} + 1
print when expression of the page header is $V{vari} == 0
Now u have your title stuff on a new page, but only one time.
My solution to this problem is to add every Subreport in a separate "Detail band" and then set the Band height to the biggest possible value (right click on the "Detail X Band" => "Maximize Band Height"). Between bands could be printed some blank pages, but that is not a big problem in my case.
I solved it by add page break at the start of the sub report in the top side, no use "Print when expression" or anything else
Report formation:
Master Report -> 1st page -> 2nd page -> Sub report -> (add page break on top) title+ 2 sub report -> master report end page
Add a detail band for each sub report and go to the sub report properties and put a tick on Title on a new page.
I solved it by putting a page break at the beggining of each subreport, just before the title label and set 'new Boolean (true)' on the 'Print When Expression' property for each page break.

How to remove blank page in jasper report when using page break

I need add page break in sub report A, so that sub report B will start in a new page. And rows in sub report A is not determined. So, sometimes there is a blank page between sub report A and sub report B.
Question is - how to avoid the unwanted blank page? I know there is a 'print when' property for page break, but I can NOT figure out the proper condition.
Could you please give me some help?
You should place the page break exactly at the bottom of the band.
Example : If the "Detail 1" band is 100 height : Page Break (on Detail 1) top is 99 and Page Break Height is 1.
May be, "When No Data - No pages" property may solve your problem.

Blank space at end of page

Background
A subreport with a column title and a detail section both set to 20px high.
When the subreport record displays on the main report, the subreport prints as expected until when it reaches at the bottom of the page.
Then the subreport prints just the column header and left blank space, then again starts on new page with column header and its detail.
Question
So, would you make it either print the whole subreport on same page, or start whole report from new page?
Master Report JRXML
http://pastebin.com/V2HRPWVL
Image of the problem faces
Thank You
Mihir Parekh
Another way to delete the last blank page that appears in the report, is eliminating the pagination of the report
Try set the Split Type of related band to Prevent. (Might be detail band)