Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How can i put an Excel graph in a VFP report?
Message
From
30/11/2001 12:10:41
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
30/11/2001 10:03:03
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00587985
Message ID:
00588082
Views:
26
>Hello,
>
>Could somebody help me with the following:
>
>I have to put an Excel graph into a VFP report.
>But how? OLE ??
>
>Thanx in advance
>Ron

Ron,
In order to print via report either it should be a general field or image file. You could publish the chart as gif but that gif crashes with VFP. The other option of general field is possible :
Create cursor testgen (graphtest g)
Append blank
Append general graphtest class Excel.Chart data ''

oForm = createobject("myForm")
With oForm
  .height = 400
  .width = 600
  .addobject("MyGraph","OleBoundControl")
  With .myGraph
    .height = oForm.height - 20
    .width = oForm.width
    .left = 0
    .top = 0
    .ControlSource = "testgen.graphtest"
    Wait window nowait "Plotting..."
    With .Sheets('Sheet1')
      .Cells(1,1).Value = "NumProd1"
      .Cells(1,2).Value = "AMount"
      .Cells(1,3).value = "Quota"
      .Cells(2,1).Value = 113
      .Cells(2,2).Value = 12000
      .Cells(2,3).value = 23
      .Cells(3,1).Value = 254
      .Cells(3,2).Value = 45000
      .Cells(3,3).value = 24
      .Cells(4,1).Value = 165
      .Cells(4,2).Value = 37000
      .Cells(4,3).value = 42
      toSource = .range(.Cells(1,1),.Cells(4,3))
    Endwith
    With .Charts(1)
      .SetSourceData(toSource, 2)
      .hastitle = .t.
      .haslegend = .t.
      .ChartTitle.caption = "This is chart title"
      .ChartType = xl3DColumn
    Endwith
*...
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform