没有边框的novacode docx中的垂直表

时间:2016-06-23 09:50:47

标签: c# asp.net novacode-docx

Heyy我是新手novacode docx webapi我想要打印一个没有边框的垂直类型表,我有这些代码行,通过它我可以打印一个垂直表 我也有屏幕截图,这可能有助于你保存我的问题

private void Document_3_SecondaryDetail(DocX document, string dist, System.Data.DataTable Doc3_SecondaryDetail)
{
    try
    {

        string headlineText = "";
        string paraOne = "";
        var headLineFormat = new Formatting();
        headLineFormat.FontFamily = new System.Drawing.FontFamily("Arial Black");
        headLineFormat.Size = 18D;
        headLineFormat.Position = 12;
        var paraFormat = new Formatting();
        paraFormat.FontFamily = new System.Drawing.FontFamily("Calibri");
        paraFormat.Size = 10D;
        Novacode.Table SecondaryDetailDoc3 = document.AddTable(Doc3_SecondaryDetail.Select("District = '" + dist + "'").Count() + 1, Doc3_SecondaryDetail.Columns.Count);
        SecondaryDetailDoc3.Alignment = Alignment.left;
        SecondaryDetailDoc3.Design = TableDesign.LightGridAccent1;

        int columnNumber = 0;
        foreach (DataColumn columns in Doc3_SecondaryDetail.Columns)
        {
            SecondaryDetailDoc3.Rows[0].Cells[columnNumber].Paragraphs.First().Append(char.ToUpper(columns.ColumnName[0]) + columns.ColumnName.Substring(1).Replace("_", " "));
            columnNumber++;
        }
        int rowIndex = 1;
        foreach (DataRow row in Doc3_SecondaryDetail.Select("District = '" + dist + "'"))
        {
            int colIndex = 0;
            foreach (var item in row.ItemArray)
            {
                SecondaryDetailDoc3.Rows[rowIndex].Cells[colIndex].Paragraphs.First().Append(item.ToString());
                colIndex++;
            }
            rowIndex++;
        }
        document.InsertParagraph(headlineText, false, headLineFormat);
        document.InsertParagraph(paraOne, false, paraFormat);
        document.InsertTable(SecondaryDetailDoc3);
        document.InsertParagraph("");
        document.Save();
    }
    catch (Exception ex)
    {
    }
}    enter code here

但我想要这种类型的结果   enter image description here 我想要没有边框的Verticle样式表 这是当前输入enter image description here 提前致谢

1 个答案:

答案 0 :(得分:4)

将边框颜色设置为白色。

示例:

META-INF/MANIFEST.MF