on 10-15-2008 4:47 PM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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
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.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.