Programatic access to the MaxDataAxisValue and MinDataAxisValue of the IGraphObject

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.
lloyd13Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

mlmccCommented:
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.

mlmcc
0
lloyd13Author Commented:
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

CrystalDecisions.CrystalReports.Engine
CrystalDecisions.ReportSource
CrystalDecisions.Shared
CrystalDecisions.Web

is CRAXDDRT a library usable from a .net application?
0
lloyd13Author Commented:
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

gr.Section1.ReportObjects["Graph1"]

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.

0
moduloCommented:
PAQed, with points refunded (125)

modulo
Community Support Moderator
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Crystal Reports

From novice to tech pro — start learning today.

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.