Hello
I am using Aspose Cell GridWeb to create an grid spreadsheet to save to Excel. I am using a data table to input into Aspose Cell as a data source.
If the data table contains small about of records, the Aspose Cell GridWeb generates the grid and shows the save icon. When the data table contains over 50,000 or larger records, the Aspose Cell GridWeb does not come back.
The grid spreadsheet code is as below.What I found with debugging using Visual Studio is the code perform rather fast but once it exist the Page Load, the grid nevers displayed and control is does not come back to internet explore. I get a emply page.
Thank you
Kevin
Imports System
Imports System.Data
Imports System.Configuration
Imports System.Collections
Imports System.Web
Imports System.Web.Security
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports System.Web.UI.WebControls.WebParts
Imports System.Web.UI.HtmlControls
Imports System.Data.OleDb
Imports Aspose.Cells.GridWeb.Data
Imports System.Drawing
Partial Class QueryExcel
Inherits BasePage
Protected Shadows Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim dtQutput As New DataTable
Dim _queryData As New QueryData
Dim queryEnvironment As String = Session("QueryEnvironment")
Dim sqlText As String
If (Not IsPostBack) Then
GridWeb1.WebWorksheets.Clear()
GridWeb1.WebWorksheets.Add()
'set sheets selectedIndex to 0
GridWeb1.WebWorksheets.ActiveSheetIndex = 0
sqlText = Session("QueryExcelSql")
dtQutput.Reset()
dtQutput = _queryData.QueryAsposeCell(queryEnvironment, sqlText)
' Clears datasheets first.
GridWeb1.WebWorksheets.Clear()
GridWeb1.EnableDoubleClickEvent = True
' Imports data from dataview object.
GridWeb1.WebWorksheets.ImportDataView(dtQutput.DefaultView, Nothing, Nothing)
Dim sheet As WebWorksheet = GridWeb1.WebWorksheets(0)
sheet.AutoFitColumns()
sheet.AutoFitRows()
GridWeb1.ShowTabBar = False
GridWeb1.ShowHeaderBar = True
GridWeb1.ShowBottomBar = True
GridWeb1.ShowSaveButton = True
GridWeb1.ShowSubmitButton = False
GridWeb1.ShowUndoButton = False
GridWeb1.EditMode = True
Dim style As New TableItemStyle()
style.HorizontalAlign = HorizontalAlign.Left
style.BorderStyle = BorderStyle.Solid
style.BorderColor = Color.Black
style.BorderWidth = 1
Dim col As Integer = 0
For i As Integer = 1 To GridWeb1.WebWorksheets(0).Cells.MaxRow
For j As Integer = 0 To GridWeb1.WebWorksheets(0).Cells.MaxColumn
Dim cell As WebCell = GridWeb1.WebWorksheets(0).Cells(i, j)
cell.Column.ToString.Trim()
cell.Style.CopyFrom(style)
Next j
Next i
End If
End Sub
Protected Sub GridWeb1_SaveCommand(ByVal sender As Object, ByVal e As System.EventArgs)
' Generates a temporary file name.
Dim filename As String = System.IO.Path.GetTempPath() + Session.SessionID & ".xls"
' Saves to the file.
Me.GridWeb1.WebWorksheets.SaveToExcelFile(filename)
' Sents the file to browser.
Response.ContentType = "application/vnd.ms-excel"
'Adds header.
Response.AddHeader("content-disposition", "attachment; filename=book1.xls")
' Writes file content to the response stream.
Response.WriteFile(filename)
' OK.
Response.End()
End Sub
End Class