Click here to Skip to main content
15,911,139 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I'm updating text objects in my Crystal report in the C# code like this,
C#
ReportDocument rptDoc = new ReportDocument();
rptDoc.Load(Environment.CurrentDirectory + @"\Test.rpt");
TextObject txtTest = (TextObject)rptDoc.ReportDefinition.ReportObjects["txtTest"];
txtTest.Text = "Test";

Now I want to bold the text in "txtTest" text object.
I'm looking for something like this,
C#
txtTest.Font.Bold = true;

But unfortunately it is read-only.
Posted
Comments
[no name] 30-Sep-15 2:39am    
Please go through below link:

http://www.aspsnippets.com/Articles/Create-Crystal-Report-with-dynamic-columns-in-ASPNet-using-C-and-VBNet.aspx
Sherantha 30-Sep-15 2:48am    
Thanks for your effort but that article does not contain what I'm looking for.

1 solution

Finally, I have found a solution.
C#
System.Drawing.Font font1 = new System.Drawing.Font("Arial", 12, FontStyle.Bold);
txtTest.ApplyFont(font1);
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900