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. Image for the cookie policy date

CodeName Property has no effect, FreezePanes causes error

Hello!

Issue 01:
I'm want to set the code name of a worksheet by using the CodeName-Property of the Syncfusion.XlsIO.IWorkSheet object.
But when i look in excel the code name wasn't set. Only by the default name "Tabelle1".

Issue 02:
When i use the FreezePanes-Property of Syncfusion.XlsIO.IRange object an error occurs when i open the .xls file. (See image attachment). When i confirm the error message box the .xls file opens and it seems to be a valid file.

Thx for you efforts

Error48.zip

9 Replies

AD Administrator Syncfusion Team October 25, 2006 11:55 AM UTC

Update Issue 02:
i used
m_obj_WorkSheet.Cell(10, 1).FreezePanes()

when i use
m_obj_WorkSheet.Cell(10, 2).FreezePanes()
it works


AD Administrator Syncfusion Team October 25, 2006 01:06 PM UTC

Issue 03:
I have a style problem:
I set a style (CellStyleName-Prop) with a background color on a complete row of a worksheet.
Then i set a style on a single cell of that row to change the font only, but the cell loose its background color.

I want that the cell inherits its style (background color) from the row. Is that possible??

In Excel it works.


MW Melba Winshia Syncfusion Team October 25, 2006 02:06 PM UTC

Hi Marcus,

1) I am afraid. I was unable to reproduce the issue regarding CodeName property. I used the following test sample to test your issue.

Sample:

Code_Name.zip


Would it be possible to provide me your sample file in which you are able to reproduce the issue? It will help me in investigating further on this issue.

2) I am afraid. I was unable to reproduce the issue regarding Freeze pane property.. I used the following test sample to test your issue.

Sample:

Freeze panes.zip


Please take a look at the sample above and let me know if you still find with problem, if yes could you please modify the sample. This would help me in investigating further on this issue.

3) I am afraid. I was unable to reproduce the issue regarding CellStyleName property. I used the following test sample to test your issue.

Sample:

Styles.zip


Please take a look at the sample above and let me know if you still find with problem, if yes could you please modify the sample. This would help me in investigating further on this issue.

Thanks,
Melba


AD Administrator Syncfusion Team October 26, 2006 08:19 AM UTC

Hi Melba,

thanks for your fast support.

I tried out your samples.
1:
In your CodeName sample i can't open the xls file!?
2:
Your FreezePanes sample works.
3:
Unfortunately i can't download the style.zip file

I attached you some files.
I hope it will help you...

For your Info:
Our Excel Version: MS Excel 2000 (9.0.6926 SP-3)
Our XlsIO Version: 4.2.0.37
(But we will update to version 4.3.0.30)

Thanks
Marcus

SyncFusion29.zip


MW Melba Winshia Syncfusion Team October 26, 2006 12:13 PM UTC

Hi Marcus,

1) I was able to reproduce the problem. I have created a bug report regarding this issue; you can track the status of this issue from the following link:

http://www.syncfusion.com/support/issues/xlsio/Default.aspx?ToDo=view&questId=2909

We will try to address this issue as soon as possible. Sorry for the inconvenience.

2) Glad to hear that sample works fine.

3)Sorry for the broken link. Here is the sample for your reference regarding CellStyleName Property.

Styles.zip


Please take a look at the sample above and let me know if you still find with problem, if yes could you please modify the sample. This would help me in investigating further on this issue.

Thanks,
Melba



AD Administrator Syncfusion Team October 27, 2006 03:28 PM UTC

Hello Melba,

can you appreciate till when you solve the problem with the CodeName?? It's very important for us!! ;-(

Your style example works, but i tried something different. I tried this:
IStyle myRowStyle, myCellStyle;

myRowStyle = workbook.Styles.Add("MyRowStyle");
myRowStyle.ColorIndex = ExcelKnownColors.Magenta;

myCellStyle = workbook.Styles.Add("MyCellStyle");
myCellStyle.Font.FontName = "Arial Black";

sheet.Range["A15"].EntireRow.CellStyleName = "MyRowStyle";
sheet.Range["B15"].CellStyleName = "MyCellStyle";
sheet.Range["B15"].Text = "Bold text with(out) background color";

In this case the cell style overrides the background color of the row style. But i want that only the style properties i set have an effect on the cell. In this case the font style.

I attached an .xls file with an example how it works with format templates in excel.
I hope it will help you.

Thanks for your efforts
Marcus


Styles0.zip


AD Administrator Syncfusion Team October 27, 2006 03:45 PM UTC

One more example to explain why i need such curious things... :-)

In the .xls file i have rows with an alternating background color. Some cells must have a special style. e. g. for number, text, date or something else. But i don't want to create every style twice only because of changing the background color.

Do you know what i mean!? ;-)

Thx and have a nice weekend
Marcus


Mappe1.zip


MW Melba Winshia Syncfusion Team October 30, 2006 10:38 AM UTC

Hi Marcus,

I was able to reproduce the issue. I have created a bug report regarding this issue; you can track the status of this issue from the following link:

http://www.syncfusion.com/support/issues/xlsio/Default.aspx?ToDo=view&questId=2932

We will try to address this issue as soon as possible. Sorry for the inconvenience.

Thanks,
Melba


MW Melba Winshia Syncfusion Team November 15, 2006 02:02 PM UTC

Hi Marcus,

Regarding sheet.CodeName property:

1) I consulted with the development team regarding sheet.CodeName property. The sheet.CodeName property is read-only and you can not change the code name while the template file contains VBA/macro. Sorry for the inconvenience and also we have made sheet.CodeName property as read only.

Regarding cell style:

2) I consulted with the development team regarding cell style property. First of all when you set CellStyleName for Entire Row it means that you set CellStyleName for each cell of the range. And setting CellStyleName it is the same as you have set style name in the Format \ Style dialog (not Format Cell in the context menu)

1) Create one named style that has Magenta color

myRowStyle = workbook.Styles.Add("MyRowStyle");

myRowStyle.ColorIndex = ExcelKnownColors.Magenta;

2) Create second style that has Arial Black font and white (default) back color

myCellStyle = workbook.Styles.Add("MyCellStyle");

myCellStyle.Font.FontName = "Arial Black";

3) Then you set named style (MyRowStyle) for each cell in the row (256 cells) and override this setting for one cell. So that one cell will have its own style

sheet.Range["A15"].EntireRow.CellStyleName = "MyRowStyle";

sheet.Range["B15"].CellStyleName = "MyCellStyle";

sheet.Range["B15"].Text = "Bold text with(out) background color";

So In XlsIO everything works correct.

If you want to set default style for the whole row then you better use IWorksheet.SetDefaultRowStyle (setting throgh EntireRow is also possible)

Also if you want your original style setting to remain, then you have to use IRange.CellStyle object and modify all desired settings, since MS Excel and XlsIO have very simply style hierarchy Named style (is parent, accessed through Format \ Style.. dialog and IRange.CellStyleName property) and child style that has some settings different from parent (accessible through Format cells... dialog and IRange.CellStyle property).

Please take a look and let me know if you have any other questions.

Thanks,
Melba



Loader.
Live Chat Icon For mobile
Up arrow icon