views:

877

answers:

4

I have created a crystal report called 'Order Details'. I used visual studio 2005 (crystal ver 10).

The order details report uses a stored procedure to populate itself.

It contains a subreport called 'ChildAssets' which calls a seperate stored procedure, the sub report needs a parameter. The parameter it needs is actually a field from the stored procedure that the order details report uses, namely AssetID.

So, on my development machine, I edited the ChildAssets subreport to use a linked parameter from the OrderDetails report and chose AssetID, this works great on my machine.

Server, logon credentials and parameters that the parent report needs is all done in code so that I can dynamically change the datasource to any sql server as long as the database I am pointing to has a stored procedure with the same name and returns the same fields.

The problem is this...

When I change the datasource to one that is different to the one I used to create the report, it loses the linked parameter which results in the sub report not displaying any data.

The parent report works fine and I know the sub report is actually calling its stored procedure because I changed the stored procedure to return some rows without needing a parameter so its not a authentication problem or anything like that.

For some reason, the subreport cannot find the value for the linked parameter when you change the datasource.

Crystal has me banging my head against the wall regularly but this one is driving me insane! :)

If any of you know the answer to this I would be eternally grateful!

Regards,

Mark

I have googled this but could not find the answer.

A: 

What about the datasource on the subreport - did you change it to sync with environments?

OMG Ponies
A: 

Any responses to this? I am struggling with similar issues.

Ishaq Sahhar
A: 

Did you change the datasource of the subreport as well? Setting the main report's datasource doesn't automatically change the subreport's.

Craig
A: 

Hi I am facing a similar problem !!

Could you please let me know whether you were able to resolve the same. If so please provide the solution.

Rgds Pads

Pads