473,385 Members | 1,806 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Reporting in Excel

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.
Nov 18 '05 #1
1 1743
This article contains the information you need to work with Excel files from
ASP.NET:
http://www.aspnetpro.com/NewsletterA...200309so_l.asp

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
"Diego" <1@2.com> wrote in message
news:e9**************@TK2MSFTNGP11.phx.gbl...
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.

Nov 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Amber | last post by:
I found a sample on dynamic reporting to a datagrid and exporting to excel. For those who are into reporting into Excel. This web tool allows for adhoc select statements and reports. ...
3
by: Mohammad S Khan | last post by:
I am currently doing some research on reporting features provided / compatible with dotnet features. Our current application has excel reprots that are emailed both with an without scheduling...
1
by: pb648174 | last post by:
Messages to the reporting services group get no attention, and I haven't been able to find anything on MS support so I am going to try here. We have a prticular report, that when exported to Excel...
6
by: P Jones | last post by:
Hi, I support an enterprise web application (IE client) built in VB6, with about 200 classes, serving about 7000 users, running on 3 clustered servers. I need to incorporate web reporting for...
2
by: Steve Miller | last post by:
hello... i am a 'user' of access, meaning, i import excel files, join, and merge....that's about the extent of my expertise with ms-access. my boss wants me to create an access application that...
0
by: No one | last post by:
There doesn't seem to be a newgroups for this, so I chosen those that seem to fit best. I have an ASP.Net control written in C# that renders reports via Reporting Services. Normally, these...
1
by: Ethem Azun | last post by:
Hi, I'm looking for an excel reporting solution to use in my ASP.NET application. I don't want to use Crystal Reports (too poor for excel reporting) and Reporting Services has requirements that...
5
by: Joel DaBona | last post by:
Hello, Most reporting components that I'm aware of do not like object graphs with simple C# objects. (like Order - OrderItems). Instead they require me to transform the structure into...
1
by: =?Utf-8?B?UHJhc2FkIFBhdGls?= | last post by:
Hi, I have developed a report with Page Breaks based on Group in SQL Server Reporting Services 2000. This report works fine in SQL Reporting Services showing Page Breaks for different groups. ...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.