I have a formula that calculated price total of an invoice eg. #vtotal. The invoice page could span from 1 to n page. I would like to show the total only on last page. How do I do that?
I have searched and tried on some suggestions using report footer, but it does not work as it implies, the report footer always show in tandem with page footer.
I have also tried using formula:
if PageNumber = TotalPageCount then
{#vtotal}
It still display 0 on pages with PageNumber < TotalPage Count.
How to do it correctly to only show on last page? And nothing on other.
Create group over invoice ID (or whatever field identifies invoice uniquely) and show your formula in group footer.
/edit after comments/
Alternative way is to supress some formulas in page footer section. Place your {#vtotal} into page footer (like it was initially) and create suppress formula for it, with content like
{PageNumber < TotalPageCount}
You need to somehow account for situations, when you print more than single invoice - if this is possible for your setup of course.
You Can write Grand Total in Report Footer. So it will display in only last page.
Related
I have a rather complex Crystal Report that is displaying a blank page at the end of each group. This is an issue as my customer requires the next group to start on the next page without a blank page in between.
The report has four groups; the blank page appears at the end of each Group 1. Group 1 has four sub-group headers that dynamically display on a page given an employee's group. There is one group footer for Group 1.
I do know it is not an issue of the details page bleeding into the next page and falsely creating a blank page; this is consistent with each Group 1.
Solutions I have tried:
I have de-selected the option to display a "New Page After" in both the Section Expert and the Group Expert, just for Group 1 (as this is the group causing the issue).
Also added a formula to the Group 1 footer to the "New Page After" formula to display Not(OnLastRecord); the blank page remains
Tried selecting and de-selecting the "Keep Together" options, in both the Section Expert and Group Expert
Some of these solutions switch the blank page to the start of Group 1. I have dynamic paging for each employee, and can see that page 1 of 4 for the first employee in each group is blank.
I am at a total loss here; all of my normal strategies for grouping logic have not worked. Also attempted each of these suggested with no luck:
http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=16733
Crystal Reports 11 - Useless blank page is added with just group headers that have data
https://answers.sap.com/questions/4160531/a-blank-page-appears-after-the-group-header.html
Posting the answer for those building complex Crystal reports and troubleshooting this issue: the "Keep Together" option was selected for Group 2, which was adding in the extra page for the first person in each Group 1.
I've tried adding a new formula and used this code:
whileprintingrecords;
numbervar x;
x := x + 1;
Problem is, if I place the formula that displays the count on the header section, it only shows the first value since it hasn't yet incremented.
I need a total count of the rows in every page and just show it in the header. how do I do this?
Wait I just realized it is placed in a group not in the details section. Let me revise my question. How do I get the value of the display formula in the last page of the report? Makes sense?
The simplest way to get a total count of all the rows within the report and place it in the page header is to create a new formula, with the value:
Count ({Table.Value})
and place it in your page header (where Table.Value is a field in your dataset).
EDIT: To get a total count of all the groups, change the formula to:
DistinctCount ({Table.GroupField})
Right-click on any field in Details section, Insert Summary, select Count(), drag resulting field into page (report, group) header.
I just summarized the field with Count and put it to Group Header That's It.
I am using Crystal Reports with VS-2005.
I have a report with a report footer section comprising of sum totals of a column. The problem is that in some cases, the records consume the entire page and the report footer alone appears on the next page. It looks awkward. I want the report footer to appear just below the last record row ended.
Is there any trick to make the report footer section fit on the last page itself?
If you aren't using grouping, try this:
Add an additional section below your last detail section.
In Section Expert, mark the detail section Keep Together.
For the suppress formula for the new section, specify Not OnLastRecord.
Move the content from the report footer to the new detail section.
If you are using grouping, do this in the last group footer instead, and in Group Expert, mark the group Keep Group Together.
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
How we can get correct ‘Page N of M’ and not just raw page count.
Total Page Count property of Crystal Report will need to render all pages of
the report in order to show the count but we need to exclude the blank pages from this
Page N of M is correct.
You need to figure out why you have blank pages.
Alternatively look into the Section formatting to suppress blank pages. There is a setting for that.
Right click over on the left Section names and choose Format or Format Section.