Changing fonts during runtime - Crystal Reports

rahavtom

Well-known member
Joined
Apr 2, 2004
Messages
63
Hello.

I use visual basic .net 2003 and Crystal Reports for creating win-reports.
My question is if there is any possibility to set font properties (type, color and size) of a text control or data field during runtime.
To be more accurate, I know I can set these settings by formula (next to each property in design time), but I would like to let the user choose what font settings he would like to use. I allow the user to set there properties in my application and save it to a database (MDB), but I dont find the way to recall these settings and affect the fonts in the report during runtime.

Any help will be usefull.
Tom Rahav.
 
To change a text object you can do the following

PHP:
private void CrystalReportViewer1_Load(object sender, System.EventArgs e) 
{ 
    crReportDocument = new OpenItem(); 

    TextObject textObject; 
    textObject = crReportDocument.ReportDefinition.ReportObjects["txtRepDate"] as TextObject; 
     
   // You now have the text objects properties available to change i.e.
      
      textObject.Font  = ...

    CrystalReportViewer1.ReportSource = crReportDocument; 
}

I believe for a data field it is FieldObject
 
Back
Top