Skip to Content
Former Member
Sep 28, 2009 at 07:17 AM

Crystal Report with subreports breaks when running on different databases.


HI there

I have a report with 5 subreports on that only works on the database I am designing it on. As soon as I run the report through my application on a database different to the one I design on, it seems to have lost all the parameter fields I created in one of the subreports (the one I have just added, the other 4 work fine) used to link to the main report.

It then pops up with the Parameter Value box and asks for values for 2 parameters that I do not use to link to the subreport, nor have added to the subreport in design time, and in code when I step through the parameterfields list property, the parameters I added in design time to the subreport are not in the list but somehow these 2 parameter fields have been added to the subreport? These 2 parameters have the same names as some main report parameters which have been set already, but as mentioned these somehow now belong to the subreport.

When I run the report through my app on the database I design on all parameters are present and the report works fine.

The parameters in the subreport are all command parameters, linking to a command field, a formula field and another non-command parameter in the main report. All these are set and work fine in the main report.

I set all the parameter values in code to the main report, and the subreports all use those to link to.

I am using CR v10.2 with VB2008 using .NET 2.0 framework (although I had similar problems in VB2005), where the report links directly to a SQL databse via commands. There are 4 commands in the main report and one in the problematic subreport. The subreports command incudes a SQL "IF" statement based on one of the parameters I am linking from the main report.

Please let me know if more info is required.