SunQuest
 
           Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
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  
Old June 29th, 2004, 10:46 AM
cagdorf cagdorf is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Posts: 63 cagdorf User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 7 m 37 sec
Reputation Power: 5
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

Reply With Quote
  #2  
Old June 29th, 2004, 11:00 AM
spak111 spak111 is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 349 spak111 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 29 m 25 sec
Reputation Power: 5
Send a message via AIM to spak111
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?

Reply With Quote
  #3  
Old June 29th, 2004, 11:04 AM
cagdorf cagdorf is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Posts: 63 cagdorf User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 7 m 37 sec
Reputation Power: 5
'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

Reply With Quote
  #4  
Old June 29th, 2004, 11:13 AM
spak111 spak111 is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 349 spak111 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 29 m 25 sec
Reputation Power: 5
Send a message via AIM to spak111
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.

Reply With Quote
  #5  
Old June 29th, 2004, 11:19 AM
cagdorf cagdorf is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Posts: 63 cagdorf User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 7 m 37 sec
Reputation Power: 5
Yeah I am using ASP.NET as part of the Visual Studio.Net platform. Using Visual Basic.Net

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingVisual Basic Programming > VB and Excel


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway