Custom Format function

Hi,

I have defined Custom format function, where User can define Font Name and font size
for the report, so I can't predefine the format

Function works well, until cell value is:

<b>Name</b> some other text..<#format cell ....

What I have tried is:
Name some other text..<#html off><#format cell ....
<b>Name</b> some other text..<#preprocess><#format cell ....

What I need to do is change font name and size for the cell with partial bold text value

Hi,

I am not sure we have a solution for this right now, but I think it can be added without too much trouble.
Let me explain the problem in more detail: First of all, both "<b>Name</b> some other text" and "Name some other text" convert to the same internally, so there is no real difference between them. So I'll use the first syntax (with html brackets) as it makes is simple to see it in writing.

The issue here is that if you write "<b>Name</b> some other text" the text stored in the file is not "<b>Name</b> some other text". What gets stored in the file (and the only thing Excel accepts) is:
"<font 6>Name<font 7> some other text" were 
<font 6> might be:
   Arial
   15 points
   bold
   ...

and <font 7> the same without bold. I hope this makes the problem simpler to see. What you have inside the cell is the equivalent of:
"<font arial><size = 15><b>Name</b></size></font><font arial><size = 15>. some other text</size></font> "

If you now format the cell with times new roman 12, the result is:
"<font times new roman><size = 12><font arial><size = 15><b>Name</b></size></font><font arial><size = 15>. some other text</size></font></size></font>"

Even if the cell itself is in times new roman 12, "Name" is still in arial 15, and so is "some other text". This will happen always that you have rich text inside a cell, because there is no way to code the equivalent of <b> in the rich text (that is, this cell has the same format as the cell, but it is also bold). In Excel rich text, you specify all attributes of the font every time it changes, so if you later change the font of the cell, rich text won't change.

The way to fix this would be to have FlexCel do a diff on the formats, and applying only the parts that are different.
So when you set the cell format to times new roman 12, and the cell contains:
<font arial><size = 15><b>Name</b></size></font><font arial><size = 15>. some other text</size></font>
We have to look at the existing format on the cell (say it was arial 15) then look at every font in the rich text, and if it is the same as the old format on the cell, change it to the new format you are setting in the cell. This will give the illusion that the formats in the rich text only apply those attributes which are different from the format on the cell. 

I think this is doable, but might end up being a little tricky: I need to look at it in more detail. The main concern here is to not break any existing code which might rely on the current behavior of rich text, so this would be enabled with some "OnlyApplyDifferentTextProperties" property or something similar. Then we need to make sure it applies when setting the column format, row format, cell format, etc. Again, it is doable, but not completely trivial. I'll see what can be done and let you know when I know more.

Hi,
any progress?
At least its doable or not ?

Hi,

Sorry, we haven't had time to look at it yet. We are just too busy with the FlexCel 7 release which will be hopefully soon. 

I think it is indeed doable, but I can't be 100% sure until I sit down and write some code. But right now we are trying to keep focused in FlexCel 7 so new developments like this one are a little delayed.