The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
Hi there,
I''m currently using Syncfusion v. 3.3.0.0 and I found out that deleting worksheets with index greater than 0 will cause an System.ArgumentOutOfRangeException during save. However, the code runs fine on 3.2.1.1. Below is the code to reproduce the error (it''s a modified code from the sample).
IWorkbook myWorkBook = ExcelUtils.CreateWorkbook(7);
IStyle style = myWorkBook.Styles.Add("BigBold",null);
style.Font.Bold = true;
style.Font.Size = 25;
IWorksheet sheet = myWorkBook.Worksheets[0];
sheet.PageSetup.PaperSize = ExcelPaperSize.PaperEnvelopeMonarch;
sheet.Range["E10"].Text = "The Paper Size of this work sheet is EnvelopeMonarch";
sheet.Range["E10"].CellStyleName = "BigBold";
sheet.Range["E10"].RowHeight = 30;
sheet.PageSetup.PrintTitleRows = "$A$1:$IV$1";
IWorksheet sheet1 = myWorkBook.Worksheets[1];
sheet1.PageSetup.PaperSize = ExcelPaperSize.PaperA4;
sheet1.Range["E10"].Text = "The Paper Size of this work sheet is A4";
sheet1.Range["E10"].CellStyleName = "BigBold";
sheet1.Range["E10"].RowHeight = 30;
sheet1.PageSetup.PrintTitleRows = "$A$1:$IV$1";
IWorksheet sheet2 = myWorkBook.Worksheets[2];
sheet2.PageSetup.PaperSize = ExcelPaperSize.PaperB5;
sheet2.Range["E10"].Text = "The Paper Size of this work sheet is B5";
sheet2.Range["E10"].CellStyleName = "BigBold";
sheet2.Range["E10"].RowHeight = 30;
sheet2.PageSetup.PrintTitleRows = "$A$1:$IV$1";
IWorksheet sheet3 = myWorkBook.Worksheets[3];
sheet3.PageSetup.PaperSize = ExcelPaperSize.PaperA4;
sheet3.Range["E10"].Text = "The Paper Size of this work sheet IS A4";
sheet3.Range["E10"].CellStyleName = "BigBold";
sheet3.Range["E10"].RowHeight = 30;
sheet3.PageSetup.PrintTitleRows = "$A$1:$IV$1";
IWorksheet sheet4 = myWorkBook.Worksheets[4];
sheet4.PageSetup.PaperSize = ExcelPaperSize.PaperA4Small;
sheet4.Range["E10"].Text = "The Paper Size of this work sheet is A4";
sheet4.Range["E10"].CellStyleName = "BigBold";
sheet4.Range["E10"].RowHeight = 30;
sheet4.PageSetup.PrintTitleRows = "$A$1:$IV$1";
IWorksheet sheet5 = myWorkBook.Worksheets[5];
sheet5.PageSetup.Orientation = ExcelPageOrientation.Landscape;
sheet5.Range["E10"].Text = "The Paper Orientation of this work sheet Landscape";
sheet5.Range["E10"].CellStyleName = "BigBold";
sheet5.Range["E10"].RowHeight = 30;
sheet5.PageSetup.PrintTitleRows = "$A$1:$IV$1";
IWorksheet sheet6 = myWorkBook.Worksheets[6];
sheet6.PageSetup.Orientation = ExcelPageOrientation.Portrait;
sheet6.Range["E10"].Text = "The Paper Orientation of this work sheet Portrait";
sheet6.Range["E10"].CellStyleName = "BigBold";
sheet6.Range["E10"].RowHeight = 30;
sheet6.PageSetup.PrintTitleRows = "$A$1:$IV$1";
sheet6["A2"].FreezePanes();
myWorkBook.Worksheets.Remove(sheet3);
myWorkBook.SaveAs("Sample.xls");
myWorkBook.Close();
ExcelUtils.ThrowNotSavedOnDestroy = false;
Actually there is another problem which is somewhat related. IWorksheet.PageSetup.PrintTitleRows does not work properly if a worksheet is removed from the workbook. I can''t run it on 3.3.0.0 due to the error above. But in 3.2.1.1, by running the code above, the PrintTitleRows for sheet4, sheet5, and sheet6 (or Sheet5, Sheet6, Sheet7 in Excel) will be blank (File - Page Setup - Sheet - Rows to repeat at top).
Am I missing something here? Please advise.
Thanks in advance,
Hardi
ADAdministrator Syncfusion Team November 28, 2005 05:33 AM UTC
Hi Hardi,
I tested your code using both version 3.3.0.0 and version 3.2.1.1. I was able to see the problem with PrintTitleRows property along with removing of worksheets index greater than 0 and have filed a bug report with the development team
Bug Id: #1108.
This issue will be resolved soon in the next release. The next release is in the first week of december.
Please let me know if you have any questions.
Thanks for your interest with Syncfusion products.
Best Regards,
Seetha
>Hi there,
>
>I''m currently using Syncfusion v. 3.3.0.0 and I found out that deleting worksheets with index greater than 0 will cause an System.ArgumentOutOfRangeException during save. However, the code runs fine on 3.2.1.1. Below is the code to reproduce the error (it''s a modified code from the sample).
>
> IWorkbook myWorkBook = ExcelUtils.CreateWorkbook(7);
>
> IStyle style = myWorkBook.Styles.Add("BigBold",null);
> style.Font.Bold = true;
> style.Font.Size = 25;
>
> IWorksheet sheet = myWorkBook.Worksheets[0];
> sheet.PageSetup.PaperSize = ExcelPaperSize.PaperEnvelopeMonarch;
> sheet.Range["E10"].Text = "The Paper Size of this work sheet is EnvelopeMonarch";
> sheet.Range["E10"].CellStyleName = "BigBold";
> sheet.Range["E10"].RowHeight = 30;
> sheet.PageSetup.PrintTitleRows = "$A$1:$IV$1";
>
> IWorksheet sheet1 = myWorkBook.Worksheets[1];
> sheet1.PageSetup.PaperSize = ExcelPaperSize.PaperA4;
> sheet1.Range["E10"].Text = "The Paper Size of this work sheet is A4";
> sheet1.Range["E10"].CellStyleName = "BigBold";
> sheet1.Range["E10"].RowHeight = 30;
> sheet1.PageSetup.PrintTitleRows = "$A$1:$IV$1";
>
> IWorksheet sheet2 = myWorkBook.Worksheets[2];
> sheet2.PageSetup.PaperSize = ExcelPaperSize.PaperB5;
> sheet2.Range["E10"].Text = "The Paper Size of this work sheet is B5";
> sheet2.Range["E10"].CellStyleName = "BigBold";
> sheet2.Range["E10"].RowHeight = 30;
> sheet2.PageSetup.PrintTitleRows = "$A$1:$IV$1";
>
> IWorksheet sheet3 = myWorkBook.Worksheets[3];
> sheet3.PageSetup.PaperSize = ExcelPaperSize.PaperA4;
> sheet3.Range["E10"].Text = "The Paper Size of this work sheet IS A4";
> sheet3.Range["E10"].CellStyleName = "BigBold";
> sheet3.Range["E10"].RowHeight = 30;
> sheet3.PageSetup.PrintTitleRows = "$A$1:$IV$1";
>
> IWorksheet sheet4 = myWorkBook.Worksheets[4];
> sheet4.PageSetup.PaperSize = ExcelPaperSize.PaperA4Small;
> sheet4.Range["E10"].Text = "The Paper Size of this work sheet is A4";
> sheet4.Range["E10"].CellStyleName = "BigBold";
> sheet4.Range["E10"].RowHeight = 30;
> sheet4.PageSetup.PrintTitleRows = "$A$1:$IV$1";
>
> IWorksheet sheet5 = myWorkBook.Worksheets[5];
> sheet5.PageSetup.Orientation = ExcelPageOrientation.Landscape;
> sheet5.Range["E10"].Text = "The Paper Orientation of this work sheet Landscape";
> sheet5.Range["E10"].CellStyleName = "BigBold";
> sheet5.Range["E10"].RowHeight = 30;
> sheet5.PageSetup.PrintTitleRows = "$A$1:$IV$1";
>
> IWorksheet sheet6 = myWorkBook.Worksheets[6];
> sheet6.PageSetup.Orientation = ExcelPageOrientation.Portrait;
> sheet6.Range["E10"].Text = "The Paper Orientation of this work sheet Portrait";
> sheet6.Range["E10"].CellStyleName = "BigBold";
> sheet6.Range["E10"].RowHeight = 30;
> sheet6.PageSetup.PrintTitleRows = "$A$1:$IV$1";
> sheet6["A2"].FreezePanes();
>
> myWorkBook.Worksheets.Remove(sheet3);
> myWorkBook.SaveAs("Sample.xls");
> myWorkBook.Close();
> ExcelUtils.ThrowNotSavedOnDestroy = false;
>
>Actually there is another problem which is somewhat related. IWorksheet.PageSetup.PrintTitleRows does not work properly if a worksheet is removed from the workbook. I can''t run it on 3.3.0.0 due to the error above. But in 3.2.1.1, by running the code above, the PrintTitleRows for sheet4, sheet5, and sheet6 (or Sheet5, Sheet6, Sheet7 in Excel) will be blank (File - Page Setup - Sheet - Rows to repeat at top).
>
>Am I missing something here? Please advise.
>
>Thanks in advance,
>
>Hardi
HJHardiyanto JohandokoNovember 28, 2005 05:53 AM UTC
Thanks for the prompt reply.
RPRoderick PrinceJanuary 23, 2006 07:37 PM UTC
When is a fix expected to address the following?
sheet.PageSetup.PrintTitleRows = "$A$1:$IV$2";
RARamu Syncfusion Team January 24, 2006 12:42 PM UTC
Hi Roderick,
This Bug Id: #1108 has been fixed and is available in latest version 4.1.
You could download the 4.1 from the following link.
Download
Please let me know if you need any further assistance.
Thanks,
Ramu.