cancel
Showing results for 
Search instead for 
Did you mean: 

Subreport links get lost when copying report from one db to another...

Former Member
0 Kudos

We often have to copy our crystal reports from one site to another with each site having a database identical in structure to the other. The problem is each time we copy the reports across we have to do a verify database. When we do so, we get prompted for each parameter used by the subreport links although they still exist and appear to still be linking correctly to the parent report. We are then forced to remove all the subreport links and then add them back in again before re-verifying database in order to get it to work again. This becomes a major problem and nuisance when you have 5 or 6 subreports each having 5 - 10 subreport parameters. We find were losing alot of time that we avoid copying our reports across sites. Instead we are forced to duplicate changes made to one manually into the other report so that much of our Crystal report development work has to be manually duplicated.

I would be surprised if by now nothing was done to correct this serious issue as I'm sure many other companies would have faced this problem with subreport links being so fragile and easily getting corrupted even when the datasource structure has not changed at all!

We happen to be using Crystal Reports version 9.2.2.634

Thanks for any assistance you can provide.

Mendy

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

did you try to verify the sub prior to the main report?

Former Member
0 Kudos

I don't always remember to do it in that order. I will nevertheless need to try this against a particular report I had no luck copying across and will let you know if that resolved it. I still don't understand why it should be necessary to verify a report which was working against the same structure.

We actually have a run time exe which passes the name of the server, and database on the fly to the report via a runreport.exe command.

Former Member
0 Kudos

and you set the new location in "Set Database Location" ?

Even tho the structure is the same, the regions (locations) are different.

You could set the report against a view and put the view (with the same name)

in each region. Then set up a way to refresh them with your administrator.

The Panda

Former Member
0 Kudos

The following are the sequence of the steps I took and the error messages I was getting:

1. I open the subreport and change the datasource location to point to a new server and database having identical stored procedures as the old one.

2. I then click verify database and get an error message saying the database table can not be found.

3. I then get prompted whether I wish to remove the report and I click u2018NOu2019 and then get the message u201Cdatabase is up to dateu201D.

4. I then try to do a refresh and get a failed to open rowset error with a description saying it was trying to locate the old database rather than the new one.

5. When I click on Set Datasource Location it all shows me that the current datasource is correctly pointing to the new server and database.

6. I then go to the primary report and change the datasource location to point the new one as well.

7. I then repeated steps 2 thru 5 but still get the same errors repeated for this one.

8. If I click on Database --> Show SQL Query, I get the old database showing as the datasource which seems to be the root cause of the problem as itu2019s still seems to have some hardcoded pointer to the old database. I donu2019t know how to change it as itu2019s read only and does not get refreshed when I click on Report --> Refresh Report Data as a result of above errors.

If you want screenshots for all these errors as well as the datasources being shown, please provide me with an email address and I'll be happy to send it to you.

Former Member
0 Kudos

Still waiting for a reply. Anyone know who else I can turn to if no one here can answer this for me?

Former Member
0 Kudos

I'm looking for the same answer. My main report includes multiple subreports. All but one sub reports are linked on the same database field. The sub report linked on a different field always gets linked on the same field as the other subs. Even after multiple attempts to refresh sub, save sub, change sub link in master, save master; when I reimport the sub it still uses the wrong parameter link field.

I found your post very interesting - seems crystal stores the initial setting...?

Former Member
0 Kudos

It is now 2011, there is a possible solution from SAP:

Crystal Reports for Eclipse 2.0 - Crystal Reports Java 12 SDK application.

Reports reporting off of parameterized Stored Procedure or Command Table, where parameters used in Subreport Linking.

Command Table or Stored Procedure Connection Information being changed programmatically at runtime.

Changing Connection information deletes the Subreport Links, resulting in "missingParameterValues" exception.

Resolution

To restore the Subreport Links, save the links before data source Connection Information is changed, then restore them after the change.

To save the subreport links:

Map<String, SubreportLinks> linkMapper = new HashMap<String, SubreportLinks>();

for(String subreportName : reportClientDocument.getSubreportController().getSubreportNames()) {

linkMapper.put(subreportName, (SubreportLinks) reportClientDocument.getSubreportController().getSubreportLinks(subreportName).clone(true));

}

To restore the subreport links:

for(String subreportName : reportClientDocument.getSubreportController().getSubreportNames()) {

reportClientDocument.getSubreportController().setSubreportLinks(subreportName, linkMapper.get(subreportName));

}

It might apply to VB.NET/C# subreport mods.

Former Member
0 Kudos

I am using this way to save and restore links for connection-change purpose, but I get following exception while running the report. I am able change the connection properly for simple reports (reports without Subreports) and it works fine.

com.businessobjects.reports.sdk.JRCCommunicationAdapter  -  detected an exception: The subreport link specified does not exist   

   at om.crystaldecisions.reports.reportdefinition.SubreportLinkCommand$Validator.a(SourceFile:550)

    at com.crystaldecisions.reports.reportdefinition.DeleteSubreportLinkCommand.B(SourceFile:92)

  ...

I am using JRC version 12.2.13 and crystal report 10 in a swing application and my database is DB2.

Regards,

Former Member
0 Kudos

Hashem,

This post is closed. I recommend you start a new post in order to get information. Most folks will not answer or even notice a closed thread. You can reference this one by inserting a link to it if you like.

Debi