HELP PLEASE modifying chart properties at runtime

From: JSE (john_at_nospam.ca)
Date: 11/30/04


Date: Tue, 30 Nov 2004 23:57:35 GMT

Hello everyone. I have a problem involving changing some of the attributes
of a bar chart from our VB application. The problem areaa has ?? marks at
the beginning of the lines.

We first would like to change the height of our bar chart based on the
intHeight value passed to this routine. The existing routine changes the
database assigned to this report and to it's subreports. That part I have
muddled through. But I'm not sure how to tackle the chart object. The bar
chart is in the subreport header. I think once I can reference the chart
object, the properties will fall into place.

We also need to be able to set the min. data axis value, the max. data axis
value, and the data interval for the bar chart... all at runtime. Business
Objects has inferred that we can do this with CR9 RDC and do not need to go
to V10 or RAS to do it. My problem is how!!

We would certainly appreciate some help if you are familiar with this sort
of thing. Thank you very much in advance.

Cheers.
John Edgar
----------------------------------------------------------------------------

----
PUBLIC SUB
   Screen.MousePointer = vbHourglass
   Dim report1 As New CrystalReport9a
   CRViewer93.ReportSource = report1
....
   ReLocateDatabase report1, intHeight, intMinDataValue, intMaxDataValue,
intInterval
....
   CRViewer93.Refresh
   CRViewer93.ViewReport
   Screen.MousePointer = vbDefault
   Set report1 = Nothing
....
END SUB
PRIVATE SUB RELOCATEDATABASE(crxReport As craxdrt.Report, intHeight As
Integer, intMinDataValue as integer, intMaxDataValue as integer, intInterval
as integer)
   Dim crGraphObj As craxdrt.GraphObject
   Dim crxDatabaseTable As craxdrt.DatabaseTable
   Dim crxGraphType As craxdrt.CRGraphType
   Dim crObject As Object
   Dim crxSubReport As craxdrt.Report
   Dim crxSubDatabaseTable As craxdrt.DatabaseTable
   Dim crxSubSection As craxdrt.Section
   Dim crxSubObject As Object
   'relocate databases for all main report files
   For Each crxDatabaseTable In crxReport.Database.Tables
      crxDatabaseTable.ConnectionProperties.Item("Database Name") =
gMdbPath_3
   Next
   'relocate data bases for all subreport files
   For Each crxSection In crxReport.Sections
      For Each crObject In crxSection.ReportObjects
         If crObject.Kind = crSubreportObject Then
            Set crxSubReport =
crxReport.OpenSubreport(crObject.SubreportName)
            'relocate all databases
            For Each crxSubDatabaseTable In crxSubReport.Database.Tables
               crxSubDatabaseTable.ConnectionProperties.Item("Database
Name") = gMdbPath_3
            Next
-----------------------------------------------------------------
*****   Am I on the right track here?
            'resize chart
??          For Each crxChartType In crxsubreport. ?????????????
??             crGraphObj = crxSubReport.Sections(0).ReportObjects.Item(0)
??             crGraphObj.Height = intHeight
            Next
            'set min data axis value
            'set max date axis value
            'set interval value
-----------------------------------------------------------------
         End If
      Next
   Next
END SUB


Relevant Pages

  • Re: Positioning datalabels
    ... chart in Access. ... So why not work with Excel, don't know if you can embed an Excel object, ... Dim cht As Chart ... ' at present all Y's will be right but all X's on or in middle of labels) ...
    (microsoft.public.excel.programming)
  • Re: Need help with SeriesCollection Object Please !
    ... Dim sWSname As String, sFile As String ... If I follow you are trying to remove all but essential chart data. ... ChartIsSheet = False ...
    (microsoft.public.excel.programming)
  • Re: PLEASE help - Fast approaching deadline
    ... Dim chtCounter As Interger ... chart, including the Chart Title. ... Dim intSheetChartCount As Integer 'Count of charts on a sheet ...
    (microsoft.public.excel.programming)
  • Re: MS Chart in Access
    ... What follows is an example of how to create and manipulate a chart in Excel ... Dim xLApp As Excel.Application ... Dim sSQL As String ...
    (microsoft.public.access.modulesdaovba)
  • Re: Using Access to create dynamic chart in Excel
    ... Look for the area in the code for the line "'move chart around " ... Below is an example of how to create a chart in Excel from Access. ... Dim xLApp As Excel.Application ... Dim sSQL As String ...
    (microsoft.public.access.modulesdaovba)

Loading