?
Solved

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

Posted on 2007-10-03
7
Medium Priority
?
510 Views
Last Modified: 2013-11-26
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"?
0
Comment
Question by:daveg1959
  • 3
  • 2
  • 2
7 Comments
 
LVL 101

Expert Comment

by:mlmcc
ID: 20008660
I don't think the .Net version exposes that property.

mlmcc
0
 
LVL 42

Expert Comment

by:frodoman
ID: 20009307
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
 

Author Comment

by:daveg1959
ID: 20010458
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
Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

 
LVL 101

Assisted Solution

by:mlmcc
mlmcc earned 600 total points
ID: 20011270
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
 

Author Comment

by:daveg1959
ID: 20013507
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
 
LVL 42

Accepted Solution

by:
frodoman earned 1400 total points
ID: 20013592
>>> .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
 

Author Comment

by:daveg1959
ID: 20013712
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

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
In real business world data are crucial and sometimes data are shared among different information systems. Hence, an agreeable file transfer protocol need to be established.
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Suggested Courses
Course of the Month14 days, 11 hours left to enroll

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question