IBM Cognos and Motio Best Practices Blog

Mass Update Cognos using Search and Replace

Posted by Dan Sellari on Thu, Mar 15, 2012 @ 01:58 PM

Have you ever needed to update an image or change the footer text on hundreds of reports? Have you ever refactored your framework model and needed to change the query item names across all reports which are built on it? Have you ever renamed a report that is referenced as a drill target in many other reports?

If you have ever faced one of these scenarios, then you know how tedious it can be when you have to manually apply the same change across a large number of reports. This is where MotioPI Pro's Search and Replace panel can save you a ton of time (and spare you a great deal of aggravation.)

The Search and Replace Panel in MotioPI is designed to allow bulk "search and replace" across a large number of Cognos specifications (e.g. "replace X with Y across all these reports.") This allows you to quickly "mass update" Cognos reports.

Example - Mass Update Cognos Reports

Suppose you are a Cognos BI Author, and your company has decided to provide a smaller variant of its logo across an entire family of reports (for the purpose of this example, let’s assume there are 50 of these reports.) If you were to do this the "old-fashioned way" you would be required to open each report in Report Studio, click on the image, change the URL, and then save the report. You would repeat this process 50 times (once for each report!) With MotioPI, you can make the change in all 50 reports in one pass. Here's how:

1. Login to MotioPI Professional and select the Search & Replace panel.

Search & Replace
Click to enlarge

2. Click on the Narrow button to narrow down your scope (e.g. you can limit the operation to certain folders.)

Narrow
Click to enlarge

This opens the Cognos Object Selector. Select the objects you wish to search in. Click Apply.

 

Cognos Object Selector
Click to enlarge

3. Enter the find text and the replace with text. In this example, we're replacing "ciLogo4.gif" with "ciLogo2.gif".

Replace Text
Click to enlarge

4. Select the appropriate checkboxes under the Types and Options sections (this allows you to control things like case sensitivity, affected object types, etc.) Click on the Search button.

Select Options
Click to enlarge

5. MotioPI will start retrieving all reports which are in the scope and contain the specified search pattern text. Each report which contains matches will be added to the results panel (the middle panel, as shown below.) If you click on one of the reports in the results panel, you will see the actual text in that report which matched your search expression, along with context about where it was found.

Search Replace Results
Click to enlarge

 

6. Now that you've found all occurrences of the search pattern text, you can pick and choose the ones to be replaced by using the checkboxes beside each report. To select all of the occurrences use the select all check box (shown below.)

Select All
Click to enlarge

7. Now, click the preview button to preview the changes to the reports. This process will validate each report before and after the change. Note that the changes will NOT be saved to the content store during this stage.

Preview Report Changes
Click to enlarge

8. Once the validation phase is complete, you can proceed with the actual replacement. Click the replace button to commit the changes to the reports (this is when the modified versions of the reports will be saved back to the content store.)

Validate Results
Click to enlarge

9. After the commit process is finished, you'll see a Replace Complete dialog which provides a link to the backup folder in Cognos Connection (the original reports are all saved into this backup folder, in case you want to undo the operation.)

Search Replace Complete

To summarize, you can use MotioPI Pro's Search and Replace panel to replace text across a large number of Cognos report specifications with just a few clicks. This makes it far easier to apply bulk changes to Cognos reports.

Tags: Cognos admin tools, motiopi, mass update Cognos