set formating parameters from code

Hello,

how can i programticly set the values of format the currency etc.. in one place before the report start, is there an envorinment setting for that ?
or should i go to , every text object control and set it from there , the second solution is very annoying

Thanks in advance

Comments

  • mohanarajmohanaraj 600001
    edited 8:17AM
    Hello,

    You can do this by program use this code

    FastReport.Format.NumberFormat format = new FastReport.Format.NumberFormat();
    format.UseLocale = false;
    format.DecimalDigits = 2;
    format.DecimalSeparator = ".";
    format.GroupSeparator = ",";

    and following that

    textObject.Formats.Clear();
    textObject.Formats.Add(format);


    Happy coding...
  • edited 8:17AM
    thank you mohanaraj, so i have to set it in every text object individually [img]style_emoticons/<#EMO_DIR#>/sad.gif" style="vertical-align:middle" emoid=":(" border="0" alt="sad.gif" /> , that was what i was afraid of is there any other cenrtal way to set it, FastReport.Format.GeneralFormat , what this think do, anyone have any idea?[/img]
  • edited 8:17AM
    Hello,

    There is no global settings for formatting. You can change the current thread's globals, but this is not a good idea.
  • edited 8:17AM
    Yes you are right it is not a good idea, so only solution is; before report started to run i have to loop all text object and set their format value inside of my code

    thanks

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.