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 objDestinationE xcel As New Excel.Applicati on
Dim objDestinationW BS As Excel.Workbooks
objDestinationW BS = objDestinationE xcel.Workbooks
objDestinationW BS.Open(Templat eFileName)
Dim objDestinationW B As Excel.Workbook
objDestinationW B = objDestinationW BS.Item(1)
Dim objDestinationW SS As Excel.Sheets
objDestinationW SS = objDestinationW B.Worksheets
'Dim objNewSheet As Excel.Worksheet
Dim a As Excel.Range = 2
Dim objDestinationS heet As Excel.Worksheet
'Dim objDestinationS heet As Excel.Workbook
'objDestination Sheet = objDestinationW SS.Item(Positio n)
Dim objSourceExcel As New Excel.Applicati on
Dim objSourceWBS As Excel.Workbooks
objSourceWBS = objSourceExcel. Workbooks
Dim objSourceWB As Excel.Workbook
Dim objSourceWSS As Excel.Sheets
Dim objSourceSheet As Excel.Worksheet
Dim objDestinationS heetAFTER 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.Op en(SourceFileNa me(iCounter))
objSourceWB = objSourceWBS.It em(1)
objSourceWSS = objSourceWB.Wor ksheets
objSourceSheet = CType(objSource WSS.Item(1), Excel.Worksheet )
'oSheet = CType(oSheets.I tem(iCount + 1), Excel.Worksheet )
objDestinationS heet = objDestinationW SS.Item(iCounte r + 1)
objDestinationS heetAFTER = objDestinationW SS.Item(iCounte r + 2)
objDestinationW SS.Add(objDesti nationSheet, objDestinationS heetAFTER, 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........ .........
Dim objDestinationE xcel As New Excel.Applicati on
Dim objDestinationW BS As Excel.Workbooks
objDestinationW BS = objDestinationE xcel.Workbooks
objDestinationW BS.Open(Templat eFileName)
Dim objDestinationW B As Excel.Workbook
objDestinationW B = objDestinationW BS.Item(1)
Dim objDestinationW SS As Excel.Sheets
objDestinationW SS = objDestinationW B.Worksheets
'Dim objNewSheet As Excel.Worksheet
Dim a As Excel.Range = 2
Dim objDestinationS heet As Excel.Worksheet
'Dim objDestinationS heet As Excel.Workbook
'objDestination Sheet = objDestinationW SS.Item(Positio n)
Dim objSourceExcel As New Excel.Applicati on
Dim objSourceWBS As Excel.Workbooks
objSourceWBS = objSourceExcel. Workbooks
Dim objSourceWB As Excel.Workbook
Dim objSourceWSS As Excel.Sheets
Dim objSourceSheet As Excel.Worksheet
Dim objDestinationS heetAFTER 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.Op en(SourceFileNa me(iCounter))
objSourceWB = objSourceWBS.It em(1)
objSourceWSS = objSourceWB.Wor ksheets
objSourceSheet = CType(objSource WSS.Item(1), Excel.Worksheet )
'oSheet = CType(oSheets.I tem(iCount + 1), Excel.Worksheet )
objDestinationS heet = objDestinationW SS.Item(iCounte r + 1)
objDestinationS heetAFTER = objDestinationW SS.Item(iCounte r + 2)
objDestinationW SS.Add(objDesti nationSheet, objDestinationS heetAFTER, 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........ .........
Comment