Skip to Content
0
Oct 29, 2012 at 01:08 PM

CR - Is it possible to send some fields from Main Report to subreports?

23 Views

Hi everybody,

Suppose I have a Stored Procedure (with only1 input parameter) which generates a local temporary table (#Table1) with hundreds of fields.

Why hundreds? Because it contains all the fields needed by the Main Report and some dozen subreports.

I create the CR Main Report using the stored procedure as Datasource.

Of course, the Main Report will use only a fraction of the (hundreds) of fields available in Field Explorer.

I now insert some dozen subreports into the Main Report.

Question:

Is it possible to "send" the rest of the fields to the various subreports?

How can we do it?

Can we use shared variables?

If you wonder why I am doing all these gymnastics, please let me explain briefly:

I am developing a comprehensive report for tracking inventory.

I want all reports to be generated on SQL Server, not in Crystal Reports (far too slow!)

Unfortunately, if SQL generates say 10 tables, CR will only accept the first one and ignore the rest.

So, I have to generate a single table from SQL, and leave it to CR to distribute among the subreports.

I have tried to use multiple stored procedures (without input parameters) and then "Change Subreport links". Far too slow ...!

The only alternative which works (super fast) is to use dozens of stored procedures, each with 1 input parameter (the same one).

Unfortunately this generates dozens of parameter boxes in the Selection Criteria box ... for the user to fill !

Thanks

Leon Lai