Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Excel 2000 Chart Size?
Message
De
18/05/2001 11:39:09
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
18/05/2001 08:19:05
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00508544
Message ID:
00508768
Vues:
18
Hi Tom,
Blushing compliments :) Below code creates a simple graph and publishes HTML :
#Define xl3DColumn	-4100

#Define xlCategory		1
#Define xlValue			2
#Define xlSeriesAxis	3

#Define xlSourceChart 5
#Define xlHTMLStatic 0
#Define xlHTMLChart 3

*** set the LOCALEID to English
nlLocaleId=sys(3004)		&& Save local id
=sys(3006,1033)				&& We will be sending instructions in English
ox = crea('excel.application')
ox.workbooks.add()
With ox.activeworkbook.worksheets(1)
  .Cells(1,1).Value = "Product"
  .Cells(1,2).Value = "AMount"
  .Cells(1,3).value = "Quota"
  .Cells(2,1).Value = "Prod1"
  .Cells(2,2).Value = 12000
  .Cells(2,3).value = 11000
  .Cells(3,1).Value = "Prod2"
  .Cells(3,2).Value = 45000
  .Cells(3,3).value = 48000
  .Cells(4,1).Value = "Prod3"
  .Cells(4,2).Value = 37000
  .Cells(4,3).value = 38000
  oChart = .ChartObjects.Add(0, 0, 500, 200) && Chart position and size here-in points
  oChart.Chart.chartwizard(.range(.Cells(1,1),.Cells(4,3)),xl3DColumn,4,1,0,1,1,"","","","")
Endwith
With oChart.Chart
  .hastitle = .t.
  .haslegend = .t.
  .ChartTitle.caption = "This is chart title"
  .plotby = 2
  With .Axes(xlValue)
    .hastitle = .T.
    With .AxisTitle
      .Caption = "This is Rotated Value title"
      .Font.Size = 10
      .Font.Bold = .f.
      .Orientation = 90 && Show 90 degrees rotated - clockwise
    Endwith
  Endwith
  lcHTMLPath = sys(5)+curdir()+"EXCELHTMLExportTest.htm"
  lcHTMLPageTitle = "Published From Excel"
  ox.activeworkbook.PublishObjects.Add(xlSourceChart, lcHTMLPath, ;
    ox.activeworkbook.worksheets(1).name,.Parent.Name, ;
    xlHTMLStatic, "", lcHTMLPageTitle).Publish(.t.)
Endwith
ox.activeworkbook.saved = .t. && Suppress save dialog
ox.quit      && Quit excel
=sys(3006,val(nlLocaleId))
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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform