PC Review


Reply
Thread Tools Rate Thread

Dataset reults to excel sheet

 
 
Vanajakshi Pidatala
Guest
Posts: n/a
 
      18th May 2004
Hello,

I am trying to show data in dataset in to an excel
sheet(ASP.NET/VB.NET). I AM DOING THIS ON SERVER(IIS SERVER) WHICH HAS
EXCEL VERSION 9. I COULD ADD REFERENCE TO EXCEL VERSION 9 AND OFFICE
VERSION 10 IN MY PROJECT. I DO NOT HAVE EXC EL VERSION 10 TO WHICH I
CAN ADD REFERENCE (WHICH I THINK IS THE PROBLEM). i AM GETTING THE
ERROR ' REFERENCE TO NULL OBJECT AT THE CODE line
Dim excelBook As Excel.Workbook = excelApp.Workbooks.Add(object
excelApp is not create and I am trying to refere it).

My questin are:

1.Do I need to have excel 10 to have this code run.

2.Do I need to have excel 10 on all clients machines(people who are
accesing this page through web page). Or is it just enough to have
excel 10 on the server(iis server).

3.Is there a way that I c an have this code run woth any version of
excel.

4.Is there a diifrent way that I can open excel and show satase reults
in it.

I AM TRYNG SOME THING LIKE THIS:

Dim excelApp As Excel.Application
Dim excelBook As Excel.Workbook = excelApp.Workbooks.Add
'Dim excelBook As NEW Excel.Workbook
'excelBook = CType(excelApp.Workbooks(1), Excel.Workbook)
Dim excelWorksheet As NEW Excel.Worksheet
excelWorksheet = CType(excelBook.Worksheets(1),
Excel.Worksheet)
'Makes Excel invisible to the user until spreadsheet is
populated
excelApp.Visible = False
With excelWorksheet
'Format cell headings
.Range("A1").Value = "Issue Type"
.Range("A1").Font.Bold = True
.Range("A1").ColumnWidth = 200
.Range("B1").Value = "Number of Calls"
.Range("B1").Font.Bold = True
.Range("B1").ColumnWidth = 15
.Range("A2").Value = sDateRange
.Range("A2").Font.Bold = True
.Range("A2").ColumnWidth = 200


For i = 0 To dsIssueType.Tables(0).Rows.Count - 1
.Range("A" & i.ToString + 3).Value =
dsIssueType.Tables(0).Rows(i)("IssueType")
.Range("B" & i.ToString + 3).Value =
dsIssueType.Tables(0).Rows(i)("NumberOfTickets")

Next
.Range("A" & i.ToString + 4).Value = "Total Number of
Calls"
.Range("A" & i.ToString + 4).Font.Bold = True
.Range("A" & i.ToString + 4).ColumnWidth = 200
.Range("B" & i.ToString + 4).Value =
nTotalNumberOfCalls
.Range("B" & i.ToString + 4).Font.Bold = True
.Range("B" & i.ToString + 4).ColumnWidth = 15

excelApp.Visible = True
End With

Thanks a lot
 
Reply With Quote
 
 
 
 
Cor Ligthert
Guest
Posts: n/a
 
      19th May 2004
Hi Vanajakshi,

When you use interop as you do, than you create a tunnel to your
application.

When you use from that application features, than as far as I know should
that be the features from the existing application.

I hope it helps?

Cor


 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Message box pop up when no reults =?Utf-8?B?am9obiBtY21pY2hhZWw=?= Microsoft Access Queries 8 6th Sep 2007 05:54 PM
Export DataSet/ XML as Excel Sheet Sachin Salgarkar Microsoft ASP .NET 3 4th Aug 2006 04:40 PM
Dataset results in excel sheet Vanajakshi Pidatala Microsoft ADO .NET 4 20th May 2004 04:43 PM
Exporting a dataset to an excel sheet. raj Microsoft Dot NET Framework Forms 1 27th Dec 2003 04:04 PM
how to convert excel sheet with 65000 records to ado.net dataset rama Microsoft Excel Programming 1 27th Oct 2003 04:15 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:02 AM.