Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
Former Member

We have to design a report according to a particular export format viz. PDF, Excel, CSV, etc. A report designed for the PDF format will not be exported correctly to Excel format and vice versa. The below steps will explain how to create a report in Crystal Reports, which can be exported to the respective format correctly.

For this document we will cover PDF, CSV and Excel formats.

Steps of work around:

Step 1: Create an extra parameter in report level which is default parameter @Export_Type and the values as EXCEL, CSV and PDF. Depending on the selected

            parameter value the report will be formatted in the desired format.

Step 2: Design a report as per requirements for PDF format.

Step 3: We will divide each section in the report into 3 parts. The first part will be used to show data fields in PDF format, 2nd part will be used to show data

            fields in Excel format and the 3rd part will be used to show the report in CSV format.

Step 4:  Right click on each section in the report and select “Insert section below”. This will divide each section in a, b, c parts. Ex. Details a, Details b,

                Details c. Refer the snap-shot below:

               

Step 5: Create a report level static parameter named as “Export_Type” with values as EXCEL, CSV and PDF. Refer the snap-shot below:

    

Step 6: Now we need to enable/disable the respective sections as per the “Export_Type” parameter value. Use “Section Expert” to write a suppression formula

           for each section in the report. Refer the snap-shot & the formula below:

              

             

       For PDF      For ExcelFor CSV

if {?Export_Type}="EXCEL" Then

    True

Else if {?Export_Type}"CSV" Then

    True

Else if {?Export_Type}="PDF" Then

    False;

if {?Export_Type}="EXCEL" Then

     False

Else if {?Export_Type}="CSV" Then

     True

Else if {?Export_Type}="PDF" Then

     True;

if {?Export_Type}="EXCEL" Then

    True

Else if {?Export_Type}="CSV" Then

    False

Else if {?Export_Type}="PDF" Then

     True;

Step 7: The formula in the Step 6 has to be placed in the appropriate section.

Step 8: Place all the report objects/data fields in all the section by creating copies of them and format them as per the respective section.

Step 9: Refresh the report by passing the appropriate “Export_type” parameter value and see that your report will be formatted according to it.

16 Comments
Labels in this area