Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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 don't find the way to recall these settings and affect the fonts in the report during runtime.

 

Any help will be usefull.

Tom Rahav.

Posted

To change a text object you can do the following

 

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...