rahavtom Posted May 19, 2005 Posted May 19, 2005 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. Quote
pendragon Posted May 20, 2005 Posted May 20, 2005 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 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.