12
1 Auto-Header Implementation Author: Karanjeet Singh Anand Email: [email protected] Mobile: 9650037920

Auto-Header Implementation

Embed Size (px)

Citation preview

Page 1: Auto-Header Implementation

1

Auto-Header Implementation

Author: Karanjeet Singh Anand Email: [email protected] Mobile: 9650037920

Page 2: Auto-Header Implementation

2

Table of Contents

Introduction ............................................................................................ 3

Project Re-branding ................................................................................ 3

Report Header Change Approach ............................................................. 3

Report Header Automation Strategy ....................................................... 3

Challenges – Report Header Automation Strategy ................................... 4

Revised Solution – Report Header Automation Strategy ......................... 5

Including the report header information table in business reports ......... 6

Step by Step Instructions for implementing Report Auto-Header ............ 6

Technologies used ................................................................................. 12

Page 3: Auto-Header Implementation

3

Introduction

This white paper provides details on successfully implementing Auto-Header

across hundreds of reports, the challenges faced during the implementation and

overcoming those challenges.

Project Re-branding

As project re-branding takes place in any segment/organization, the first thing

that strikes our mind as developers is to ensure that the report headers across all

the business reports need to be changed.

This usually is a very time consuming and repetitive job which requires opening

of each and every report and manually changing the report header and with

reports count in hundreds or even thousands, the problem is compounded.

Report Header Change Approach

When we are trusted with a similar effort of changing the report headers in our

existing reports, couple of intriguing questions pass our minds:-

1. What if the re-branding again takes place in the near future?

2. What if the project name changes?

When we realize that these questions are valid and there could be a very high

possibility of us re-doing this exercise as part of re-branding or project name

change, we are forced to think of finding an automated solution.

Report Header Automation Strategy

With a thought in place to automate the entire process of report header change, it

is now time to work on finding the best solution to accomplish the same.

Page 4: Auto-Header Implementation

4

First approach:

To create a one time table, this will have all the possible identified

report headers.

Create a report linked to this table and deploy it at Business Objects

(This applies if deploy and run your reports through Business Objects).

Include this table in all the reports (a onetime effort).

Create a parameter (prompt) for the Business users to select a header

from. (Added a verbiage with reference to the Headers report deployed

at Business Objects)

Challenges – Report Header Automation Strategy

Although, the above approach is very straightforward, but we might have a few

challenges:

Our reports may point both to real time (a transactional system) and

an ODS server. While it is easy for us to create that one time report

header information table in ODS, but is not an easy job to get the

same table created in the real time system which for all reasons

might be administered and maintained by a dedicated IT team.

The report header table could be created in the tempdb database of

the real time server; however, the very existence of the table in the

database is doubtful as the IT cleans the tempdb at regular

intervals.

Page 5: Auto-Header Implementation

5

Revised Solution – Report Header Automation Strategy

Accounting the above challenges, we have to revise the initial solution:

We can create the report header information table and insert the

possible headers information in it using a crystal report command

statement. The table is created in the tempdb of the real time

(transactional system).

To ensure that the table remains in the tempdb, we can auto-

schedule the crystal report at Business Objects to run every one

hour and check the existence of the table. If the table already

exists, it would do nothing; else, if the table has been cleaned up by

the IT team, our report will re-create the table and insert the header

related information into it.

This ensures that we can have the report header table in both real time and ODS

systems.

As and when we have new headers (given that not all our reports use the same

header within one segment) identified in our segment, those can be added to this

report header information table; both in real time and ODS.

Another report, displaying all the possible report headers and is available to the

business users based on the report header information table has to be created,

to refer to while passing the report header parameter value in reports where the

report header table has been included to implement the Auto-Header.

Page 6: Auto-Header Implementation

6

Including the report header information table in business reports

Once the report header table has been created, the next step is to include it in all

the business reports. We can create a sub-report which will point to the report

header information table and will be further used in the business reports. The

creation of the sub-report is a onetime process.

Step by Step Instructions for implementing Report Auto-Header

1. A table which will hold the Report headers information is created

across all systems where the reports point and the Auto-Header

needs to be implemented. The structure for which is defined

below:-

2. A report is created based on the Report Header Information table

created in Step 1. This report will be deployed at Business Objects,

the path for which will be given in the parameter verbiage of the

report where the Auto-Header needs to be implemented.

3. Once, the table along with all the identified report headers is in

place, the next step is create a sub-report which will be further used

in reports where the Auto-Header has to be implemented.

Page 7: Auto-Header Implementation

7

4. This sub-report will point to the Report headers information table

created earlier.

o A parameter for accepting the Report Header Code from the

user has to be created, the value for which will be provided

by the Main report where the auto-header is to be

implemented. This parameter will select the related Report

Header to be displayed in the Main report.

o A shared variable has to be created with Report Header

Name.

5. Open the Crystal Report which needs the Auto Report Header

implemented.

6. Click on the Insert Menu and select ‘Sub report’ as shown below:-

7. The following window will appear:-

Page 8: Auto-Header Implementation

8

8. Select the Ist Option ‘Choose an existing report’ and then click on

the ‘Browse’ Button to select the report you have downloaded in

Step 1 and click the Ok button.

9. Place the Sub report at the Report Header Section and if the

Report Header is suppressed, right click on the Report Header

Section and Select ‘Don’t Suppress’.

10. Right click on the Sub report and select ‘Format Sub report’, the

following window will appear:-

Page 9: Auto-Header Implementation

9

11. Click on the ‘Border’ Tab and under the ‘Line Style’ Section (At the

top), select ‘None’ for Left, Right, Top & Bottom

12. Then click on the ‘Sub report’ Tab and Check the ‘Suppress Blank

Sub report’ option and Click Ok.

13. Squeeze the Sub report and place it at the Top Left Hand side of

the Report section.

Page 10: Auto-Header Implementation

10

14. Create a Formula ‘Report_Header’ in the Main Report and enter the

following into it:-

Shared Stringvar Report_Header;

Report_Header

Note: shared variable has already been defined in the Sub report.

15. Place this formula ‘Report_Header’ in the Report Header section or

any other section, where you intend to place the Report Header.

16. Create a Parameter ‘Report Header Code’ of type string in the Main

Report and enter parameter values and description similar to

shown below:-

Note: These values should come from the tbl_report_header_info table.

17. As mentioned in Step 3, an appropriate verbiage has to be applied

for this parameter and it should include the path of the report

deployed at Business Objects, assisting users in choosing an

appropriate Report Header Code.

Verbiage Example: Enter Report Header Code: To choose a value review the

examples listed below in the "Available Values" box. To see a complete list of

header choices please refer to the “Report Header Table Data” report, <please

specify the path here>.

Page 11: Auto-Header Implementation

11

18. Finally, change the values in the Options Section of the Parameter

similar to the one shown below:-

19. Right click on the Sub report placed the Report Header and choose

‘Change Sub report Links’ and a window with title ‘Subgroup Links’

would appear.

20. From the Available Fields on the Left hand side, find the parameter

‘Report Header Code’, highlight it and then click the ‘>’ and it would

appear in the ‘Field(s) to link to:’ section on the Right hand side.

21. Finally, in the ‘Sub report parameter field to use:’ section at the

bottom, select ‘? Report Header Code’ Parameter and click the Ok

button and your window should look similar to the one shown

below:-

Page 12: Auto-Header Implementation

12

Note: The ‘Report Header Code’ Parameter is already created in the sub report you

added earlier to your report.

Technologies used

Crystal Reports, Business Objects, Sybase & SQL Server.