Wednesday, December 22, 2010

Designing the Report

Hey All,


In my previous blog post I created a Crystal Report. Today I’m going to explain on how to design your Crystal Report. Below is the screen shot of the report that I created earlier.
























First I will explain about the different sections of the report. As you can see in the screen shot there are 5 sections in the report.
  1. Report Header
  2. Page Header
  3. Details
  4. Report Footer
  5. Page Footer 


Report Header
Objects that are placed in the Report Header section are printed only once, at the beginning of the report.


Page Header
Objects that are placed in this section are printed at the beginning of each new page.
Note: You cannot place charts or cross tabs in this section.


Details

Objects that are placed inside this section are printed with each new record.


Report Footer  
Objects that are placed in this section are printed only once at the end of the report.

Page Footer

Objects that are place in this section are printed at the end of each page.

Now let’s design the report. First up I will include a company name for the report and the telephone no. You want the company name and the telephone no to be printed only once in the report. Therefore the best place to place these is the Report Header Section. Then it will only be printed once per report.

First right click on the Report Header tab and select Don’t Suppress.



















If you want to add the company logo with the company name and the telephone no as an Image then just right click on the area between the Report Header and the Page Header tabs and the select Insert and then click on Picture. Then select your picture and place it In the Report Header.
























If you want to add them as just text you can insert them by using a text box which u can find in the tool box.

 














Now click on the Text object tool and drag it to your Report Header Section. Then type the details inside the text object. You can add many text objects as you want. If you don’t see the cursor in the text object, then right click on the text object and select Edit Text Object.










In the Page header section you can add objects which you want to be printed in all the pages of the report. In this Report I’m only making the text Bold in the Headings.


I’m leaving the Details Section as it is but if you want to format it you can do it in the same way as above.
In the Report Footer Section you can add any object that needs to be printed at the end of each report. For an example I can place a formula to calculate the total Quantity of the items. (How to implement a formula will be explained in the next blog post.)







I have drawn a line by using a line object which can be found in the Tool Box.

Then in the Page Footer section I’m including the page no which is a special filed. It is automatically added to the Page Footer section at the time of report creation. So it will print the page no per page.

OK now when I run my application I’m seeing my newly designed report with the page no printed on the bottom of the report.












That’s it for this post. In the next post I will explain how to format the fields.

No comments:

Post a Comment