Load xlsx with GridWeb

Hi,

I created xlsx file using Aspose.Cell.

I can't to open with GridWeb.

See sample project.

Thank you

Hi,

Thanks for the project.

I can find an issue as you have mentioned. It takes lot of time to load the file into the GridWeb. I waited and waited and finally have to close the process. A ticket is added into our issue tracking system with an id:CELLSNET-40666. We have also linked the issue with the thread.

Once we have any update, we will let you know here.

Thank you.

Hi,

We have tested the file and find that there are many many columns (from column 0 to XFD), for the whole worksheet(Conferência PRL), there is about 160*16384=2621440 cells , these are too many cells to load, so for your excel file, we thought two ways :

1. Change your excel file by change the max column (XFD) to “S”, this way most of the blank columns will be removed and the modified file should then load quickly

2. Please supply to us code showing us how did you create excel file by Aspose.Cells, so we could check the source and advise you another solution for creating such an excel file.

Hi,

I'm using Smark Markers and after Process, I copy all rows to destination workbook.

I finded the error. The method CopyRows() is generated many columns.

See attachment.

Thank you.

Hi,

Thanks for your files and the image.

We have logged your comment in our database against the issue id: CELLSNET-40666

We will look into it and get back to you asap.

Hi,


Instead of using copy rows, please use the following line of code. This will copy the whole worksheet at once without adding any extra columns and the file will load quickly as well.

wbResult.Worksheets[0].Copy(wbSource.Worksheets[0]);

Thanks for using Aspose.Cells


Hi,

I can't use Worksheets.Copy because I want to copy several worksheet to only worksheet. If I use Worksheets.Copy, I will override the rows.

Any other suggestions?

Thank you.

Hi,

I have written the following code to illustrate how you can utilize Range.Copy() method to copy all of your worksheets into a single sheet inside a destination workbook.

I have attached both the source.xlsx and output xlsx file generated by the following code.

Please also see the screenshot for your reference.

As you, the code has copied all the worksheets data into a single worksheet inside output.xlsx.

Please download and use the latest version:
Aspose.Cells
for .NET v7.2.0.8



C#



string filePath = @“F:\Shak-Data-RW\Downloads\source.xlsx”;


Workbook workbook = new Workbook(filePath);


Workbook destWorkbook = new Workbook();


Worksheet destSheet = destWorkbook.Worksheets[0];



int TotalRowCount = 0;



for (int i = 0; i < workbook.Worksheets.Count; i++)

{

Worksheet sourceSheet = workbook.Worksheets[i];


Range sourceRange = sourceSheet.Cells.MaxDisplayRange;


Range destRange = destSheet.Cells.CreateRange(sourceRange.FirstRow + TotalRowCount, sourceRange.FirstColumn,

sourceRange.RowCount, sourceRange.ColumnCount);


destRange.Copy(sourceRange);


TotalRowCount = sourceRange.RowCount + TotalRowCount;

}


destWorkbook.Save(“output.xlsx”);



Screenshot:

worked fine!

thank you very much.

Hi,

You are welcome.

I have also added this example code inside the documentation. Please refer to the article.

Combine Multiple Worksheets into a Single Worksheet