How do I read or pass a running total field from crystal reports to VB

How do I read or pass a running total field from crystal reports to VB
TerraceAsked:
Who is Participating?
 
mlmccCommented:
Here is a paper on doing it in .Net

http://msdn.microsoft.com/en-us/library/ms227603(v=vs.90).aspx

mlmcc
0
 
jppintoCommented:
0
 
mlmccCommented:
What are you trying to do?

In general it is not possible to pass the information from the report to the application.

mlmcc
0
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
TerraceAuthor Commented:
I have various sales reports that all have different filter criteria.  So I use a VB application to pass paramters then run the reports.  In each report I have "TotalSales" field which is a running total.  So what I would like is to have VB read the "TotalSales" field after each report is run and save the total to a table.  It is my understanding that the report itself is an object  so I would anticipate that there would be some type of syntax like:

report.formulaField("TotalSales")  that could be used with a get or read function.
0
 
vastoCommented:
Think about the report as a part of presentation layer.
You can create a stored procedure and use it to retrieve the data for the report and also to calculate the total sales and insert the value into a table.  The other option is to use SQL Command inside crystal reports.
Even if you return the value back to vb you will need to have another trip to the database to save it. If you use stored proc or command everything will be done in one trip.
0
 
mlmccCommented:
You possibly could write a UFL that saves the value either to the database or to a text file.

mlmcc
0
 
TerraceAuthor Commented:
Thanks for the comment, could you give me an example and how is this called in crystal reports.  A User Function Library seems a cleaner way to go. I have never use UFL.
0
 
mlmccCommented:
A UFL is just a DLL with a name Crystal will recognize (cruflxxxx.dll)

Here is a white paper on writing one in VB.
http://www.sdn.sap.com/irj/boc/go/portal/prtroot/docs/library/uuid/0024f60d-751e-2b10-dea0-b1b8f4a297cf?QuickLink=index&overridelayout=true

mlmcc
0
 
TerraceAuthor Commented:
Thanks for the papers, I see I can also purchase  a UFL package that executes SQL, email, etc.  The comment above from Vasto also spoke of executing SQL statements in Crystal, was this refering to UFL also, or is there another way to exeute SQL statements in Crystal?  Also, seems like UFL is essentially like a stored procedure.  
0
 
vastoCommented:
Stored procedure and UFL are different approaches.
If your report is based on SQL and you want to change it to use stored procedure you will need almost to recreate the report. So stored procedure will do the job but can be costly because will take development time.
mlmcc already provided information about UFL. I will just say that both ways have advantages but if your report is complicate UFL will work better for you because will be easier to implement. You may need to find a secure way to pass database connection information to UFL.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.