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

Are array of arrays possible?

Status
Not open for further replies.

JCruz063

Programmer
Feb 21, 2003
716
US
Hi All,
Is it possible to create an array of ararys in crystal reports?

I need to keep track of some daily and weekly total for a number of months Here's the deal:

A web user (which interacts with a .NET application, not with the report itself) will request to view a report and will provide a range of dates (e.g. Jan1 - Jan 23) to include in it.

My report will look something like this:

[tt] Januaray
week 1 week 2 week 3 week 4
no % no % no % no %
Item 1 -- - -- - -- - -- -
Item 2 -- - -- - -- - -- -
Item 3 -- - -- - -- - -- -

Item 4 -- - -- - -- - -- -
Item 5 -- - -- - -- - -- -
Item 6 -- - -- - -- - -- -
.
.
.
Total -- - -- - -- - -- -[/tt]

Each week displays an average. Due to the fact that some weeks are shorter than others (e.g. for a mon-fri week, if the first of the month is on a thursday, that week will only have 2 days in it), the number of days in the week may vary, and thus I need to calculate the number of days in each week to compute the average correctly. Many of my records may have the same date and so, to calculate the number of unique days in each week, I keep an array of the unique days found per week. Something like this:
[tt]
if not ({myTable.Date} in arrayDatesInWeek1) then
// increment the number of days in this week
// add the current date to the array[/tt]

To implement the above without array of arrays, I'll be forced create five arrays (one for each week).

Thus, the question: Is it possible to create an array of arrays in Crystal Reports? If so, how?

Thanks!

JC


_________________________________________________
To get the best response to a question, read faq222-2244.
 
As far as I know, CR cannot handle an array of arrays. You can get creative though, and keep a separate array of strings, separating each string value by a particular character (like "@" or "|"), then use the Split function to get to each "element" of the faked array. Not sure if this doing this would be any better than creating the five additional arrays for each week, but it's the only workaround I can think of at the moment.

-dave
 
Thanks dave!

That sounds like something that might work. I'll give it a try.

Thanks again!

JC

_________________________________________________
To get the best response to a question, read faq222-2244.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top