Programatic access to the MaxDataAxisValue and MinDataAxisValue of the IGraphObject

Posted on 2003-11-14
Medium Priority
Last Modified: 2007-12-19
I'm writing a report with asp.net and c# that generates three seperate bar graphs from the same set of data.  I want to be able to find the largest value in the data set and programatically set the MinDataAxisValue of all the graphs to the same value, so that the relative size of the bars on each graph is the same.

I get access to the report object with this line

BIRGraphReport gr = new BIRGraphReport();

where BIRGraphReport refers to the BIRGraphReport.rpt file.

The problem is I can't find any access to the graph object in the report object.  In vs.net I look in the properties window for the graph and it says it is of type IGraphObject, but when I search for that object in the object browser, the browser can't find the class or interface.  Please help.
Question by:lloyd13
  • 2
LVL 101

Expert Comment

ID: 9750122
Which version and edition of CR?

What references to CR are you including in the application.

To get what you want you will probably need to use the CRAXDDRT library or its equivalent for asp.  CRAXDDRT is the Crystal Reports ActiveX Designer Design and RunTime Library.  It exposes design time objects to the application at runtime.  Problem is you must pay for a license for each client.


Author Comment

ID: 9764475
I'm using the CR edition that comes with Visual Studio .NET.  In the About Microsoft Development Environment it just says  Crystal Reports for Visual Studio .NET

The references I have to CR are


is CRAXDDRT a library usable from a .net application?

Author Comment

ID: 9764983
I did a search for CRAXDDRT and found craxddrt20.dll in ..\Common Files\Crysal Decisions\1.0\bin

I included this a reference to my project and through the Object Browser I can see that it contains the class definision for GraphObject with implements the IGraphObject interface.  The IGraphObject interface has all the properties I need to modify the attributes of the chart.

I also found the reference to the graph in my BIRGraphReport object like so


The problem now is that gr.Section1.ReportObjects["Graph1"] is a ChartObject in the CrystalDecisions.CrystalReports.Engine library and not a GraphObject.  When I try to cast it to a GraphObject I get a "Specified Cast Is Not Valid" exception.  So I'm closer but still not able to modify the properties of the graph.


Accepted Solution

modulo earned 0 total points
ID: 11861506
PAQed, with points refunded (125)

Community Support Moderator

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.

Question has a verified solution.

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

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses
Course of the Month13 days, 19 hours left to enroll

807 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