如何显示大胆? [英] how to display bold?
本文介绍了如何显示大胆?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想在excel表格中以粗体显示输出标题字符串。如何做?下面是我的代码
I want to display the output header string in bold in excel sheet..how to do it? below is my code
WorksheetRow[] row = new WorksheetRow[Rep.Tables[0].Rows.Count];
WorksheetRow[] rowz = new WorksheetRow[3000];
for (int i = 0; i < Rep.Tables[0].Rows.Count; i++)
{
string str = "", s = "Monthly Modeling";
str=dt.Rows[i][0].ToString();
row[i] = sheet.Table.Rows.Add();
if (str != emp)
{
rowz[i] = sheet.Table.Rows.Add();
rowz[i].Cells.Add(s + str );//This will be displayed in excel,how to make it Bold???
row[i] = sheet.Table.Rows.Add();
}
推荐答案
你试过这样的事吗?
Have you tried something like this?
rowz[i].Cells.Font.Bold = true;
excel.Worksheet wsht;
wsht.Cells[i, j].Font.Bold=true;
希望这能帮到你
Hope this will help you
这篇关于如何显示大胆?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文