We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Deleting worksheets and PrintTitleRows

Thread ID:

Created:

Updated:

Platform:

Replies:

37602 Nov 27,2005 09:09 PM Jan 24,2006 07:42 AM Windows Forms 4
loading
Tags: XlsIO
Hardiyanto Johandoko
Asked On November 27, 2005 09:09 PM

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

Administrator [Syncfusion]
Replied On November 28, 2005 12:33 AM

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

Hardiyanto Johandoko
Replied On November 28, 2005 12:53 AM

Thanks for the prompt reply.

Roderick Prince
Replied On January 23, 2006 02:37 PM

When is a fix expected to address the following? sheet.PageSetup.PrintTitleRows = "$A$1:$IV$2";

Ramu [Syncfusion]
Replied On January 24, 2006 07:42 AM

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.

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;