November Tips      
TIP #1 :: 3 methods to modify Formulas in multiple reports at the same time using .rpt Inspector

TIP #2 :: The easy way to take your reports from Dev to Q/A to Production using
.rpt Inspector


TIP #1 :: 3 methods to modify Formulas in multiple reports at the same time using .rpt Inspector

For the tips below, it is assumed that you've opened all the reports that contain the formulas you want to work with.

Method 1:

I. Select the reports you want affected.

You can do this by either selecting them on the Objects Pane - Reports tab or on the Reports Tree.

Note: Throughout the product, there are context sensitive right mouse click pop-up menus. For example, can quickly select all reports on the Objects Pane - Reports tab by right clicking on the grid on this tab to reveal a pop-up menu and then clicking on "Select All" or using the keyboard accelerator keys "Ctrl A" to do the same.

II. Go to the Objects Pane - Formulas tab.

III. Click any formula in the grid of the Objects Pane - Formulas tab to have its properties displayed in the Properties Pane for the formula.

IV. Click on the Definition Name property label in the Properties Pane and drag and drop this property to the grid on the Objects Pane - Formulas tab to create a new column in this grid called Definition Name.

V. Right click on the newly created column Definition Name and select Group by Definition Name from the pop-up menu.

This will create a powerful pivot like grouping of all the formulas across the selected reports based on the contents of the Definition Name property. Each duplicate formula will be grouped together. If a formula is not 100% identical to another formula, it will be placed in its own grouping.

VI. Tick to select (click in the check-box) off the newly created grouping(s) that you want to be affected

VII. Expand one of the selected grouping(s) and click on the Definition Name to have the properties displayed in the Properties Pane.

VIII. On the Properties Pane | Definition Name property, click on the ellipse "..." to open the Formula Editor dialog and modify / edit / or paste the formula you want to be applied to all the selected items of the grouping(s).


Method 2:

I. From the Edit menu, select Search and Replace

II. In the Search For: edit box, type or paste the partial or full contents of the formula you want to change.

III. In the Replace With: edit box, type or paste the formula you want to replace with.

IV. In the Objects to Include grid, tick on the Formula object.

V. Click on Replace or Replace All to start the process.

Note that Search and Replace works on all Open reports, not just the ones selected.


Method 3:

This method is a variation of Method 2 in that it uses the same Search and Replace but with Pattern Matching (Regular Expressions).

Say that you have the following formula in one or more reports:

if Month({Account.Statement Date})=3 then "Q1"
else
if Month({Customer.Statement Date})=3 then "Q1"
else
if Month({Financials.Statement Date})=3 then "Q1"
else
if Month({Financials.Statement Date})=6 then "Q2"
else
if Month({Financials.Statement Day})=6 then "Q2"
else
if Month({Financials.Statement Date})=9 then "Q3"
else
if Month({Financials.Statement Date})=12 then "Q4"

And you wanted to change all occurrences of Financials.Statement Date to Financials.Account Day. This could be a long and tedious task without our Pattern Matching system.

I. From the Edit menu, select Search and Replace

II. In the Search For: edit box type the following regular expression:
  
(Month\({Financials).(Statement Date)

III. In the Replace With: edit box, type the following regular expression:
   $1.Account Day

IV. In the Objects to Include grid, tick on the Formula object.

V. Be sure to tick on Use Pattern Matching in the Search Options.

V. Click on Replace or Replace All to start the process.

Note that Search and Replace works on all Open reports, not just the ones selected.

For a more information on using pattern matching symbols click here.


 

TIP #2 :: The easy way to take your reports from Dev to Q/A to Production using .rpt Inspector

Do you find yourself spending way more time then you should be just to move your reports from one data source and/or database to another when the reports move from Development to Staging or Quality Assurance to Production?

You're not alone. Most Crystal Reports designers are in the same boat. Whether your reports are built on ODBC, OLE DB, or Native Drivers -- you're all facing similar issues and problems.

Crystal Reports saves the data source and/or database information part of the report. So your normal course of action typically is to:

  1. Open each report (one at a time) in Crystal Reports
  2. Run a Verify Database
  3. Set Location
  4. Convert Driver

While you may not need to do all of the above steps (depending on your connection method and source and destination), it does nonetheless require you to waste a lot of time repeating the same set of actions across more than one report each time you need to do the move.

So how can you do it the easy way? Use .rpt Inspector's data source / database migration and conversion wizard available in TOOLS|WIZARDS menu. The concept of this wizard is to work with one or many sources and point them to one destination at the same time.

I. Open all the reports you want affected in .rpt Inspector

II. Go to the TOOLS menu and from the WIZARDS sub-menu select change data source / database

III. On the folders tree in the upper left pane, click on the node OPENED REPORTS

IV. Select the reports you want to work with in the lower left pane and click on ADD TO SELECTION button.

V. You can also pick additional reports to work with directly from the file system, even if they have not been open in .rpt Inspector yet. Once you've selected all the reports you want the wizard to work with, click on the NEXT button.

VI. On page 2 of the wizard, you'll want to select all the SOURCE tables you want affected in each report. Right click to reveal additional options such as SELECT ALL (Ctrl A). Once done click on the NEXT button.

VII. On page 3 you must select the destination DATABASE by expanding the appropriate node for ODBC, OLE DB, or Native Driver.

Q: Why do you need to specify a database when all you want to do is a VERIFY or CHANGE DATA SOURCE?
A: On page 4 of this wizard, we show you a list of tables / views that we found in the database you selected and try to do a best match (which you can override), and we also need to connect to the database to confirm actions were applied later in the wizard. So before we can do that, we need to know which connection type, which database, and that we can login to it, by having you do this first.

VIII. On page 4, you'll notice that for each report we list a set of tables / views you selected on page 2 followed by a column which shows an Action that will be applied (i.e. Change Data Source, Set Location, Verify, Convert Driver) and that is followed by a column which shows the destination table / view that will be applied.

IX. If our best guess at your Action or Destination is not what you want, you can fine tune this by clicking on the cell of the Action and Destination to reveal a drop-down list where you can choose your own settings.

X. Once you're ready, click on the FINISH button to have the wizard apply your actions.

XI. When the wizard is complete, you'll be presented with a status screen.

XII. If in step 3 you worked with reports from the OPENED REPORTS node, then your changes are not committed until you click SAVE in .rpt Inspector, but you can already see your changes on the Database tab. However for all reports you select in step 3 on the file system, then the wizard applies changes to them right away (this is where the roll-back feature comes in).

There you have it. These 12 steps take only a few minutes execute. Now you can move your reports from Development to QA to Production, whether it's one report or a couple hundred reports at a time -- in only a few minutes.