Xfiles xcell class styles

I’m using xfiles xcell class to create excel files. I have a style defined that gives me colored background sets font etc. However, we have a written a generic handler for this so, what we have is a row in a queue that contains a styleid, then multiple columns of info.

So, I have for example 1,15,H0,Total|$0|$678|Avg|123

row,column,style,data (pipe delimited columns)

In this case, what I want is H0 is blue background
But, where there is a $ in the data, I want a currency ($#,###.##) format. The problem is, I don’t want to define a H0 and H0$ style because the H0$ is exactly like H0 but with $ for the values.

I tried to do a setcell using Currency with NO DATA
then a setcell to the same cell using H0 style with DATA.

What I get is no $ / currency format back background
If I switch the order, I get the currency format by NO background color.

I noticed that the setstyle has a Parent Parameter. Would that allow me to define my H0 style as I do now with the background color and boxed Then also define a H0$ style that simply has the #,###.00 format with a parent of H0? I’m thinking maybe that will inherit the H0 settings and add the setstyleNumberFormat param to it?

Thanks for any help.

Hi Tim,

Unfortunately your question is a little difficult to parse, and is a bit light on specifics.

I think you’re saying that if you do simply define 2 styles then you get what you want? And you’re just looking for a mechanism to generate the 2 styles automatically from a single row in your style queue?

probably yes.

So, I really shouldn’t try to ask an intelligent question right after getting back from Vacation (aka Holiday).

I have figured it out and, there does need to be some modifications to what code is generated.

What I was trying to do is have two styles defined
H0 which had a background color
H0$ which was the same as H0 but had a NumberFormat defined of #,##0.00
The reason for this is because if I ever made changes to H0 in future, I didn’t want to have to remember to make changes to both

So, the solution IS using the Parent parm for the style defination on the H0$ style

The H0 is defined as
idq:ID = xcelout.SetStyle(‘H0’,‘H0’)
xcelout.SetStyleInterior(idq:Name,0F1BF63H,‘’)
xcelout.SetStyleFont(idq:Name,‘Arial’,‘’,8,‘’,1)
xcelout.SetSTyleBorder(idq:Name,‘Top’,‘Continuous’,1,)
xcelout.SetSTyleBorder(idq:Name,‘Bottom’,‘Continuous’,1,)
xcelout.SetSTyleBorder(idq:Name,‘Left’,‘Continuous’,1,)
xcelout.SetSTyleBorder(idq:Name,‘Right’,‘Continuous’,1,)

and H0$ is defined as
xcelout.setstyle(‘H0$’,‘H0’)
xcelout.SetStyleNumberFormat(‘H0$’,‘$#,##0.00’)

A few things to make note of – AND A CHANGE NEEDED TO XFILES XCELL CLASS.

  • The H0$ (child style that inherits from H0 parent) must NOT have a Name Parm and must have a parent parm which specifies the ID of the parent style. If you have a name parm on the child, it does not work and will not inherit from parent.
  • The child must not define any empty sections. Doing so will cause it to NOT inherit those sections from the parent. So, for example, if I have an empty celout.SetStyleInterior(‘’,‘’) then it will not inherit the interior from the parent (THIS is an issue because the xfiles generates every tag for a style even if it is not being defined. This cause inherientance from a parent to NOT work properly. This needs to be changed.
  • It seems it is OK for the parent to have an empty section i.e. parent can have numberformat even if empty without breaking anything.

Hi Tim,

I’m not able to duplciate this effect. What build of xFiles are you testing with?

Cheers
Bruce

Using Version 4.22

Here is my Clarion Code for creating the Styles that are an issue

  idq:ID = xcelout.SetStyle('T0','T0')
  xcelout.SetStyleInterior('T0',0F1BF63H,'')
  xcelout.SetStyleFont('T0','Arial','',8,'',1)
  xcelout.SetSTyleBorder('T0','Top','Continuous',1,)
  xcelout.SetSTyleBorder('T0','Bottom','Continuous',1,)
  xcelout.SetSTyleBorder('T0','Left','Continuous',1,)
  xcelout.SetSTyleBorder('T0','Right','Continuous',1,)
  
  idq:ID = xcelout.SetStyle('T0$',,'T0')
  xcelout.SetStyleNumberFormat('T0$','$#,##0.00')
  
  idq:ID = xcelout.SetStyle('T0$ND',,'T0')
  xcelout.SetStyleNumberFormat('T0$ND','$#,##0')

I have attached the XML and XLSX that does not work in the sample.zip file. I then modified the xml style defines for the T0$ND to be what it should be and attached that as samplemodified.zip

sample modified.zip (1.8 KB)
file showing that the T0$ and T0$ND have borders, font, interior defined even though I did not define them.

What happens is the my cells that use the T0$ or T0$ND do NOT have an interior color to them
sample.zip (12.0 KB)

Bruce -
After send the info this morning. I upgraded to xfiles 4.38 (the latest) and still have same issues / results.

Bruce - Were you able to confirm the behavior that I reported? Is it something that Capesoft plans to address?

Closing in on a new build. Hoping for Thursday.

Build 4.39 is up.
You’ll also need to update StringTheory and Reflection.

I don’t see that version on capesoft.com I still se 4.38 Also, ST & Reflection don’t show new versions either. I will check back later in the day.

just need the index updating. Done now.

I downloaded all 3 and applied the updates. Now getting compile errors when compiling my data dll. I am using C11.1.13885 and, it seems like maybe the install or template is having issues and thinks it is c12 because, I’m getting about 74 errors and one is “Illegal Data Type: USTRING”

it was the xFiles build. I’ve rebuilt and reuploaded. Same version number.

The number of errors have gone down with the replacement xfiles but, seems like ST might also have issues

ok, sorted it out (I think). I’ve made a new build of all 3, Reflection, xFiles and StringTheory. Grab em all and let me know. Thanks Tim.

Still 4 errors

Actually. Let me check. I don’t think my reflection got updated. Hold a minute.

Bruce - Did you maybe post wrong version of reflection? I downloaded and installed but, in global extensions, it shows v1.32 instead of v1.34. I did the install 3 times to be sure.

looks ok this side, but I’ve re-uploaded, and cleared out the cache (on the server) to be sure.
Make sure you clear the cache on your side, and download Reflection again.

I’m at a loss. I cleared my cache, re-downloaded, re-installed and nothing worked. I did notice that when the install for reflection was running, it said 1.34 but, when I look at it in my globals extensions and in registry settings, it says v 1.32 I then took it a step further, installed fresh c11.1 on a machine that hasn’t had it before, then downloaded the installs from capesoft for Reflection,xf, st and installed those. After installing all 3 of the templates, I registered each one at a time.

My registry shows ST - 3.90 XF - 4.40 REF - 1.32

Hopefully I will get some time to fool with it more because currently, I can NOT get may main apps to compile because of the errors. I even unregistered reflection and re-registered it still no luck