Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 266
  • Last Modified:

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
0
Terrace
Asked:
Terrace
  • 4
  • 3
  • 2
  • +1
3 Solutions
 
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
 
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
[Webinar On Demand] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

 
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
 
mlmccCommented:
Here is a paper on doing it in .Net

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

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

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 4
  • 3
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now