通过代码对excelsheet表中的数据进行过滤后,如何取得过滤后显示的数据行数的第一行的行号???急!在线等!

解决方案 »

  1.   

    过滤的时候总要遍历sheet表每一行吧
    存下来就行了
      

  2.   

      if (titleColobj.Count() > 0)
                    {
                        titleColobj.Add(new TitleColObj(Globalconf.col_result_name, -1, colnum - 1));
                        //titleString[titleString.Length - 1] = Globalconf.col_result_name;
                        String tColStr = "";
                        int newTitleColCount = titleColobj.Count();
                        for (int c = 0; c < newTitleColCount; c++)
                        {
                            tColStr = titleColobj[c].title + "";
                            xSheet.Cells[1, c + 1] = tColStr;
                            if (tColStr == "产品名称")
                            {
                                xSheet.get_Range((Excel.Range)xSheet.Cells[1, 1], (Excel.Range)xSheet.Cells[1, newTitleColCount]).AutoFilter(c + 1, "<>", Excel.XlAutoFilterOperator.xlFilterValues, Missing.Value, true);//实现过滤空白
                                
                            }
                                                }
    这是我的过滤代码