小编siv*_*iva的帖子

使用EPPlus我想在电子表格中将所有单元格格式化为TEXT

我想在将数据表加载数据表之前将电子表格的所有单元格格式化为文本.这是我正在使用的示例代码

StringBuilder sbitems = new StringBuilder();
sbitems.Append(@"select * from Items");
SqlDataAdapter daitems = null;
DataSet dsitems = null;

daitems = new SqlDataAdapter(sbitems.ToString(), constate);
daitems.SelectCommand.CommandTimeout = 0;
dsitems = new DataSet("Items");
daitems.Fill(dsitems);

app.Workbook.Worksheets.Add("Items").Cells["A1"].LoadFromDataTable(dsitems.Tables[0], true);
Excel.ExcelWorksheet worksheet2 = workBook.Worksheets["Items"];
using (var rngitems = worksheet2.Cells["A1:BH1"])//Giving colour to header
{
    rngitems.Style.Font.Bold = true;
    rngitems.Style.Fill.PatternType = ExcelFillStyle.Solid;
    rngitems.Style.Fill.BackgroundColor.SetColor(Color.Yellow);
    rngitems.Style.Font.Size = 11;
    rngitems.AutoFitColumns();
}

worksheet2.Cells["A1:BH1"].AutoFitColumns();
worksheet2.Cells["A1:BH1"].Style.Font.Bold = true;

app.SaveAs(new System.IO.FileInfo(@"D:\ItemsData\testfileexcelnew.xlsx"));
Run Code Online (Sandbox Code Playgroud)

c# excel epplus

8
推荐指数
1
解决办法
1万
查看次数

如何使用acrofields创建模板PDF文件?

我需要使用acrofields创建一个新的模板PDF文件.用数据库中的数据替换它们并将其作为PDF保存在新文件中.我发现它可以使用itextsharp实现.但我无法找到如何使用acrofields创建模板PDF文件?找到一个更好的方法!

c# pdf itext acrofields

7
推荐指数
1
解决办法
9782
查看次数

使用注册表检测安装的 MS Office 是 32 位还是 64 位

我想安装基于excel版本(32位或64位)的vsto插件。我计划捆绑 32 位和 64 位 msis 并通过确定 excel 版本来安装一个。我可以找到这个链接,通过使用注册表来检测 2010 office 是 32 位还是 64 位。 通过注册表检测 Office 是 32 位还是 64 位 但我想检查 excel 2007 和 2013 是 32 位还是 64 位。是否可以通过注册表检测它们。

registry vsto add-in wix ms-office

3
推荐指数
1
解决办法
7263
查看次数

标签 统计

c# ×2

acrofields ×1

add-in ×1

epplus ×1

excel ×1

itext ×1

ms-office ×1

pdf ×1

registry ×1

vsto ×1

wix ×1