Reporting in Excel

  • Thread starter Thread starter Diego
  • Start date Start date
D

Diego

Is there a way to do that?

Is there any way to make this work on ASP.NET? It works perfectly in VB.NET


Dim app As Object

'app = New Excel.Application()

app = CreateObject("Excel.Application")

' Make it visible

app.Visible = True

' Add a new workbook

Dim wb As Object

wb = app.workbooks.add

' Fill array of values first...

Dim arr(19, 9) As Integer ' Note: VBScript is zero-based

Dim i, j As Integer

For i = 1 To 20

For j = 1 To 10

arr(i - 1, j - 1) = i * j

Next

Next

' Declare a range object to hold our data

Dim rng As Object

rng = wb.Activesheet.Range("A1").Resize(20, 10)

' Now assign them all in one shot...

rng.value = arr

' Add a new chart based on the data

wb.Charts.Add()

wb.ActiveChart.ChartType = 70 'xl3dPieExploded

wb.ActiveChart.SetSourceData(rng, 2) ' xlColumns

wb.ActiveChart.Location(2, "Sheet1") 'xlLocationAsObject

' Rotate it around...

For i = 1 To 360 Step 30

wb.activechart.rotation = i

Next

' Give the user control of Excel

app.UserControl = True





Thanks,

Diego.
 
Back
Top