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.
Hello, I''m having an issue where we create an IWorkbook from a template (xlt) using the following code:
-----
public static IWorkbook CreateNewWorkbook()
{
RegistryKey key = Registry.CurrentUser.OpenSubKey( @"SOFTWARE\TAG" );
string reportTemplate = key.GetValue( "Report Template" ).ToString();
return CreateNewWorkbook( reportTemplate );
}
....
IWorksheet sheet = workBook.Worksheets[ 0 ];
sheet.Range[ 1, 1, 1, 5 ].Text = "Column";
sheet.Range[ 1, 1, 1, 5 ].CellStyleName = "ColumnHeader";
-----
This template has pre-made styles in it. My issue is that if that style is not actively used in a cell when the template is loaded, the following error occurs when trying to assign that pre-made style to a cell. "Style with specified name does not exists. Name: ColumnHeader".
If I assign cell A1 the style ColumnHeader inside the template file and then do this, all is well. It seems that when the IWorkbook is created, it only loads those styles that are actively being used.
I tried to attach the Excel template but it seems the file attachment form is not working. I will be more than happy to email the template if an address is provided.
Any comments would be appreciated.
Thanks!
ADAdministrator Syncfusion Team February 9, 2005 02:40 PM UTC
Hi Shannon,
Please send the file to stephenj @ syncfusion.com
Thanks,
Stephen.
>Hello, I''m having an issue where we create an IWorkbook from a template (xlt) using the following code:
>-----
> public static IWorkbook CreateNewWorkbook()
> {
> RegistryKey key = Registry.CurrentUser.OpenSubKey( @"SOFTWARE\TAG" );
>
> string reportTemplate = key.GetValue( "Report Template" ).ToString();
>
> return CreateNewWorkbook( reportTemplate );
> }
>....
>
> IWorksheet sheet = workBook.Worksheets[ 0 ];
> sheet.Range[ 1, 1, 1, 5 ].Text = "Column";
> sheet.Range[ 1, 1, 1, 5 ].CellStyleName = "ColumnHeader";
>
>-----
>This template has pre-made styles in it. My issue is that if that style is not actively used in a cell when the template is loaded, the following error occurs when trying to assign that pre-made style to a cell. "Style with specified name does not exists. Name: ColumnHeader".
>
>If I assign cell A1 the style ColumnHeader inside the template file and then do this, all is well. It seems that when the IWorkbook is created, it only loads those styles that are actively being used.
>
>I tried to attach the Excel template but it seems the file attachment form is not working. I will be more than happy to email the template if an address is provided.
>
>Any comments would be appreciated.
>Thanks!
>