Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

simulating sql cursor functionality in crystal

Status
Not open for further replies.

laura99

Programmer
Dec 9, 2005
11
CA
i have a report which a record from table A could return multiple records from table B and I need to show them as part of the one row returned from table A
example would be TableA.WorkOrder1 TableB.WorkOrder1Text1+Table1.WorkOrder1Text2+TableB.WorkOrder1Text3

i have tried subreport but since this report is itself a subreport to another report, doesn't show up in the first report when running

any help is greatly appreciated
 
Hi,
Not sure what the problem you are facing is..
Do you mean that there are multiple Records ( not just fields) that link to 1 TableA.WorkOrder1 ?



[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
If your detail level data now has multiple rows per TableA.WorkOrder, you can collect the TableB records by using a variable like this:

//{@accum} to be placed in the detail section:
whileprintingrecords;
stringvar x := x + {tableB.field}+" ";

Insert a group on {TableA.WorkOrder} and then add the following formulas:

//{@reset} to be placed in the group header:
whileprintingrecords;
stringvar x;
if not inrepeatedgroupheader then
x := "";

//{@display} for the group footer:
whileprintingrecords;
stringvar x;

Then suppress the group header and details section, and drag the groupname into the group footer next to the display formula.

-LB
 
Thank you so much, is there any way i can have this work in the detail section, because there are a lot of other detail fields
that need to be visible and this field is one of them.
 
Is this the only field that has multiple values per {tableA.workorder}?

Why don't you show us a (mock) sample of your data at the detail level, labelling each field, and then show the same sample as you would like to see it displayed?

-LB
 
yes there are three fields that i need to do the same sort of concatenating the values from the tableB
this is a very long report with many detail fields close to 130 fields,from these only three fields (Issues and Risks, Scope Changes, and Update Maximum Invoices Amount reasons from below) are from TableB.the rest of the detail fields are from TableA

Pre-Job Meeting Date updated by
Mobilization Meeting Date updated by
Issues And Risks

Scope Changes

Update Maximum Invoices Amount Reasons

and these three currently are in the middle of the detail section
 
one point i forgot to mention is that not all the rows from tableA have a link to TableB.
 
You will either have to use grouping to get the desired results or you will have to string together the subreports. While subs can't contain subs, you could have multiple subs inserted on a detail line and linked to the main report.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top