|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Free Web 2.0 Code Generator! Generate data entry and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
|
|
#1
|
|||
|
|||
|
VB and Excel
My question is I have a program that generates a table based on SQL data, I want that data saved to excel, and I have code that works for that. The only problem is on the server that hosts this page excel isn't installed. We don't have enough licenses for that. My question is can I force the code to run on the client-side? (all of the workstations have Excel.) Or does anyone have any other suggestion? thanks!
__________________
-CAGdorf |
|
#2
|
|||
|
|||
|
Are you using an ASP script page to create the excel spreadsheet? You can force a script to be executed client-side. Exactly how are you generating the excel spreadsheet?
|
|
#3
|
|||
|
|||
|
'Program Skeleton taken from Microsoft.com Q306022
Dim oExcel As Excel.Application Dim obook As Excel.Workbook Dim osheet As Excel.Worksheet oExcel = New Excel.Application obook = oExcel.Workbooks.Add osheet = obook.Worksheets(1) osheet.Range("A1").Value = "Acct Name" osheet.Range("B1").Value = "Act Number" osheet.Range("C1").Value = "Service Address" osheet.Range("D1").Value = "City" osheet.Range("E1").Value = "Contact" osheet.Range("F1").Value = "Contact Phone" osheet.Range("G1").Value = "Salesman" osheet.Range("H1").Value = "Branch" Dim i As Integer = 2 Dim j As Integer = 1 For i = 2 To tblResults.Rows.Count - 1 For j = 1 To tblResults.Rows(i).Cells.Count - 1 osheet.Cells(i, j) = tblResults.Rows(i).Cells(j).Text Next Next osheet.Rows(1).Font.Bold = True osheet.Columns.AutoFit() Dim Filename As String = "C:\TEST FILE.xls" Dim f As System.IO.File If f.Exists(Filename) Then f.Delete(Filename) End If obook.SaveAs(Filename) osheet = Nothing obook = Nothing oExcel.Quit() oExcel = Nothing GC.Collect() That is my code and it is in index.aspx.vb |
|
#4
|
|||
|
|||
|
Okay, it looks like you are using ASP.net for this application, is that correct? If that is the case, I'm not sure if you can force client side scripting or not. You may want to check on the ASP.net forum to see if it can be done.
|
|
#5
|
|||
|
|||
|
Yeah I am using ASP.NET as part of the Visual Studio.Net platform. Using Visual Basic.Net
|
![]() |
| Viewing: ASP Free Forums > Programming > Visual Basic Programming > VB and Excel |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|