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!

How to display array in multiple fields

Status
Not open for further replies.

JarreZoolook

Technical User
Sep 4, 2007
9
0
0
DK
Crystal Reports X1
MSSQL database

I hope this is possible but I do not know how it could be done. So I hope you can help me.

I have a shared array that I want to show in multiple fields. I do not know how many entries there is in the array but there is always at least 6. I want the fields to be shown in pairs of 6.

The array may look like this:
“Varenummer 1”, “Varenavn 1”, “Batch 1”, “Udstyr 1”, “Tag 1”, “Metode 1”, “Varenummer 2”, “Varenavn 2”, “Batch 2”, “Udstyr 2”, “Tag 2”, “Metode 2”, “Varenummer 3”, “Varenavn 3”, “Batch 3”, “Udstyr 3”, “Tag 3”, “Metode 3”
Ect.

I want the fields to be shown like this;
Varenummer 1 Varenavn 1 Batch 1
Udstyr 1 Tag 1 Metode 1

And if there is more the 6 I want the next 6 to be shown under the first 6 and so on.

I have looked through several Tek-Tips posts and I have also tried to Google this but with no look. I hope someone can help me.

Morten
Denmark
 
I don't know if this will help, but if what you are trying to do can be placed in the Detail Section, Click on "Section Expert" and check "Format with Multiple Columns". If you play with the width an only allow for 3 columns, you should be able to force it to 2 rows to get your 6 varibles (and multiples) to display correctly.

I been writing Crystal since version 6 and only used this a coulple of times. So that's about the extent of my knowledge on this one!

DataDog [pc2]
If God wanted us to count in Hexadecimal, then why did he only give us A fingers?
 
Create a formula like the following:

shared stringvar array x := {@yourarray};
numbervar j := ubound(x);
numbervar i := i + 1;
stringvar z;
for i := 1 to j do(
(
if j >= i then
z := z + x + space(20-len(x))
));
z

Place this in the detail section and format it to "can grow" and also change the font to a non-proportional one like Courier New (this is necessary for alignment). Adjust the number in the space function as necessary and stretch the width of the field to force the desired number of columns.

The result, of course, is not multiple fields, but one formula with the appearance of multiple fields.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top