Hi, I am trying to change font size of an object attribute within the model, but whenever I do so, the font size is changed of all object attributes I have in the model. Here is what I do:
model.TextOccList()[0].AttrOcc(1).SetPortOptions(Constants.ATTROCC_PORT_FREE, 4) FF = model.TextOccList()[0].AttrOcc(1).FontStyleSheet() FF.Font(1049).setSize(16) model.TextOccList()[0].AttrOcc(1).setFontStyleSheet(FF)
so, the above code works, but it changes the font size of all attributes, so I thought I would try to overwrite the font size of the specific attributes that need to have different font. So, later in the code I put this, but it doesn't have any effect at all.
kpiArray[r].AttrOcc(9).SetPortOptions(Constants.ATTROCC_CENTER, 4) kpiArray[r].AttrOcc(9).setAlignment(Constants.ATTROCC_ALIGN_LEFT) FF2 = kpiArray[r].AttrOcc(9).FontStyleSheet() FF2.Font(1049).setSize(10) model.TextOccList()[0].AttrOcc(1).setFontStyleSheet(FF2)
Has anyone do anything similiar to this before? Please share ideas...
Hi Di,
The fontstylesheets are maintained at database level, so by default the default font style is applied to all attributes. So if you collect the fontstyle in variable from an attribute and modify it, it will be modified for all the attributes using it.
You need to create a new fontstylesheet and apply it to the attribute occurrences.Check the method Database.createFontStyle()
Regards,
Amol Patil
Hi,
I wrote a report that creates a new model,
Now I want to add to this model a new header fragment, the fragment will consist the model name and another attribute.
I managed to create a text object with this information but it's not an attribute Occurence - the implications is that when the name of the model changes from the original name the text in the header fragment remain the same.
So is it possible to create attr occ in a model?
Thank you very much in advance
Gilad
Hello Amol ,
i tried with this below code for make the font size , but i cant able to change the size of the font and font .Can you please tell me how to make a header font size only .?
model.TextOccList()[0].AttrOcc(1).SetPortOptions(Constants.ATTROCC_PORT_FREE, 4);
model.TextOccList()[0].AttrOcc(1).FontStyleSheet();
FF.Font(1049).setSize(40);
model.TextOccList()[0].AttrOcc(1).setFontStyleSheet(FF);
Thank you so much in advance .