[英]How to make string bold in wpf
I used Stimulsoft for printing.so I set a string to a column of datatable .My code for set mystring varieble is : 我使用Stimulsoft进行打印。所以我将一个字符串设置为一个数据表列。我的set mystring varieble的代码是:
foreach(var item1 in listpp)
{
KalaClass.KalaTozihat += item1.value + " : " + findPropertyName(item1.propertyID) + "\r";
}
My code for print button is: 我的打印按钮代码是:
private void btnPrint_Click(object sender, RoutedEventArgs e)
{
try
{
DataTable dta = new DataTable();
DataSet1.DtKalaDataTable dt = new DataSet1.DtKalaDataTable();
List<KalaClass> list = MetroDataGrid.ItemsSource as List<KalaClass>;
foreach (var item in list)
{
var row = dt.NewRow();
row["id"] = item.KalaID.ToString();
row["name"] = item.KalaName;
row["tedad"] = item.KalaTedad.ToString();
row["price"] = item.KalaPrice;
row["info"] = item.KalaTozihat;
row["date"] = item.KalaDate;
row["cat"] = item.catName;
row["productCode"] = item.proCode;
row["productCode"] = item.proCode;
row["pic"] = item.Pics;
dt.Rows.Add(row);
}
DataSet ds = new DataSet();
ds.Tables.Add(dt);
StiReport report = new StiReport();
report.Load("Report1.mrt");
report.Dictionary.Clear();
report.RegData("DtKala", ds);
report.Dictionary.Synchronize();
DateTime today = Convert.ToDateTime(DateTime.Today.ToShortDateString());
(report.GetComponentByName("txtDate") as StiText).Text = convertDate.toShamsi(today);
//(report.GetComponentByName("txtName") as StiText).Text = comboBox.SelectionBoxItem.ToString();
//(report.GetComponentByName("Text1") as StiText).Text = txtid.Text;
report.Show();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message.ToString());
}
}
And result is : 结果是:
Now I want to bold findPropertyName(item1.propertyID) .I very googling but I can't find any answer to my question. 现在我想加粗findPropertyName(item1.propertyID) 。我非常谷歌搜索,但我找不到任何问题的答案。 So How can I fix it?
那么我该如何解决呢?
just I enable html tag in reports designer. 我只在报表设计器中启用html标签。 so it fixed.
所以它修好了。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.