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

Arrays

Status
Not open for further replies.

RobbieB

Technical User
Apr 25, 2003
215
US
I was reading through lbass's post on Report Speed tips and someone brought up Arrays and the possibility of using them instead of Sub-Reports. I've never been a big user of arrays because they never seemed like a real world solution to any of the problems I am typically dealing with. So, in the vain of Lbass's post on speed tips I would love to have someone better explain arrays and possibly have people post examples of the most creative uses they have found for arrays.
Thanks in advance,
RobbieB
 
CR is limited to one dimensional arrays, so it requires a good deal of coding for complex operations, and the version of crystal is critical as older versions were limited.

That is to say that you should post your software version, of course.

To avoid subreports that hinder performance, try to write SQL that returns the data required for the report.

Subreports are NOT always a disadvantage, at times they can be faster and the only intelligent solution. A good example is a dashboard report with unrelated select statements, such as an HR subreport which supplies personnel counts, then an Accounting subreport which returns financial information, so different selects are used, and possibly different databases.

As for advanced array use, you can store values and then use them later, and here's a basic example:

I would address your array concerns were you to give an example of them, however there are 1000's of articles on array theory on the web in various languages, so if you're simply seeking theory, do a search and read up on them.

I have used pseudo 2 and 3 dimensional arrays in Crystal, if you have a real world example of something you need to do, or you would like to improve performance, post your environment and examples of the data and expected output.

What you're asking for is a vast topic which has been covered many times throughout the web.

-k
 
I understand and agree that sub-reports are not a bad "thing". I use them when I have to and typically in situations similar to your example. I realize my post is a bit vague but that's because I am trying to learn when I could use arrays instead of other solutions. If I knew what arrays were really capable of I could possibly give a real world example of what I wanted to do, but then I woundn't need to ask what they are capable of. Kind of a catch 22 for me I guess.

To answer your question, I am on V. XI and a SQL database.

I am aware of the basic funtionality of arrays as tought in the Crystal Designer Classes 1,2 and 3 but I never thought building a "list" and pulling a value out of it based on its position was very useful. That's why I was looking for some suggestions here. Just a couple of practical examples that people have come up with that could give me some insight.

I'll research it on the web as you suggest, I thought this forum might provide me with more relevant information than I would find just surfing the web though.
Thanks for your help
RB
 
Yeah, arrays aren't blazingly fast either, so you may not enjoy a significant performance advantage.

Once you've read the above, keep in mind that each of the examples given are better suited to be performed on the database.

I started working on an advanced array requirement here for someone last week but the requirements kept changing so I gave up.

What you can do is store up to 1000 values in numerous arrays so that you can reuse data within the report later, which might prove beneficial, though a fast database and a sureport with another select might outrun it.

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top