We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Slow loading

Hi,

I am testing Aspose.Grid.Web .

Is there a tutorial where I could find your way
to manage state and fasten loading.

More precisely, Is it possible to store in session the styles which will surely fasten the process.

Thanks

Hi,

Thanks for considering Aspose.

Well, Aspose.Grid.Web is optimized to load/manipulate huge excel files in quick time.

Could you elaborate how do you load data to the sheet? From file or database? How do you set styles for your data in the worksheets. If you set styles for each cell, a lots of TableItemStyle objects will be generated. I suggest to create Grid styles for the grid, use the GridWeb.CustomStyleFileName property, and use the GridWeb Designer to create the style file. And only set styles for the different cells. That will save a lot of memory and enhance the performance.

If you want to use session or viewstate to store the sheet data, you should mantain the sheet's state manually. There are 3 session mode: Session, ViewState and Custom. If you want to edit the grid's content in Custom SessionMode, you should recover the grid's data state in each request before the post data updates the grid. The following is an example of custom session mode using a temp file. The first time the grid loads data, it save its content to an "AGW2" format file. And in the LoadCustomData event, it loads data from the "AGW2" file. And each time the grid's data is updated, it saves the newest content back to the "AGW2" file in the SheetDataUpdated event. So we keep the grid's session state in a temp file, without any cost of Memory.

Here is an example for manually mantain the session:

private void Page_Load(object sender, System.EventArgs e)
{
if (!IsPostBack)
{
GridWeb1.SessionMode = SessionMode.Custom;
// Loads the initial data, from file or database.
GridWeb1.WebWorksheets.ImportExcelFile("d:/misc/test.xls");

// Saves the session data.
GridWeb1.SaveAGW2File("d:/sessiondata/save.agw2");
}
}

private void GridWeb1_SheetDataUpdated(object sender, System.EventArgs e)
{
// Handles the SheetDataUpdated event.
// Saves the session data for each update.
GridWeb1.SaveAGW2File("d:/sessiondata/save.agw2");
}

private void GridWeb1_LoadCustomData(object sender, System.EventArgs e)
{
// Handles the LoadCustomData event.
// Loads the session data.
GridWeb1.LoadAGW2File("d:/sessiondata/save.agw2");
}

If you still find any issue, kindly create a sample test project and post us here with all the files, we will check it soon.

Thank you.

Hi,

I tried your code.
I still can’t load my file, it timeouts before ending.

If styles mean : colors, background color…
We do have a lot of styles.
They are set while creating the Excel files.

If possible, It could be great if we could load our file without any change.
Right now, we are looking for solution to develop a web version of a stand alone
software that’s why it could be great if we could use the same files.

I tried to attach a 4Mb project, but it doesn’t seem to work.
Is this too heavy?


Thanks

Hi,

Could you zip it and post it here, we will check it soon.

Thank you.

Here is my test folder.

Thanks for helping


Hi,

Thanks for providing us the project with the template excel file.

We will check it soon.

Thank you.

Hi,

How is it going on with my sample project ?

Thanks