By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,686 Members | 2,529 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,686 IT Pros & Developers. It's quick & easy.

export .net reports to excel

P: 3
I am devolping a web application which which .net reports to a excel work book .each report in one excel sheet.i am using the following code..........


Dim objDestinationExcel As New Excel.Application
Dim objDestinationWBS As Excel.Workbooks
objDestinationWBS = objDestinationExcel.Workbooks
objDestinationWBS.Open(TemplateFileName)
Dim objDestinationWB As Excel.Workbook
objDestinationWB = objDestinationWBS.Item(1)
Dim objDestinationWSS As Excel.Sheets
objDestinationWSS = objDestinationWB.Worksheets
'Dim objNewSheet As Excel.Worksheet
Dim a As Excel.Range = 2
Dim objDestinationSheet As Excel.Worksheet
'Dim objDestinationSheet As Excel.Workbook
'objDestinationSheet = objDestinationWSS.Item(Position)


Dim objSourceExcel As New Excel.Application
Dim objSourceWBS As Excel.Workbooks
objSourceWBS = objSourceExcel.Workbooks
Dim objSourceWB As Excel.Workbook
Dim objSourceWSS As Excel.Sheets
Dim objSourceSheet As Excel.Worksheet

Dim objDestinationSheetAFTER As Excel.Worksheet

' Iterating through the file name list and opening one by one.
Dim iCounter As Integer
For iCounter = 0 To SourceFileName.Length - 1
objSourceWBS.Open(SourceFileName(iCounter))
objSourceWB = objSourceWBS.Item(1)
objSourceWSS = objSourceWB.Worksheets
objSourceSheet = CType(objSourceWSS.Item(1), Excel.Worksheet)
'oSheet = CType(oSheets.Item(iCount + 1), Excel.Worksheet)
objDestinationSheet = objDestinationWSS.Item(iCounter + 1)
objDestinationSheetAFTER = objDestinationWSS.Item(iCounter + 2)
objDestinationWSS.Add(objDestinationSheet, objDestinationSheetAFTER, 1, objSourceSheet)

this code is creating work book with some excel sheets.The data is not copied to the sheets.is their any method to copy the data of .net report to a excel sheet?Please help me to solve this problem.IT is very urgent.Thanku in advance.................
Nov 30 '06 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.