Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: outer joins Post Reply Post New Topic
Author Message
cherigstad
Newbie
Newbie


Joined: 29 Oct 2012
Online Status: Offline
Posts: 2
Quote cherigstad Replybullet Topic: outer joins
     Posted: 29 Oct 2012 at 11:36am
I am migrating my crystal reports from v8.5 to v2011.  I am having trouble with one that contains two outer joins -- alternate paths, if you will.
 
First, Database/Show SQL Query doesn't produce syntactically correct SQL.  Here is the correct SQL:
 
 SELECT
 x0.tr_id,
 x0.tr_date,
 x0.tr_from_inv,
 x5.lo_loc,
 x5.lo_acct,
 x0.tr_to_inv,
 x8.lo_loc,
 x8.lo_acct
 FROM
 "informix".inv_trans x0,
 OUTER("informix".inventory x3, "informix".ws_bin x4, "informix".location x5),
 OUTER("informix".inventory x6, "informix".ws_bin x7, "informix".location x8)
 WHERE
 x0.tr_date >= '10/29/2012' AND
 x0.tr_from_inv = x3.in_id AND
 x0.tr_to_inv = x6.in_id AND
 x3.in_place = x4.wb_id AND
 x4.wb_loc_id = x5.lo_id AND
 x6.in_place = x7.wb_id AND
 x7.wb_loc_id = x8.lo_id;
 
I have to stop the crystal report during execution because it spins forever, and it doesn't return the correct results.
 
I have tried ordering the links and tried various enforcement options.
 
I am using CR Developer Version 14.0.2.364RTM.
 
Any help/ideas?
C Herigstad
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 30 Oct 2012 at 9:26am
It sounds like when this report was created in 8.5, the developer went in to the query and modfied it manually.  You could do that in 8.5 and lower.  However, when Crystal v9 came out, there were some VERY significant changes to the underlying structure of the .rpt file and this was no longer allowed.  
Reports where the query was manually modified will not run correctly in the later versions of Crystal! From experience (@150 reports of experience a few years ago...) you'll have to recreate the report from scratch in 2011.  What I ended up doing was
1.  Open the older report in either the old version of Crystal or the new one so that I had access to the formulas and parameters.
 
2.  Create a new report in the new version of Crystal.
 
3.  Instead of joining tables, create a Command, which is just a SQL Select statement, using the correct SQL for the report.
 
4.  For each formula and/or parameter in the old report, add the objec to the report then cut it.
 
5.  Paste the object into the new report.  Then edit the formula so that it points to the command instead of to the tables from the old report.
 
6.  Add the objects to the new report, copying the format from the old report.
 
-Dell
IP IP Logged
cherigstad
Newbie
Newbie


Joined: 29 Oct 2012
Online Status: Offline
Posts: 2
Quote cherigstad Replybullet Posted: 31 Oct 2012 at 5:19am
Thank you for your reply.  I will investigate creating a command.
I didn't modify the SQL in the v8.5 report and even created a brand new report in v2011, but it didn't finish executing and didn't generate correct results when I stopped it and viewed the partial results.  Sigh.
C Herigstad
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