Create page header and details sections - crystal-reports

I have created four database fields: ChargesView, CommodityView GeneralInfoView and LumpsumView
So I want ChargesView with header and its details, CommodityView with header and its details.
Ex:
I want crystal reports to be like:
Report Header
Page Header
Details
Pageheader
Details
Report Footer
Page Footer

As far as I know, you can't insert a PageHeader between 2 Details.
In this case, you have to use sub-reports.
Right click on DetailSection > Insert Sub-report > Choose an preexisting report or create a new one.
A subreport is a report item that displays another report inside the body of a main report.

Use subreports for the Details section
Write a subreport for ChargesView's Details section. Write another subreport for CommodityView's Details section. Place these subreports into separate Details sections for your main report, and activate New Page After for both sections.
If you need the Page Header to change based on which subreport is being displayed, you can make multiple Page Headers and suppress them based on a shared variable. (When your ChargesView section displays, set the shared variable to charges. Then have the Charges header only display when your variable is equal to `charges.)

Related

Crystal report - displaying details and report header in a same row

I have a requirement in crystal report, where we have to show details section and report header together, so data will be displayed in a same row and according to the input the detail section can also grow in both direction row wise and column wise. Please use the sample picture for reference.
Is there any way to keep them together like in HTML where we can divide any table into one or more columns?
Any kind of information would be appreciated. Thank you.
In crystal it is not possible to add detail section in report header part..
How ever you can split detail section to multiple layout!!
1 - Right click report body then select Section Expert.
2 - Select multiple column.
3 - Then on layout you can provide detail size and gap detail.
Also you can insert multiple detail section and can swap inside the detail section. but not in report header part
It is possible for this purpose you need to use sub reports.
create a sub report and place in header section. Now limit the width of the sub report to the extent you need.
In sub report place the fields in details and supress rest all sections.
Now you can see header and details in report header..
Can you share along with sub report what you want to view in header?
You can use sub-report or setting up the section expert option.
Go to section expert
step 1: Suppress page header
step 2: At report header mark Underlay Following Section
Section Expert

Adding an additional page to end of a Crystal Report

I have a report for orders and I'd like to add an additional page at the end that states the orders' Terms & Conditions. Can someone help me?
In your report footer, set it to create a new page before it is printed (In 'Section Expert', select the Report Footer -> 'Paging' tab -> Check 'New Page Before' checkbox). Throw your Terms & Conditions into the Report Footer section.
If you already have a Report Footer that you want to keep, just split the footer into two sections (Right-click the Report Footer section -> 'Insert Section Below') and follow the same procedure for the newly created section.
If you want a complete new page to the end of your Crystal report just make 2 subreports inserted into one main report with Details a and b.
To do that:
Make the two subreports and save them;
Make a new main report and insert another Details section(Report->Section expert..., select Details - >Insert)
Onto Details a insert 1st subreport
Onto Details b insert 2nd subreport
Right click on 1st subreport -> Change Subreport links: select each Report fields and transfer them on the right side(Fields to
link to), click on the right side on each parameter (named like
?#Parameter1) and select the coresponding parameter.
Repeat the previous step for the 2nd subreport
Report->Section expert..., click on the Details b and check New page before.
That would be all.

Making report footer to appear just below the last page records

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.

Page header & footer on Summary band

I have read this thread:
http://jasperforge.org/plugins/espforum/view.php?group_id=83&forumid=101&topicid=67923
I would rather not repeat the page header and footer for each crosstab, as there are six of them, and if the header needs to change, I'd like to change it only once.
The problems include:
Putting the crosstabs on their own page (should be easy enough with a page break).
Making the crosstabs include the same header and footer as the rest of the report.
Reusing the header & footer from a single source.
Making the crosstab be shown before the data (not all that important, but would be nice).
The report appears as follows:
It would be fantastic to have the crosstab appear on a page by itself, including the same header and footer as the rest of the report, rather than looking like the image above.
The report is set up as follows:
Any ideas?
The solution involved these changes:
Provide a dummy query for the main report (e.g., SELECT 1 FROM DUAL)
Create a new subreport for the data details, based on the former query for the main report
Add a second detail band (Detail 2)
Place the six subreports in the first detail band (Detail 1)
Place the data details subreport in the second detail band (Detail 2)
Pass the parameters from the main report into the data details subreport
Reduce the data details subreport's margins to zero
Delete the Summary band (no longer required)
This allows full control over the crosstab's report position while reusing the same header and footer for both the crosstab and the data details.

Conditional Suppressing Detail section in Crystal Report

There are 2 subreports in detail section of my report.
I have enabled suppress blank for subreports.
Now i want to suppress detail section if both subreports have no data i.e. both are suppressed.
I searched a lot on web but did not find a solution.
I'd first recommend against inserting subreports in the details section if at all possible because the subreport will be run for each record that the original report retrieves. If the report has 1000 rows it would be similar to running 1000 reports (thought not exactly).
That said, you have a couple of options.
You should be able to go into the section expert and check "Suppress Blank Section" for the Details section if you've already suppress the subreports.
If that does not work for you, you can create a formula field in each subreport that contains a shared variable that you populate the row count of the subreport. Then in the Suppress Formula (X+2 button) for the details section in the section export you can use those shared variables to enter a formula for the suppression of the section.
Here are a few links on using shared variables:
http://msdn.microsoft.com/en-us/library/ms225625(VS.80).aspx
http://books.google.com/books?
id=eukKHY9wjAEC&pg=PA316&lpg=PA316&dq=crystal+reports+passing+data+from+subreport&source=bl&ots=O8BzfeMJOK&sig=kt2v5JPbgy1bofCG6mFy4b5Qybk&hl=en&ei=wyKhSoWeHoqDngf4xZ35BA&sa=X&oi=book_result&ct=result&resnum=8#v=onepage&q=crystal%20reports%20passing%20data%20from%20subreport&f=false