Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Reports, Subreports and Global Variables Post Reply Post New Topic
Author Message
jgedwards
Newbie
Newbie


Joined: 07 Jul 2009
Online Status: Offline
Posts: 6
Quote jgedwards Replybullet Topic: Reports, Subreports and Global Variables
     Posted: 12 Aug 2009 at 7:48am
Dead
Good morning.  I have been working on a report in CR 8.5 for quite some time now and am not sure how to proceed.  First let me say that I am a Novice at best with CR, but have been using a reference book and the web to put together a report providing info requested by my Operations department.
 
This report deals with OFAC false hit reporting and pulls it's data from various tables in an Oracle db.  I've created a main report that lists the false hits over a given time period along with the ID(s) for the corresponding entry (or entries) in the OFAC table.  The ID is not an actual field in any of the tables used for the main report, but is extracted from a text string that may or may not exist.
 
My primary issue is that I can not (or don't know how) to link the tables I am using in the main report with the OFAC table I need to use.  The requestor of the report wants to see the actual false hit along with the OFAC Summary found in the OFAC table.
 
Currently, I have created a linked subreport that takes the ID I extracted on the main report an provides the summary info for that ID.  The problem is that there may be multiple IDs for each message in the main report, and I need to provide the summary for each.  I thought I might be able to create the subreport and then create a selection formula inside it that would check each ID and concatenate the summary info for each one together, but this did not work (I don't think I was able to keep looking up new IDs in the db once the subreport executed).
 
Ideally, the user would run the report for a specific date range and get the following output:
 
Top N false hits grouped together.  Upon drill down, the user would see each unique false hit along with the OFAC Summary that contains the token matching the hit.
 
I know this is a lot of info and somewhat convoluted, but I can provide more info if necessary.  It would be great if I could define a global variable in the main report and then concatenate each summary to it in the subreport, but my reference says that global variables can not be referenced in subreports.  I also thought it would be nice if I could use recursion in the subreport and just pass a list of IDs and have it return a string of all the summaries.
 
Any ideas???
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 12 Aug 2009 at 2:20pm
Sorry but am not following you on this. Are you asking for help to figure out what is the best field to link on or do you need help making a link work?
You cannot use global variables in sub reports but you can use shared variables to apss info from main to sub or sub to main... although I don't know if that helps you or not.
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 12 Aug 2009 at 3:12pm
In addition to shared variables being the type that you need to use, all programming concepts are out the window when it comes to reporting.  The report retrieves/processes rows of data from a SQL select query.  There is no way to 'create' data in Crystal.  The best method for creating multiple rows from 1 row of data is to use a stored procedure.  There you can build a temp table and duplicate the data or parse data and retrieve multiple entries tied to one line.
 
Just some things to think about.  I banged my head against a wall when I starting trying to figure that out.
 
HTH
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