Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Using global temp tables in Crystal XI Post Reply Post New Topic
Author Message
ChrisOs
Newbie
Newbie


Joined: 04 Aug 2011
Online Status: Offline
Posts: 6
Quote ChrisOs Replybullet Topic: Using global temp tables in Crystal XI
     Posted: 04 Aug 2011 at 12:54am
I am trying to use global temp tables in crystal to enable me to do all of my data extraction in one go then refer to it when required from multiple subreports.

The problem I'm having is that Crystal (half the time) tries to read my global table before it has been created as I get an error along the lines of 'Failed to retrieve data...' & then 'Invalid object name...'

Things I have tried:

•creating global table in main report command.
•Creating global table in the first subreport.
•Creating gloabl table in it's own subreport.
•Moving that subreport to different sections ie Report Header etc.
•Read this one on a forum - Adding a select of the global table(s) to the end of my query.
•Looked into the execution order of Crystal but that seems to only refer to different functions ie type of formula etc and I couldn't think of a way to use this.

Has anyone else had any success with this? It will be so helpful if I can use this without it falling over - especially as everything is scheduled so I don't find out it's failed until the following morning!

Thanks in advance
Chris


Edited by ChrisOs - 04 Aug 2011 at 12:54am
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 04 Aug 2011 at 4:09am
I would have thought that a Command object in the main report would have worked, but I can see where it wouldn't.
 
I haven't encountered this issue as we 'push' the data to the report and setting the report and the subreports datasource to the same source, well, I just haven't had any issues, but on reflection, I don't think that you can set a subreport to a Command object in another report.
 
Obviously, creating a stored proc and setting both the main and the subreports to it would probably hit the database multiple times (which I gather is what you are trying to avoid by this endeavor).
 
The problem is that each report wants to gather its own data, as they are all 'stand alone' which means it wants to hit the database, so I don't see a way around this as long as the data is being 'pulled' from the database, and not 'pushed' from an something like an application.
 
Perhaps there are more experienced / clever people out there than me.
 
HTH
IP IP Logged
ChrisOs
Newbie
Newbie


Joined: 04 Aug 2011
Online Status: Offline
Posts: 6
Quote ChrisOs Replybullet Posted: 04 Aug 2011 at 4:43am
Thanks for that, that's the issue I have found is that you just can't prioritise one command/select over another.
 
Yes your stored proc approach is what I was trying to get away from as they all use very similar data and it already takes a few minutes as it is (when it works!)
 
It seems strange that this isn't the done thing as it makes the report design much simpler and cleaner/more efficient.
 
Thanks for your help!
Chris
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum