Set FontStyle of TextObject in Script of report

Hi I am tring to set the Font to Bold of a TextObject in the Fast Reports Script section, thought this would work but it returns a ReadOnly exception when running the report:

if(Blah < = 0)
{
TextObject.Font.Style = FontStyle.Bold;
}

tried this as well: txtChildAsset.Font.Bold = true;

same result

How do I set this textobject to Bold ?

Comments

  • edited 11:03PM
    shanewiso wrote: »
    Hi I am tring to set the Font to Bold of a TextObject in the Fast Reports Script section, thought this would work but it returns a ReadOnly exception when running the report:

    if(Blah < = 0)
    {
    TextObject.Font.Style = FontStyle.Bold;
    }

    tried this as well: txtChildAsset.Font.Bold = true;

    same result

    How do I set this textobject to Bold ?

    Font Object are a little bit strange in .NET you need to recreate the font based on the current font with a new style
    TextObject.Font = new Font(TextObject.Font, FontStyle.Bold);
    

    regards
    Ingo

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.