cancel
Showing results for 
Search instead for 
Did you mean: 

Changing Chart MinDataAxisValue and MaxDataAccessValue at Runtime using RAS

Former Member
0 Kudos

Greetings Fellow .Net Coders,

I have been workin on a solution for several days now in which it is necessary to over-ride the automatic Min and Max data axis Values (Scale) at runtime for a chart in a CR2008 report. Since CRAXDRT.DLL is no longer supported by CR2008, I need to find out how to control these values at runtime. The legacy method to accomplish what I need to do is as follows:

Dim oReport As New CrystalReport1

Private Sub Form_Load()

' Declare an GraphObject object.

Dim oGraph As CRAXDRT.GraphObject

' Declare a generic Object.

Dim oObject As Object

' Declare a Section object.

Dim oSection As CRAXDRT.Section

' This variable is set to true once the graph object is found.

Dim bGraph As Boolean

bGraph = False

' Search for all the report objects in each section.

For Each oSection In oReport.Sections

For Each oObject In oSection.ReportObjects

' Find the first graph object.

If oObject.Kind = crGraphObject Then

' Get the graph object and exit the loop.

Set oGraph = oObject

bGraph = True

Exit For

End If

Next oObject

If bGraph Then Exit For

Next oSection

' Format the graph object.

With oGraph

.AutoRangeData2Axis = False

.Data2AxisDivisionMethod = crManualDivision

.MaxData2AxisValue = 999999

.MaxDataAxisValue = 999999

.MinData2AxisValue = -999999

.MinDataAxisValue = -999999

End With

' Set the report source of the viewer and view the report.

CRViewer1.ReportSource = oReport

CRViewer1.ViewReport

In yesterdays research I found it is necessary to now use in proc RAS to reference and control the formatting of a chart at runtime. I got as far as the code below shows:

Private Sub CrystalReportViewer1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CrystalReportViewer1.Load

CRViewer = Me.CrystalReportViewer1

Dim path As String = "C:\DocumentPath\rptInsideDiameter.rpt"

CreateReport(path)

End Sub

Sub CreateReport(ByVal path As String)

m_crNetDoc = New ReportDocument

m_crNetDoc.Load(path)

m_RasDoc = m_crNetDoc.ReportClientDocument

CRViewer.ReportSource = m_RasDoc.ReportSource

End Sub

Can anyone help direct me to the reference/examples/tutorial content to help me achieve the control of chart formatting at runtime using in-proc RAS?

Thanks in Advance

Jeremy May

Resource Computer Solutions

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Hi Joe and Jeremy,

I did a quick test of the BOE RAS sample and dropped the code into my inProc RAS test app and even after using the Object browser I can not see any way of doing this either. The default is set to Auto Scale.

Also for your info the options in Chart Expert from the Designer is the only parts that could be changed and not all of them.

I also checked with the Report Design people and there doesn't seem to be any way to "adjust" this using report options or other methods.

I'll bring this up with the Program Managers and see if there is anything we can and if they would consider an Enhancement request. ER's don't usually make it into current version and if agreed to do so would be in some future release.

Thank you

Don

Former Member
0 Kudos

Wow, so if I understand correctly, CR 2008 has eliminated support for this functionality all together? Thank you for the information, and please let me know if this may be part of a release in the future.

Thanks!

JM

Answers (1)

Answers (1)

Former Member
0 Kudos

I am considering this question answered at this time as it seems this we have lost this functionality in this release of CR. Hopefully they will include this functionality in future release. Thanks Don!

0 Kudos

Hi Jeremy,

That is the same reason I am going to the Product team with. We've lost functionality....

Hopefully it's something they can put back in, hard to say though, the charting dll's are third party so we may not have a .NET bridge to get into it at this time.

For now your only option will be to stay with CR XI R2 and RDC to keep this functionality.

If anyone would like to purchase and open a support case and attach a Business Case document as to why it's need it gives us more info and reasons to add the functionality.

Thank you again

Don

Former Member
0 Kudos

Hi Jeremy, Don

We had similar issue with trying to alter chart properties at run-time from CR XI RDC SP3 with VC++ 6.0. I managed to change the properties on Y axis (especially the scale) but not on X axis. Originally I thought that it is a bug but later on understood that chart object does not have great support with the run time API's. I consider that as a limitation of the product and hope that it will be implemented in the future in supported versions.

Best Regards,

Alex

Former Member
0 Kudos

Indeed, Hopefully Business Objects will restore this funcionality. Unfortunately, for my project I had to revert to using a free charting control and the printform function. With this combination I created a dazzling multiple histogram report. Im not so sure I could have even done it with CR. Anyway hope to see some more functionality in the future.