Terrace
asked on
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
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
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("Total Sales") that could be used with a get or read function.
report.formulaField("Total
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.
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.
You possibly could write a UFL that saves the value either to the database or to a text file.
mlmcc
mlmcc
ASKER
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.
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
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
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
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.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
In general it is not possible to pass the information from the report to the application.
mlmcc