Skip to Content
0

Copy report, change tables, and export

May 11, 2017 at 02:12 PM

24

avatar image

We're about to undertake a major refactoring of the data tables used for our product. We'll be converting all of our standard (in-house) reports manually, but our customers are able to make custom reports of their own. Our goal is to create a conversion program that can open their rpt file, check a manifest file, change the table/fields, and save it as a new report.

For example, TABLE_ALL might contain "Field1, Field2, Field3, Field4", and a report is based on TABLE_ALL. I would want to change the Tables/Fields from

TABLE_ALL.Field1

TABLE_ALL.Field2

TABLE_ALL.Field3

TABLE_ALL.Field4

to be populated by 2 tables TABLE_1 {ID, Field1, Field2} and TABLE_2 {ID, Field3, Field4}, joined on ID.

I know how to do this at runtime using SetDataSource, but the goal is to change the rpt itself so that the next time the report is opened, it looks at the new tables and gets new data from them without something to manually populate the data at run time.

I've also been able to change the table name itself and save, but that only allows a 1:1 table substitution where the new table has the same columns as the old one, and doesn't allow joins.

I hope this makes sense...

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Best Answer
Don Williams
May 11, 2017 at 02:20 PM
0

Hi Joe,

I updated the Tag to CR for VS.

It's not possible, maybe....

CR .NET SDK does not allow Field Mapping, what it does if it can't find the exact tables/fields it removes them from the report.

Same as if you would be converting a mutliple table report to a Command, CR SDK and Designer are not able to do this.

So their only option is to convert them manually using CR Designer like you did.

The download WIKI for CR for VS is here:

https://wiki.scn.sap.com/wiki/display/BOBJ/Crystal+Reports%2C+Developer+for+Visual+Studio+Downloads

a ways down there is a link to get a Parameter sample app, in it there is a drop down function to get various parts of the report. It may help you a bit but what you are asking for our SDK's are not capable of doing it.

What you could possibly do in code is Clone all of the objects and update them one by one with the .ADD or .Modify function. It may work for you but the amount of time you will use to develop may not justify the costs.

You can find sample on our WIKI page for the RAS SDK to create new reports, that may help also:

https://wiki.scn.sap.com/wiki/display/BOBJ

Don

Share
10 |10000 characters needed characters left characters exceeded