Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Update .RPT via CE SDK 1

Status
Not open for further replies.

badstink

Programmer
Sep 10, 2002
11
0
0
US
Sorry for the long post. I didn't know how to shorten it yet give you the necessary background info.


I just finished looking over the past month of Crystal Enterprise forum posts and didn't find what I was looking for. I sure hope that a Crystal Enterprise SDK guru reads this post and wouldn't mind offering some good suggestions.

Let's say I have 30 copies of a single report, each having its own parameter values and schedule values. I've been using these reports for 4 months and therefore there are many saved instances of each report object.

Now I realize that my report would be much improved if I added 1 new parameter and deleted 1 of the old parameters. So I use a copy of Crystal Reports (on a development PC) to modify a local copy of the report template. I change the parameters and the record selection criteria in my .RPT file.

Now I'm ready to overwrite my old report objects with the new .RPT file on the CE server. I wish to do this using the CE SDK. Here are some important considerations:

1) I wish to retain all of my existing report objects
2) I wish to retain the title, description, and schedule information (including parameter values) of these objects
3) I wish to retain all instances of these report objects, including the saved data
4) I wish the new parameter to be added to each report object
5) I wish the deleted parameter to be deleted from each report object
6) I wish the selection criteria to be updated for each report object

My plan was to loop through all of my report instances and use the Files collection Overwrite() method to replace the .RPT for each object. Here are some problems that were encountered:

1) Via CMC, I cannot see or configure the new parameter
2) Via CMC, I can still see and configure the old deleted parameter
3) Via CMC, it appears that the report filter criteria did not get updated using the new .RPT
4) When I preview (view on demand) the report via CMC I am prompted for the old parameters only. Also, the filter criteria that is used at runtime is the old criteria. (See problems 1,2,3.)


Unfortunately, the ReportParameters property of the Report object is read-only so I can't programmatically modify the parameter info in the APS DB.

Accckkk! What other options do I have?
 
Never got a reply from anyone but I did figure out how to solve the problem. I had made a mistake in my initial use of the Overwrite method. Once I fixed it some of my problems went away. The rest of the solution was difficult to design and implement but it does work.

Here are the details of what I did:

1) Create a web-based javascript application
3) Use SDK to get list of report objects to upgrade
4) Use SDK to get report properties that you don't want to overwrite; save in javascript variables
5) Use SDK to get report parameter properties, including default and current values; save in javascript variables
6) Use SDK to overwrite the file with the new version
7) Use SDK to update the report properties with the values that were saved earlier
8) Use SDK to update the report parameter properties with the values that were saved earlier
9) Use SDK to commit the changes

I didn't give out all the details (the intellectual rights are now owned by my employer) but it should be enough to help you create your own version.

Good luck!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top