|
Blogs
Want to make your exsting reports (or reports that you will be creating) easier to adapt to any datasource? Want to make a report more portable or more like a template?
Many of you have crystal reports that are run off of tables and want to set these reports to a stored procedure. Or they are run off of a universe and want to set them to tables. Some of these datasource migration tasks can be difficult to accomplish.
Making a report portable or adaptable to any datasource involves replacing any fields on the report canvas (or any fields in summaries, condtional formatting, cross-tabs or charts) with formulas.
Using the steps below will ensure that you are able to set your report to any datasource (tables, stored procedures, commands, universes, etc.) and ensure that none of your fields, summaries, charts or cross-tabs drop off of the report or cause errors.
This method is very handy if you are also designing a report where the database structure is frequenty changing or hasn't been built. You can even start building a report without any datasource.
A) If you have an existing report
If you have reports that you need to be more adaptable to a new datasource this can be a bit of work depending on how many fields you use. However, in many cases the extra work could prove worth it if you have hit a wall trying to change the datasource.
1) in the Formula Workshop create a new formula for every field that you have on the report canvas...for example, if you have {Customer.Country} on the report canvas, create a formula called Country that has syntax of {Customer.Country}.
6) do the same for any conditional formulas on the report that use fields directly.
7) after you are done the above steps, close the Formula Workshop and ensure that you are in Design mode of crystal and not in preview mode...this will avoid a lot of records coming into the report or database errors when doing the steps below.
8) you can now add the new database tables or stored procedure or universe or command to your report using the Database Expert wizard.
**** do not remove the old datasource yet
9) replace any old database fields in your record or group or saved data selection formulas with your new database fields.
B) If you are creating a new report
3) you can still use fields directly in the selection filters as these are easy to replace when adding a new datasource to the report.
if you design all of your new reports using this method, you will make your reports more adaptable and more portable. Jamie Wiseman
| |||||||||||||||||||||||