Set the height of Details section Crystal Reports - 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

Related

How to get a page per register stored in DDBB in jasperreports?

I have a report with the following structure:
PAGE HEADER
DETAIL BAND (12 of those)
SUMMARY BAND
The detail bands show depending on expressions I specified. Also, the content of the detail bands are subReports, one per detail band (don't know if that is relevant or not here).
What I'm trying to achieve is to execute the report without any filter as the ID or any other field of the table. Instead, I want to extract the information of all the registers of one specific table (let's name the table USER).
What I'm expecting to find when I execute the report is something like the following:
PAGE HEADER
detail sections (shown depending on the expressions )
SUMMARY
What I'm getting looks similar to the following:
PAGE HEADER
DETAIL 1 (for user1)
DETAIL 2 (for user1)
DETAIL 1 (for user2)
DETAIL 4 (for user3)
and never the summary band (just at the end of the report)
As you can see, all the users are getting mixed while what I want to do is to start a new page for each one of them.
QUESTIONS:
How can I get the report to show each one of the users from the table
in separate pages?
Is there some property I missed that allows me to
do that?
Thanks!
I think I found a way to solve this challenge. I just made a group (Group1) based on the ID's of the users and put the content of my Page Header inside the Group Header just created. Did the same with the Summary band, put all it contents inside the Group Footer.
Then, selecting the Group Header (or the Group Footer) I checked the Keep Together and the Start New Page checkboxs from the Appearance tab.
Furthermore, for each one of the detail bands, selected the Group1 just created for the Group Changes selection combo in the Appearance tab.
I didn't do much testing yet but it seems like it's working as I wanted it to. If I find any other (better) solution I'll update the answer. Still open to hear advices though.

How to use a report as subreport (with additional info) multiple times in a maintainable way?

So basically I have a report. I need this report to be printed as a 'set of reports'. Except that for each time the report is printed, there has to be a specific numbering at the bottom of the page. Where it would look something like this:
Page 1: Report + Page footer text 'Number 1'
Page 2: Conditions
Page 3: Report + Page footer text 'Number 2'
Page 4: Conditions
Page 5: Report + Page footer text 'Number 3'
Page 6: Conditions
And so on, for an undetermined amount of times..
In order to achieve this, I have created a main report, which currently contains 20 subreports, in order to achieve 20 pages (but I really I'd like this to be dynamical, maybe to be able to set the number of copies or something). Where each subreport consists of the single mentioned report (through the subreport 'Choose an existing report' option), with a custom text at the bottom.
The problem with this is that I can't maintain this. Every time an adjustment needs to be made to the original report, I will need to access 10 subreports and make the very same change or reload the report into this subreport.
What alternative ways of achieving my goal can you suggest, because this feels really 'dirty'. Thank you for reading.
I run Version 14.0.2.364 of Crystal Reports 2011
To achieve this, you need to use group and detail section in main report. For making adjustments with paging, each section has his own
page before
page after
reset page
So to help you a bit, you need to have your data in one datasource, and group by
Report/Conditions. For each group you can have only 1 subreport which will have link for that specific subreport (e.g. where barcod of smth is 1234) and there show your subreport data. For page number i would advise you to use my approach (for grouping) and then for page number you display group number (and that solves you all formulas for calculating pages).
If you are not familiar with grouping in Crystal, you can group your records in report by some fields by following image below
To summarize, try to define by which fields your reports has 20 subreports (probably some keys from database) and then group by that fields, examine advances of section expert and paging and you should be done in few hours making your report readable and easy to maintain.
Hope it helps

crystal reports fill with lines

I am making a report for a workorder for our workplace. The report prints the header of the order (order number, customer details etc.) Then it prints the text rows containing instructions what needs to be done. Mostly 1-10 lines.
After the instructions, I would like to have the page filled with empty lines where our mechanics can fill in their activities. I do not want the report to be more then one page. So, the more instructions, the less lines the report gets at the end.
I have searched several forums, but cannot find a good solution. Any help would be appreciated. I am using CR 2008.
Regards, Arno
You could try to add every "empty line" within a separate footer section, toggle section visibility depending on TotalRowCount (e.g. footer section A is only visible if TotalRowCount < 10, footer section B is visible if Rowcount < 9, etc.)

Split TextObject Main Report

i have a report and in this report i add text object .
in this text object , i insert many value so the report look like this.
in the page 2, half of page 2 is empty
because value is long then the value move to page 3
my question is how to split text object with many value? half value in page 2 and hal value again in page 3 , so the page 2 is full, not empty ?
you can set auto grow property true. i think below link would be helpful.
How to remove empty space after last row when using Can Grow option on text fields in Crystal Report?
In order for the two fields in your Detail section to stay together you will have to check the "Keep Together" property in the Section Expert. Since you have multiple Detail sections, you should do it for all of them. You can also play with the "New Page before" property in the Paging tab if you want each Detail section to start on a new page.

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
:)