Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: New To Crystal Post Reply Post New Topic
Author Message
Magman
Newbie
Newbie


Joined: 24 Jun 2008
Location: United States
Online Status: Offline
Posts: 6
Quote Magman Replybullet Topic: New To Crystal
     Posted: 24 Jun 2008 at 6:19am
Hello all.  1st post in these forums.
 
I have been called to use crystal reports XI at my job and though I can pretty much extract whatever information I need from the tables with slight filtering, I am not grasping the programs full functions.
 
I have been a long time user of Visual Basic and can shread, cut, dice alter and do pretty much anything I want with data once I link to it.   I use some recordsets and I can run complicated logic equations on them. 
 
I haven't a clue to where to begin in crystal to do logical formulations.   In crystal once in the recordset, i could analysis the data, move forward and back in records, assign arrays to certain data....   Can this be done in crystal?
 
I am trying a simple report now where I have 2 sub-reports of data.  Only 2 fields in each, Date and A value.
 
Once a certain value is reach in sub-report 1, I need  to check if that value is maintained for the next 3 days.   If it is, I need to take that 1st initial date and find the corresponding value on that day in the other sub-report.
 
Any ideas. 
 
My overall question is how do you do calculations on data in tables like this?  Do you have to wait for it to be "printed-out" in order for the computer to even consider doing any calculations on it, and how can one compare a group of data from a series of records?  (Like in my case, I need values for 3 straight records and have the computer remember each one of them to perform the equation on?)
 
Thanks a bunch.
 
IP IP Logged
BrianBischof
Admin Group
Admin Group
Avatar

Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Quote BrianBischof Replybullet Posted: 24 Jun 2008 at 2:46pm

Hmmm... I think you should check out my book if you plan to write formulas like the one you're talking about. 

Here is how it works (I assume you are using VB.NET now???). You use VB.NET to create the report object and set any custom formatting necessary BEFORE the report touches the data (e.g. changing the report header, making a field bold, etc.)

Now once CR starts running, VB can't touch the report. You now have to use CR's own internal formula language (Crystal syntax -like C, or Basic syntax - like VB) to work with the records. Although Basic syntax is very similar to VB, there are a lot of differences you'll have to learn.

Re your question, I suggest creating a Global variable (can be shared between subreports and the main report) to track your data and test if three records in a row were processed accordingly. One thing to remember is that formulas are processed linearly. A formula is only calculated as the record is getting printed. Thus, the order that something appears on the report is important. Also, you can't look ahead to future records.

I hope this helps clear up the mysteries between crystal reports and VB. You can find out more about my books at Amazon.com or reading the Crystal Reports eBooks online. 

Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>
IP IP Logged
Magman
Newbie
Newbie


Joined: 24 Jun 2008
Location: United States
Online Status: Offline
Posts: 6
Quote Magman Replybullet Posted: 24 Jun 2008 at 6:56pm
" A formula is only calculated as the record is getting printed. Thus, the order that something appears on the report is important. Also, you can't look ahead to future records. "
 
This is what I thought and is very disappointing.   The problem isn't I can't figure a way to successful answer this question by using means other than crystal.  The problem is we are using a commercial and unique database software that only allows crystal reports to be uploaded into its system.  It saves the report and allows you to call it anytime within the database.  So everything has to be written in crystal code.  There is no VB.net or the like, simply the database.
 
Other than getting some basic calculations and some formatting of the data, you can't do any real hard code data crunching it seems if it calls for steps like I am considering?  There are too many factors it seems to pull off even the simplest process.
 
 
 
 
 


Edited by Magman - 26 Jun 2008 at 3:32am
IP IP Logged
BrianBischof
Admin Group
Admin Group
Avatar

Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Quote BrianBischof Replybullet Posted: 25 Jun 2008 at 1:22am
yes, CR isn't designed to do data-crunching. Simply reporting from the data you give it. If you are locked out of the database, then you will have a tough time with CR. You can do alot w/ Basic syntax, but probaly not to the degree of data crunching you want to do.
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum