2015-09-30 116 views
0

我更新的文本對象,在這樣的C#代碼我的Crystal報表,集水晶報表使用C#

ReportDocument rptDoc = new ReportDocument(); 
rptDoc.Load(Environment.CurrentDirectory + @"\Test.rpt"); 
TextObject txtTest = (TextObject)rptDoc.ReportDefinition.ReportObjects["txtTest"]; 
txtTest.Text = "Test"; 

現在我想大膽「txtTest」文本對象的文本textobject在運行時大膽。

我正在尋找這樣的事情,

txtTest.Font.Bold = true; 

但不幸的是它是隻讀的。

回答

0

最後,我找到了一個解決方案。

System.Drawing.Font font1 = new System.Drawing.Font("Arial", 12, FontStyle.Bold); 
txtTest.ApplyFont(font1);