• aspose 小记


    /// <summary>
    /// 定位书签替换值
    /// </summary>
    /// <param name="documentBuilder"></param>
    /// <param name="bookMark"></param>
    /// <param name="bookMarkValue"></param>
    public void ExistsBookmark(string bookMark, object bookMarkValue)
    {
    if (bookMarkValue != null)
    {
    if (docBuilder.MoveToBookmark(bookMark))
    {
    docBuilder.Write(bookMarkValue.ToString());

    };

    }


    }

    public void MoveToCellWriteValue(int tableindex, int rowsindex, int cellindex, string Value)
    {
    docBuilder.MoveToCell(tableindex, rowsindex, cellindex, 0);
    docBuilder.Write(Value);
    }

    public void MergeCell(int tableindex, int rowindex)
    {
    for (int j = 0; j < 7; j++)
    {
    docBuilder.MoveToCell(tableindex, rowindex, j, 0);
    docBuilder.CellFormat.HorizontalMerge = Aspose.Words.Tables.CellMerge.Previous;
    }

    }

    public static void MergeCell(Table tb, int startrowid, int endrowid, int startColId, int endColId)
    {
    for (int i = startrowid; i <= endrowid; i++)
    {
    for (int j = startColId + 1; j <= endColId; j++)
    {
    //每行进行横向合并
    HorizontallyMergeCells(tb.Rows[i].Cells[startColId], tb.Rows[i].Cells[j]);
    }
    }

    tb.Rows[startrowid].Cells[startColId].CellFormat.VerticalAlignment = CellVerticalAlignment.Center;
    }

    public static void HorizontallyMergeCells(Cell c1, Cell c2, bool SaveAllVal = false)
    {
    c1.CellFormat.HorizontalMerge = CellMerge.First;

    //Move all content from next cell to previous
    if (SaveAllVal)
    {
    foreach (Node child in c2.ChildNodes)
    c1.AppendChild(child);
    }

    c2.CellFormat.HorizontalMerge = CellMerge.Previous;

    }


    public void insertRows(Table table, int rowindex)
    {
    Row rNs = table.Rows[rowindex].Clone(true) as Row;
    table.InsertAfter(rNs, table.LastRow);

    }

    public ArrayList GetFinalDegreeSort(dynamic sampleInfo, string[] sortlist)
    {
    ArrayList GeneNewOrderArr = new ArrayList();
    ArrayList GeneNewOrderArr1 = new ArrayList();//第一梯队,列出敏感与耐药的基因,按丰度排序
    ArrayList GeneNewOrderArr2 = new ArrayList();//第二梯队,列出可能敏感与可能耐药的基因,按丰度排序
    ArrayList GeneNewOrderArr3 = new ArrayList();//第三梯队,尚不明确的基因,按丰度排序
    ArrayList GeneNewOrderArr4 = new ArrayList();//第三梯队,尚不明确的基因,按丰度排序
    ArrayList GeneNewOrderArr5 = new ArrayList();//第三梯队,尚不明确的基因,按丰度排序
    ArrayList GeneNewOrderArr6 = new ArrayList();//第三梯队,尚不明确的基因,按丰度排序
    foreach (var item in sampleInfo)
    {
    if (item["finaldegree"].Value == sortlist[0].ToString())
    {
    GeneNewOrderArr1.Add(item);
    }
    else if (item["finaldegree"].Value == sortlist[1].ToString())
    {
    GeneNewOrderArr2.Add(item);
    }
    else if (item["finaldegree"].Value == sortlist[2].ToString())
    {
    GeneNewOrderArr3.Add(item);
    }
    else if (item["finaldegree"].Value == sortlist[3].ToString())
    {
    GeneNewOrderArr4.Add(item);
    }
    else
    {
    GeneNewOrderArr5.Add(item);
    }

    }
    GeneNewOrderArr.Add(GeneNewOrderArr1);
    GeneNewOrderArr.Add(GeneNewOrderArr2);
    GeneNewOrderArr.Add(GeneNewOrderArr3);
    GeneNewOrderArr.Add(GeneNewOrderArr4);
    GeneNewOrderArr.Add(GeneNewOrderArr5);
    return GeneNewOrderArr;
    }

  • 相关阅读:
    go笔记 (异或交换两个数字变量需要注意的问题)
    java子线程中获取父线程的threadLocal中的值
    关于java线程池的线程废弃与存活条件分析
    .net实现上传图片到共享目录(远程服务器)
    .net 获取两个时间段中间的日期
    ASP .NET数据写入oracle数据库
    MySql定时插入数据
    Sitecore8.2 .net Solr搜索实现
    .net 盘古分词
    json_3层格式_数据源DataSet
  • 原文地址:https://www.cnblogs.com/xingze/p/10557807.html
Copyright © 2020-2023  润新知