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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Report

Status
Not open for further replies.

anushka04

Technical User
Jul 7, 2005
28
GB
Need help please, I think I need to use Array’s but I am not sure how I would use it.

Data

St data1 data2
100 p1 F
100 p1 R
100 p2 F
100 p3 R
100 p4 F
100 p4 R
200 p3 F
200 p4 F
200 p4 R
200 p5 R
200 p6 F
200 p6 R

Report output

Grouping required on St

100 p1 F p2 F p3 R p4 F
200 p3 F p4 F p5 R p6 F

Any help will appreciated

Cr 8.5 DB
 
What you've shown looks like a crosstab, an option found under Insert.

You should be able to make a crosstab with 'st' as one value and data1 + data2 as the other. Join them in a formula field.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
I need to ideally export this data in csv format and want to keep it simple for the users, is it not possible to use any other method.

Also this method will return all values but I want some values ignored as you can see from the report output
 
Insert a group on st and a second group on data1. Then add these formulas:

//{@reset} to be placed ini GH#1:
whileprintingrecords;
stringvar x;
if not inrepeatedgroupheader then
x := "";

//{@accum} to be placed in GH#2:
whileprintingrecords;
stringvar x;
x := x + {table.data1}+chr(9)+{table.data2}+chr(9);
//you could replace chr(9) (tab) with " "

//{@display} to be placed in GF#1:
whileprintingrecords;
stringvar x;

Drag the groupname from GH#1 into GF#1 next to {@display}. Then suppress all sections except GF#1.

-LB
 
Boss, you are good as GOD on this.

Can you tell me if I wanted to have a Quote and have them comma separated how I would do this. When I am exporting the data its coming in one line like a string rather then comma separated

143988 2-4 STDREV 2-5 STDREV 2-6 STDREV


e.g. “100”,”p1”,”F”,”p2”

Also is it possible for me to put a condition on data 2 so that it pick the one I want rather then the first one.

e.g. F instead of R etc


Thanks you so much
 
If you want only "F" records, then why not limit the records to those that return "F"?

Otherwise, if "F" only occurs once per data1, change the accumulation formula to the following and place it in the detail section:

//{@accum} to be placed in detail:
whileprintingrecords;
stringvar x;
if {table.data2} = "F" then
x := x + {table.data1}+","+{table.data2}+",";

Then change the display formula to:

//{@display} to be placed in GF#1:
whileprintingrecords;
stringvar x;
totext({table.st},"000")+","+x;

-LB
 
Thanks boss (Ibass) you are the most helpfull and to the point every time i aske a question.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top