Changing Chart MinDataAxisValue and MaxDataAccessValue at Runtime using RAS
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
If bGraph Then Exit For
' Format the graph object.
.AutoRangeData2Axis = False
.Data2AxisDivisionMethod = crManualDivision
.MaxData2AxisValue = 999999
.MaxDataAxisValue = 999999
.MinData2AxisValue = -999999
.MinDataAxisValue = -999999
' Set the report source of the viewer and view the report.
CRViewer1.ReportSource = oReport
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"
Sub CreateReport(ByVal path As String)
m_crNetDoc = New ReportDocument
m_RasDoc = m_crNetDoc.ReportClientDocument
CRViewer.ReportSource = m_RasDoc.ReportSource
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
Resource Computer Solutions