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!

Creating one string out of multiple strings XI 2

Status
Not open for further replies.

tsouth4

Programmer
May 2, 2007
46
US
I am using Crystal XI and accessing an oracle db. I am attempting to show the value of multiple strings as one value in the group footer. I have grouped all orders by OrderID. For example my report is displaying the following data.

ORDERID SUPPLIER TOTALCOST Item name

364849 ACC 98.55 AA JERSEY T
364849 Alpha 4.09 AA GIRLY JERSEY
364849 Broder 9.99 Gildan T Shirt

356149 Augusta 56.25 Augusta Ringer T
356149 Sanmar 235.90 Port & Company- T-Shirt

356154 ACC 247.21 American Apparel Jersey T
356154 ACC 21.74 Hanes Beefy-T

356192 Broder 6.22 Gildan Ultra Cotton T
356192 Alpha 73.64 Gildan Ultra Cotton T

What I am attempting to is show all suppliers and styles for each order. My desired result would look something like this.

356489 ACC/Alpha/Broder 112.63 AA Jersey T/AA GIRLY JERSEY/Gildan T Shirt

356149 Augusta/Sanmar 292.15 American Apparel Jersey T/Hanes Beefy-T

356154 ACC 268.95 American Apparel Jersey T/Hanes Beefy-T

256192 Broder/Alpha 79.86 Gildan Ultra otton T

I tried the following formula thinking it may work however I receive the error message that the result of a formula cannot be an array.

Split({PROD_BLANK.ITEMNAME},";")

So I'm not sure if or where to go from here. Any help would be greatly appreciated.

-Tim

 
Tim,

I am just taking a stab at this one, has not been tested.

{@SupplierReset} & {@ItemNameReset}
- Place both these in group header for OrderID with respective formula of:

whilepringtingrecords;
Shared StringVar Suppliers:="";

AND

whilepringtingrecords;
Shared StringVar Items:="";

In the details lines: {@SuppliersCreate} & {@ItemsCreate}
whileprintingrecords;
Shared StringVar Suppliers:=Suppliers & "/" & {table.suppliers}

AND

whileprintingrecords;
Shared StringVar Items:=Items & "/" & {table.Items}


Lastly in the Group Footer: {@DisplaySuppliers} & {@DisplayItems}
whileprintingrecords;
Shared StringVar Suppliers;

AND

whileprintingrecords;
Shared StringVar Items;


Some tweaking may be required to remove the leading "/" on these strings, add the functions to the formulae in your group footer.... i think that Replace('/','',1) [not sure of context] should work


Hope this helps.



Mike
______________________________________________________________
[banghead] "It Seems All My Problems Exist Between Keyboard and Chair"
 
To tweak MCuthill's suggestion, you can do the reset in one formula:

whileprintingrecords;
StringVar Suppliers:="";
StringVar Items:="";

...and the accumulation in one formula, and move the slash to the end so it can easily be removed:

whileprintingrecords;
StringVar Suppliers:=Suppliers & {table.suppliers} & "/";
StringVar Items:=Items & {table.Items}&"/";

In the display formulas in the group footer, you can use the following to remove the "/":

whileprintingrecords;
StringVar Suppliers;
left(Suppliers,len(Suppliers)-1)

Repeat for the Items display formula. Although it doesn't hurt to use "shared", it's not really necessary to make these variables shared unless you plan to share them between a main report and subreport.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top