CustomFormattings and CheckBox / RadioButton LinkedCell issues

I have an embedded resource (basic excel file - Excel 2003) - that I pull data into and pop files out.

What I find to be happening is that with my Custom Formatting on my spreadsheet isn’t being carried over into the output file. This is especially true as it relates to border properties. I have a conditional format that applies border: none - when condition A is met, otherwise the border is present. What is happening is that the border is now ALWAYS present, and the custom format now does not show it as selected.

Another issue is the LinkedCell data for checkboxes -and- radiobuttons. Dropdowns seem to behave properly, but when I open an excel file all of the checkboxes and radiobuttons in that workbook have their LinkedCell value as null… and if I have the code set a linkedcell to a named range, it won’t save throwing a generic error: invalid cell name.


i should note - this is on 4.4.1

Hi,

Thanks for considering Aspose.

Could you post your template excel file, sample code and output excel file to show both your issues (custom formattings + linked cells related checkboxes and radio buttons). We will check it soon.

Thank you.

I have attached a simple worksheet w/ two named ranges… checkboxes and radio buttons…

I have set the checkboxes to named ranges for linkedcell and addresses (ie: B8) for the radiobuttons… yet the below code:

Workbook wb = new Workbook();
wb.Open(@“C:\Book1.xls”);
foreach(Shape shape in wb.Worksheets[“Sheet1”].Shapes)
{
if (shape is RadioButton) // Can we get a RadioButtons List?!
Debug.WriteLineIf((RadioButton)shape).LinkedCell != null, (RadioButton)shape).LinkedCell);
}
foreach (CheckBox cb in wb.Worksheets[“Sheet1”].CheckBoxes)
{
Debug.WriteLineIf(cb.LinkedCell != null, cb.LinkedCell);
}
wb.Save(@“C:\Book2.xls”);


//
If I have a named range - it will error “Invalid Cell Name” on save…
if I don’t have named range – it still doesn’t save the linkedcell
value… because it doesnt load it!



Also, when I work around this, by forcing the LinkedCell, and then set the value of the cell in question… when I startup - the correct radio button is selected, but the linkedcell doesn’t reflect the correct value… if I inspect it in debug before save… the correct value is in the cell - and the correct radiobutton is checked… but when saved and opened - the cell’s value defaults to 1 (or whatever the default would have been in the “template” [my template is a fully functional excel file – just copying data over] loaded from)

Hi,

Please try the attached version (4.4.1.13). We will support to retrieve linked cell attribute for Radio Buttons in the designer file at run time soon. Currently, retriving linked cells are supported for Checkboxes only. With the attached version, I don't find any problem getting linked cell value for CheckBoxes using your template file and don't find with the output file either as it works fine.

Also, could you elaborate and give us details which custom formattings / conditional formattings (you are talking about) is not working for your file, I don't find any problem at all.

Thank you.

Well, I’ve worked around it so that it conditionally ADDS borders. But, if you have borders by default and conditionally remove them (setting border to none, or color: white [to match the bg]) then it doesn’t copy that border formatting over… and it persists in this one.

I didn’t check that my example was setup this way - but it is the behaviour I experience in my development application. There is another problem with conditionalformatting and font-weight, which I will research a bit more to correctly state the problem.

Hi,

Could you post your sample test code and template excel file to show the conditional formattings issue related borders and font-weight here, it will help us really to reproduce the issue and then to figure it out soon.

Thank you.