Solved

Crystal Reports arrays

Posted on 2013-01-10
9
359 Views
Last Modified: 2013-01-10
I need instructions to create 4 arrays in crystal report. The arrays will have 16 rows each. The arrays values come from 4 fields from the report query and the 16 rows are based on the 16 possible rows per each person (group).

How do a declare the 4 arrays with these characteristics and how do I assign the values then print each value on the report?
The report is grouped by person and shuld display something like:
                              value       Unit           AVG      estimated      
size                         c1_1        c2_1          c3_1       c4_1
height                     c1_2        c2_2          c3_2       c4_2
weight                    c1_3        c2_3           c3_3       c4_3
following 13 more rows...
0
Comment
Question by:sweetbuttercup
  • 4
  • 4
9 Comments
 
LVL 77

Expert Comment

by:peter57r
Comment Utility
Can you explain the data a bit more .  If each row is a separate record then then is no obvious need for any arrays.
Otherwise how do you identify which values go into which row.
0
 
LVL 1

Author Comment

by:sweetbuttercup
Comment Utility
If each row is a separate record = Yes.

However because of the way I need to display the valued in a grid and leave the empty space if there's no value I think I need and array. The grid has an specific order to display. So
size       = position 1              
height   = position 2
weight   = position 3                

Regardeless the order in the query result.
0
 
LVL 77

Expert Comment

by:peter57r
Comment Utility
I wouldn't use multiple arrays for this problem myself.

 I would provide a table of 'row headings' which included both the heading and the sort position and then use a left join from the headings table to the main table.  Every heading would be included , there is a sort field to get the correct sequence , and the layout of the columns is completely under your control.
0
 
LVL 1

Author Comment

by:sweetbuttercup
Comment Utility
I'm not able to add a table to the server.. any way to do this without creating a tbl
0
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
LVL 77

Expert Comment

by:peter57r
Comment Utility
Can you not create say an Excel spreadsheet to contain the headings list?

In my opinion, you are in for an enormous amount of coding if you go down the array route for this .

You will have to look at each record to determine the placement of values in the arrays (potentially 16 if statements or a 16 leg case statement); you will have to build the entire report design as a grid of 16 print lines or else build an entire grid of 16 print lines in code-  you will not be able to define just one line and have it repeat.  
You have considerations of how you place the results into the report to create a properly aligned set of data in each column.
0
 
LVL 1

Author Comment

by:sweetbuttercup
Comment Utility
Need to go back to the array even if a need to create 64+ formulas to display.. The excel or extra tbl are not an option since I need to post this to a Business Obj server and cannot depend on extra files as well.
0
 
LVL 77

Accepted Solution

by:
peter57r earned 500 total points
Comment Utility
WHat a %^&*&!

Arrays are quite simple to use because they are very limited in functionality in Crystal.

Assuming your values are numbers then you do this to declare an array...

Numbervar array Array1;
Redim array1[16];

So you have an equivalent pair of comands for each of the 4 arrays.

Note that unlike some other languages Crystal arrays start at index 1, not 0.

So you would have a formula to fill the arrays as something like...

(repeat all the Numbervar array lines.)
If {table.dimensionfield} = "Size" then   //place in position1
(array1[1]:= {table.ValueField};
array2[1]:=.....;   //unit field
array3[1]:=....;  //avg field
array4[1]:=...... //estimated field
)
else if {table.dimensionfield} = "Height" then   //place in position2
(array1[2]:= {table.ValueField};
array2[2]:=.....;  //unit field
array3[2]:=....;  //
array4[2]:=......
)
....and so on for every dimension

Then as you say, you will need 64 formula fields , each getting one value from one of the arrays to lay out the grid of resulkts.

If you are grouping the report ( so one grid per group) then you need to declare the arrays in the group header and show the results in the group footer.
0
 
LVL 100

Expert Comment

by:mlmcc
Comment Utility
What is the data you have in the records?

mlmcc
0
 
LVL 1

Author Closing Comment

by:sweetbuttercup
Comment Utility
Yuk!!.. I finished!! It looks pretty ugly with all the formulas but does work!! Thank you..
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now