Need to return the values of summary and formula fields in Crystal Reports to VB.NET

I need to return the values from summary and formula fields in a Crystal Report back to the calling VB.NET app.  In my old VB6 code I used this syntax:

sumfldval = CrxReport.SummaryFields.Item(i).Value
and
formfldval = CrxReport.FormulaFields.GetItemByName("%FLDay").Value

However, in .NET I cannot find a way to access the Value property.  This is where I'm stuck:

        Dim crFormulaFieldDefinitions As FormulaFieldDefinitions
        Dim crFormulaFieldDefinition As FormulaFieldDefinition

        crFormulaFieldDefinitions = CR.DataDefinition.FormulaFields
        crFormulaFieldDefinition = crFormulaFieldDefinitions.Item("FLDay")

How do I return the value that has been assigned to the formula field in the report called "FLDay"?
daveg1959Asked:
Who is Participating?
 
frodomanCommented:
>>> .NET version would actually represent a step backwards in functionality

The .net version is geared generally toward a different audience with a different mindset.  Most .net developers that I've seen using crystal are already using the dataset model which gives them complete access to the data instead of just to some field on a report - I'm not sure if exposing the entire dataset is really a step backwards / maybe just a different point of view.

>>> Is there an additional reference I need to include, or an alternate way of loading the report (that is not .COM) that would expose access to the values?

No there isn't.  You could however create a set of reports that will export to a format that is more handheld friendly - copy and reformat the existing report rather than deriving plain text from values returned from it.

frodoman
0
 
mlmccCommented:
I don't think the .Net version exposes that property.

mlmcc
0
 
frodomanCommented:
I agree - although the object model isn't very clearly documented I haven't found this property.

If you really need your application to know the values, I would solve this problem by creating your report based on a .Net dataset.  That way you populate the dataset within your application and pass it to the Crystal report.  You'll still have the dataset in your app so you can do any calculations needed directly on the data instead of trying to back into it using Crystal.

frodoman
0
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.

 
daveg1959Author Commented:
The problem with frodoman's suggestion is that the existing report includes about 200 formula and summary fields.  It is a very complex financial statement whose contents span 3 separate but concurrent date ranges.  It is produced automatically and distributed in PDF format on a nightly basis.  The reason I need to return some values is so that I can also distribute a text-only derivative version that is handheld-friendly.

It seems odd that the .NET version would actually represent a step backwards in functionality.  Any other suggestions?
0
 
mlmccCommented:
It is not a step backwards but a limited version.  The intent of the .Net version which is distributed with Visual Studio is to generate interest and new sales of the standalone versions.

mlmcc
0
 
daveg1959Author Commented:
One last question before I close this - are you referring to standalone versions of Crystal Reports?  If so, I have a full developer version of CR10 and that's what was used to create the report, not the built-in that comes with Visual Studio.  Is there an additional reference I need to include, or an alternate way of loading the report (that is not .COM) that would expose access to the values?
0
 
daveg1959Author Commented:
Thanks to both of you for your input.  I guess I'm too old school (or maybe just too old!) in my thinking.  I have implemented a clean, if somewhat inelegant workaround.  After exporting to the PDF, I then also export to an Excel file.  I then load the Excel file into a data grid (in my case I prefer Spread for Windows from Farpoint Technologies) and then simply extract the data I need from the appropriate cells.  This approach would not work if the output was dynamic in nature, but for a report with a fixed structure this works just fine.
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.