Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
tom tom is offline
external usenet poster
 
Posts: 570
Default VB.Net app creates report, then downloading to Excel it takes fore


We have: Excel 2003 11.6355.6360 SP1
Studio 2005 8.0.5, .NET Framework 2.0.50727

We have an application in vb.net. It creates a report and then we give them
the option of downloading it to an Excel spreadsheet.
It works fine for a small amount of rows, downloads it within a couple
seconds. They then go out to a certain file share and move/copy their
spreadsheet.

The problem comes when the number of rows exceeds a certain amount, it's
usually at about 500 - 700 records or so, it fluctuates. (They do have the
chance to select how many columns are included in the report.) Any more than
this number, and the download to the spreadsheet runs on and on and on. I've
usually killed it after 30-60 minutes. That's too long, something is wrong
somewhere, I don't know where.

Is there a setting, more code, something I can do to make this download to
Excel take place in a reasonable time.


This is the code in the DevExtract.aspx.vb file.


Private Sub CreateFile()
'REQUIRES: Imports System.IO and Imports DNRLib05.MSOffice2003
Dim oExcel As New DNRLib05.MSOffice2003.clsExcelXML
Dim sServerTempDir As String =
System.Configuration.ConfigurationManager.AppSetti ngs("ServerTempDirectory")
Dim sLocalTempDir As String =
System.Configuration.ConfigurationManager.AppSetti ngs("LocalTempDirectory")
Dim bServerDirExists As Boolean
Dim sServerFileName As String
Dim sFileName As String
bServerDirExists = Directory.Exists(sServerTempDir)
If bServerDirExists Then
sServerFileName = sServerTempDir & "DeviceExtract" & sUser &
".xls"
Else
sServerFileName = sLocalTempDir & "DeviceExtract" & sUser & ".xls"
End If
sFileName = "DeviceExtract" & ".xls"
oExcel.NewSpreadsheet()
...
oExcel.DataSource = ViewState("ReportSQL")
oExcel.DataSourceStartRow = 1
oExcel.DataBind(oDB)
oExcel.Save(sServerFileName)
Response.Redirect("Download.aspx?server_file_name= " &
sServerFileName & "&file_name=" & sFileName)
End Sub



Private Sub CreateReportFile()
Dim oExcel As New DNRLib05.MSOffice2003.clsExcelXML
Dim sServerFileName As String
Dim oDB2 As clsDBMS
Try
sServerFileName = Session("sServerFileName")
oExcel = Session("oExcel")
Session("sServerFileName") = Nothing
Session("oExcel") = Nothing

oExcel.DataSource = ViewState("ReportSQL")
oExcel.DataSourceStartRow = 1
oDB2 = New clsDBMS(True)
oExcel.DataBind(oDB2)
oExcel.Save(sServerFileName)
Session("FileCreated") = "Done"
Catch ex As Exception
lblError.Text = "Error: " & ex.Message
End Try
End Sub
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default VB.Net app creates report, then downloading to Excel it takes fore


I would suggest using VBA button to add code tags for posting code vba
or vb code.

You might try setting the calculation mode to manual and turn off
screen updating. I posted some speedup routines in this link. 'VBA
Express : Excel - Speed Up Code'
(http://vbaexpress.com/kb/getarticle.php?kb_id=1035)


--
Kenneth Hobson
------------------------------------------------------------------------
Kenneth Hobson's Profile: http://www.thecodecage.com/forumz/member.php?userid=413
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=106158

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel Creates .tmp file ld23 Excel Discussion (Misc queries) 1 March 7th 08 12:14 AM
change the fore color jimmy[_5_] Excel Programming 2 March 8th 07 04:38 AM
Automate Excel report to place certain data into existing report? Craig Harrison Excel Worksheet Functions 3 July 25th 06 01:54 PM
FLICKERING...(fore ground font color with flickering).. Eddy Stan Excel Discussion (Misc queries) 5 March 23rd 06 06:20 PM
Downloading / Excel Web?? Maxwell-5000 Excel Discussion (Misc queries) 1 August 18th 05 02:11 AM


All times are GMT +1. The time now is 04:09 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"