This is the code i am using now to Suppress the page header.
1)
Shared numbervar rownum := 0;
rownum
Used a shared variable to calculate rows in a page and placed this in page footer to reset on every page
2)
Shared numbervar rownum;
rownum := rownum + 1
calculating rows and placed this in the details section.
Both these fields are suppress in the report so that the user cannot see them.
Now in the Page header i have placed the below formula
if Shared Numbervar rownum < 1
then true
Else
False
This works like a charm...but if there are no records in the second page it show a blank page.Details section keep Together checkbox is enabled.
Let me know how to avoid this.
----------Solution for Blank page ------------
Report Footer doesnt contain any data and I didnt suppress it.Show the blank page was displayed.Now that I suppress it its working fine.
here ends the search for solving the page header suppression when not using Groups.
Thanks.
First of all, I would advise to use a Group instead of putting the data in the Page Header. That will make your life a lot easier. If that is not an option, create a Running Total. As the field to summarize use one of the fields in the Detail Section (Paracetamol, Crocin). Do a count as the type of Summary. Under Evaluate choose "For each Record". under Reset, choose "On change of Field" and choose a field from your Header Section (Item Description). Now put that running total in your detail section. Check the values and make sure that it numbers each record correctly and resets if there is a new item in the Page Header. Now do a suppress statement in the Page Header that goes like RTotal0 < 1. That should suppress your Page Header if there are no records in the detail section.
Finally got the solution
This is the code i am using now to Suppress the page header.
1)
Shared numbervar rownum := 0;
rownum
Used a shared variable to calculate rows in a page and placed this in page footer to reset on every page
2)
Shared numbervar rownum;
rownum := rownum + 1
calculating rows and placed this in the details section.
Both these fields are suppress in the report so that the user cannot see them.
Now in the Page header i have placed the below formula
if Shared Numbervar rownum < 1
then true
Else
False
Suppress any blank footers if not used to avoid blank pages.
Cheers.
Related
I'm new in crystal report, i want to make a limit of number record that display in one page. I'm using this formula "if Remainder (RecordNumber, 11) = 0 then true else false"
It's works, I have 20 records it divided into two page. But at the end it shows an extra page header. Anyone know how to remove the extra page header? Please help, Thank You
Extra page header after add limit details formula
I have a report subreport with a group and the option "Repeat group header in each page" checked. But I need the user to be able to choose whether or not to show the group header on every page, or just the first time the group appears.
I set up a checkbox to let them choose, but how can I use this to tell the report not to repeat the header during run time?
Update
Beeing a Subreport I can not know which page will appear for the first time and I can not restart the numbering because it is necessary for the report.
I'm using CrystalReports in VS2005 and coding C# in VS2010, I'm working for a company and can't upgrade.
I'm trying to use a FormulaFieldDefinition in C# but I don't know how.
This could be done with a variable inside the sub-report.
Create a formula-field with following content and place it somewhere in the detail-section:
WhilePrintingRecords;
booleanVar headerPrinted := True;
In the suppresion-formula of the group-header place the following code:
WhilePrintingRecords;
booleanVar headerPrinted;
The formula will set the variable to True as soon as the first detail is being printed.
So the suppression formula evaluates to False only the first time the group header is being printed and to True on every subsequent time.
So with a boolean parameter {?GroupHeader} to choose if the header should be printed or not the suppression-formula would look as follows:
WhilePrintingRecords;
booleanVar headerPrinted;
If {?GroupHeader} And headerPrinted Then
True
Else
False
{?GroupHeader} = True would mean: Only show group-headers once.
I'm not sure which version of Crystal Reports you are using, but it does not look like there is an ability to specify a formula for "Repeat Group Header on each Page" under the Group Expert in Crystal 2011.
Instead, you might have to do a work around:
Create a boolean parameter {?GroupHeader} where true means "show the group header on every page."
Create a page header.
Copy your group header elements into the new page header.
Create a suppression formula on the new page header section under the Section Expert.
if PageNumber > 1 and {?GroupHeader} = true then false else true.
I have Crystal Repot Like this :
In this I dynamically Supress Field as I I found Null value for that field,
But In Report It shows Blank Space Like here I am Hiding, tag0 ,tag1, tag11, value0 ,value1 ,value11 etc
So Report Shows Like this
I want to Remove this blank Space between Field, above and Below I try
Section Expert => And Tick On Suppress Blank Section , but its not Working
As per Siva Suggest me i Can not Put All the tag in Different Section Because there are in Group Section not in Details
Here Field TAG 0 to 11 and Value 0 to 11 are Variables , which may be hidden or Visible Depend on User Selection , where other Field are static
Try the following step
= > Open your section expert (right click on some white space, you should see it come up).
= > Go to the options for the group footer and turn on reset page numbers after. You should see the page numbers reset at the beginning of each report.
= > Also in the section expert, go to the options for the page header and click on the blue button next to the Suppress (No Drill-Down) option.
= > In the Formula Editor, enter PageNumber=1
I would suggest you to place one tag in one details section like
tag1 in detaila
tag2 in detailb and so on
Then supress the section insetad of supressing the individual fields then you won't get this blank space.
Right Click on the section >> Section Expert >> Check Suppress Blank Section
Is there any way to catch a break in the table in order to insert a "Continued on next page" row? I've tried checking each row to see if the HeaderFormat is -1 (as I set headers to repeat on subsequent pages), but that doesn't work. I suppose I could count rows and guestimate, but I'd rather have an exact point at which to insert the new row at the bottom of the table before it breaks onto another page.
I found a solution. This post describes how to find the page number from a range. You can call this with the range of a row and check when the page changes. When the page changes go back a row index and add the "Continued..." text.
I would like to know if there is a way to detect if the last row in a table is exceeded the page and if so write it on the next page and write the table header to the next page as well.
I don't want to use table.KeepTogether = true; because if the table is longer than 1 page it just move the exceeded rows to the next page without the header.
The table does not start from the beginning of the page, so using the onStartPage() event is not good.
This is how it looks when the table is exceeded 1 page:
Hope that someone can help me here.
Thanks!
Seems like you want the repeating header functionality as described in the HeaderFooter1 example. For the corresponding C# examples, see http://tinyurl.com/itextsharpIIA2C04
For instance, if table is an instance of the PdfPTable class and the first row needs to be repeated when the table is split in two, then you need to add this line:
table.HeaderRows = 1;
Now the first row will be repeated automatically.