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!

Collecting info in rows and outputing to footer. 1

Status
Not open for further replies.

olitvinov

Programmer
Oct 21, 2004
47
CA
I have 20(always the same number) records coming all together in the report.
Can I collect all strings in my 3 columns and output them in the report footer or group footer all together?

The reason for that is that they need to be in a certain format.
I could've used a Sum function, but it doesn't take strings.
for example:

columns in DataSet:
Name;Value;Type

sample rows:
lane;lane1;com
Result;pass;com
Timestamp;02/09/2006 9:48:00 AM;com
Weight;98;com
Distance;0.8;rev

I want it look like:

lane 1 Result: pass Distance 0.8
Timestamp 02/09/2006 9:48:00 AM Weight 98

Thanks,
Oleg
 
Successful posts include basic technical information, such as the software and version being used, and the database and connectivity.

You can create this output in verion 9 or above using a formula akin to, although neither your output nor your example data has 20 rows, and since there are 6 rows showing, and 20 isn't divisible by 6, it doesn't make sense so you'll have to work out the specifics:

Details formula:
whileprintingrecords;
stringvar MyOuput:=MyOutput+{table.name}+chr(9)+{table.value}+chr(9)+{table.type}

Then the output would use something like:

whileprintingrecords;
stringvar MyOuput;
replace(Output,";com","")

Now this isn't exactly in the format you requested, but as I mentioned, your example data belies your request, try posting actual data.

You can also collect them into an array of X number of data elements, such as:

Report header formula:
whileprintingrecords;
stringvar array MyOuput[20];

Details formula:
whileprintingrecords;
stringvar array MyOuput[20];
MyOutput[recordnumber]:=replace({table.name}+chr(9)+{table.value}+chr(9)+{table.type},";com","")

Then in the report footer you could display the individual values using something like:
whileprintingrecords;
stringvar array MyOuput;
MyOutput[1]

Incrementing the 1 in the brackets for the element you want to place in whatever location.

Again, your post needs clarification, if you need additional help, please take the time to post what you really have and what you really need.

-k

 
Thanks k,
here's sample of data

columns in DataSet:
Name;Value;Type

sample rows:
name1;value1;com
name2;value2;com
name3;value3;com
name4;value4;com
name5;value5;com
name6;value6;com
name7;value7;com
name8;value8;com
name9;value9;com
name10;value10;com
name11;value11;rev
name12;value12;rev
name13;value13;rev
name14;value14;rev
name15;value15;rev
name16;value16;rev
name17;value17;rev
name18;value18;rev
name19;value19;rev
name20;value20;rev

I want it look like:

value1 name2: value2 value11 name12: value12
name5: value5 name15: value15
name3: value3 name13: value13
name4: value4 name14: value14
name6: value6 name16: value16
name7: value7 name17: value17
name8: value8 name18: value18
name9: value9 name19: value19
name10: value10 name20: value20


Thanks for your help,
Oleg
 
Now your proposed out put is in several rows instead of one as you originally posted you wanted. I am asumming the first request is correct. If so, then the first solution proposed by Synapse should work. Have you tried it?

Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports
 
I can't follow your desired display at all. Please take care when preparing your post.

After removing the type field with the replace function, if you just want the details in columns, then go to the section expert->format with multiple columns->layout tab->set width and gap->down then across.

-LB
 
On advise/idea of Synapsevampire,
I put in ReportFooter:

WhilePrintingRecords
Global StringVar Names;
Split(Names,",")[1]

and in ReportDetail:

whileprintingrecords
Global StringVar Names;
if Names <> "" Then
Names:= Names + ",";
Names:= Names + {get20;1.Name};
Global StringVar Values;
if Values <> "" Then
Values:= Values + ",";
Values:= Values + {get20;1.Value};
Global StringVar Types;
if Types <> "" Then
Types:= Types + ",";
Types:= Types + {get20;1.Type};

As a result I can access any of the values in the footer and format them as needed.

Thanks Synapsevampire!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top