Skip to Content
0
Oct 30, 2012 at 10:47 PM

CR - Can we synchronize Main and Sub reports this way?

124 Views

Hi everybody,

I closed my previous thread and make my ideas more precise here.

Let's Suppose:

I have 1 main report and several on-demand subreports in Crystal Reports (Main1, Sub1, Sub2, Sub3, ...)

The Main Report uses a Stored Procedure (with 1 input parameter) as its Data Source, and it generates the following #Temp tables:

#Main1 -> will be used by Main1

#Sub1 -> will be used by Sub1

#Sub2 -> will be used by Sub2

... etc.. up to the last subreport

In this way, all my Crystal Reports will be synchronized!

The subreports don't use any stored procedure as datasource. They use the # tables generated above.

Problem:

My problem is how to "catch" the various # (Temporary tables) in each subreport.

For example:

Can we put the following code in CR Command Window in say subreport Sub1?

Select * from #Sub1

This is the idea.

What is the correct way to write the code?

Is it possible at all?

The problem is that #Sub1 is a LOCAL TEMPORARY TABLE. Will it drop if I click on the subreport on-demand link?

If I can sort out this problem, I will not only have the fastest Report possible, but all on-demand subreports will be synchronised.

The user can click on any on-demand link at leisure, and still rest assured that the report which pops up is compatible with the Main Report.

Of course, if the data has changed, all reports will be out of date, and need to be refreshed.

Thanks for any suggestion,

Leon