当前位置: 首页>>代码示例>>C#>>正文


C# ExcelAccess.DeleteSheet方法代码示例

本文整理汇总了C#中ExcelAccess.DeleteSheet方法的典型用法代码示例。如果您正苦于以下问题:C# ExcelAccess.DeleteSheet方法的具体用法?C# ExcelAccess.DeleteSheet怎么用?C# ExcelAccess.DeleteSheet使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ExcelAccess的用法示例。


在下文中一共展示了ExcelAccess.DeleteSheet方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ExportExcel

 /// <summary>
 /// 文档格式预定义好的,只填写内容
 /// </summary>
 /// <param name="obj"></param>
 public void ExportExcel(IList<PJ_clcrkd> datalist)
 {
     //lgm
     ExcelAccess ex = new ExcelAccess();
     SaveFileDialog saveFileDialog1 = new SaveFileDialog();
     string fname = Application.StartupPath + "\\00记录模板\\生产台账.xls";
     ex.Open(fname);
     ExportExcel(ex, datalist, "生产物资管理生产台账");
     
     ex.DeleteSheet(1);
     ex.ShowExcel();
    
 }
开发者ID:s7loves,项目名称:mypowerscgl,代码行数:17,代码来源:ExportSCTZEdit.cs

示例2: ExportExcelProjectCKD

        /// <summary>
        /// 文档格式预定义好的,只填写内容
        /// </summary>
        /// <param name="obj"></param>
        public void ExportExcelProjectCKD(string orgid, string strProject, string strfenProject)
        {
            ////lgm
            ExcelAccess ex = new ExcelAccess();
            SaveFileDialog saveFileDialog1 = new SaveFileDialog();
            string fname = Application.StartupPath + "\\00记录模板\\出库单.xls";
            ex.Open(fname);
            bool isadd = false;
            string strfirst = "";
            string filter = "";
            string filter2 = "";
            string filter3 = "";
            string filter4 = "";
            if (strProject != "全部")
                filter2 = "  where 1=1 and ssgc='" + strProject + "'  and type = '撤旧材料出库单' ";
            else
                filter2 = "  where 1=1  and type = '撤旧材料出库单' ";

            IList mclist = ClientHelper.PlatformSqlMap.GetList("SelectOneStr", "select distinct ssgc  from PJ_clcrkd " + filter2 + " order by ssgc");

            foreach (string mc in mclist)
            {
                if (strfenProject == "全部")
                    filter3 = "  where 1=1 and type = '撤旧材料出库单' ";
                else
                    filter3 = "  where  ssxm='" + strfenProject + "'  and type = '撤旧材料出库单' ";

                IList xmlist = ClientHelper.PlatformSqlMap.GetList("SelectOneStr", "select distinct ssxm  from PJ_clcrkd " + filter3 + " order by ssxm");
                foreach (string xm in xmlist)
                {
                    filter4 = "  where 1=1 and type = '撤旧材料出库单'"
                        + "  and ssgc='" + mc + "' "
                        + "  and ssxm='" + xm + "' ";
                    //IList sjlist = ClientHelper.PlatformSqlMap.GetList("SelectOneStr", "select distinct CONVERT(varchar(50) ,indate, 112 )  from PJ_clcrkd " + filter4 + " ");

                    IList sjlist = ClientHelper.PlatformSqlMap.GetList("SelectOneStr", "select distinct num  from PJ_clcrkd " + filter4 + " ");
                    foreach (string sj in sjlist)
                    {
                        filter = "  where 1=1 and type = '撤旧材料出库单'"
                        + "  and ssgc='" + mc + "' "
                        + "  and ssxm='" + xm
                        + "' and num= '" + sj + "' ";
                        if (isWorkflowCall)
                        {

                            filter = filter + " and id not in (select ModleRecordID from WF_ModleRecordWorkTaskIns where  WorkFlowId='"
                                + WorkFlowData.Rows[0]["WorkFlowId"].ToString() + "') "
                                    + " or id in  (select ModleRecordID from WF_ModleRecordWorkTaskIns where "
                                + "    RecordID='" + currRecord.ID + "') "
                                ;
                        }

                        IList<PJ_clcrkd> datalist = Client.ClientHelper.PlatformSqlMap.GetListByWhere<PJ_clcrkd>(
                         filter
                           );
                        if (datalist.Count > 0) isadd = true;
                        ExportExcel(ex, datalist);
                    }
                }

            }


            if (isadd)
            ex.DeleteSheet(1);
            ex.ShowExcel();
        }
开发者ID:s7loves,项目名称:mypowerscgl,代码行数:71,代码来源:ExportCJCLCKEdit.cs

示例3: ExportExcelProjectCKD

        public void ExportExcelProjectCKD(string orgid, string strnum)
        {
            ////lgm
            ExcelAccess ex = new ExcelAccess();
            SaveFileDialog saveFileDialog1 = new SaveFileDialog();
            string fname = Application.StartupPath + "\\00记录模板\\局安全工器具入库单.xls";
            ex.Open(fname);
            string filter = "";
            if (strnum != "全部")
                filter = "  where 1=1 and num='" + strnum + "'  and type = '局安全工器具入库单' ";
            else
                filter = "  where 1=1  and type = '局安全工器具入库单' ";
            if (isWorkflowCall)
            {

                filter = filter + " and id not in (select ModleRecordID from WF_ModleRecordWorkTaskIns where  WorkFlowId='"
                    + WorkFlowData.Rows[0]["WorkFlowId"].ToString() + "') "
                        + " or id in  (select ModleRecordID from WF_ModleRecordWorkTaskIns where "
                    + "    RecordID='" + currRecord.ID + "') "
                    ;
            }
            IList<PJ_anqgjcrkd> datalist = Client.ClientHelper.PlatformSqlMap.GetListByWhere<PJ_anqgjcrkd>(
                          filter
                            );
           ExportExcel(ex, datalist);

           try
           {
               ex.DeleteSheet(1);
           }
           catch { }
            ex.ShowExcel();
        }
开发者ID:s7loves,项目名称:mypowerscgl,代码行数:33,代码来源:ExportAQGJSRKEdit.cs

示例4: ExportExcel

 /// <summary>
 /// 文档格式预定义好的,只填写内容
 /// </summary>
 /// <param name="obj"></param>
 public  void ExportExcel(string orgid)
 {
     //lgm
     ExcelAccess ex = new ExcelAccess();
     SaveFileDialog saveFileDialog1 = new SaveFileDialog();
     string fname = Application.StartupPath + "\\00记录模板\\线路设备责任区划分明白表.xls";
     ex.Open(fname);
     string sdtrorg=" ";
     if (orgid != "")
     {
         
         sdtrorg += "  and OrgCode='" + orgid + "'";
     }
     bool iszero = true;
     IList mclist = ClientHelper.PlatformSqlMap.GetList("SelectOneStr", "select distinct zrr  from PJ_xlsbzrqhfmbb where  1=1 " + sdtrorg);
     foreach (string mc in mclist)
     {
         string str = " where 1=1 and zrr='"+mc+"' ";
         if (orgid != "")
         {
             str += "  and OrgCode='" + orgid + "' ";
         }
         if (isWorkflowCall)
         {
             str = str + " and ( id in  (select ModleRecordID from WF_ModleRecordWorkTaskIns where "
                 + "    RecordID='" + currRecord.ID + "')) "
                 ;
         }
         IList<PJ_xlsbzrqhfmbb> datalist = Client.ClientHelper.PlatformSqlMap.GetListByWhere<PJ_xlsbzrqhfmbb>(
            str
             );
         if (datalist.Count > 0)
         {
             iszero = false;
             ExportExcel(ex, datalist, mc);
         }
     }
     if (!iszero) ex.DeleteSheet(1);
     ex.ShowExcel();
    
 }
开发者ID:s7loves,项目名称:mypowerscgl,代码行数:45,代码来源:ExportXLSBZRQHFMXB.cs

示例5: ExportExcelSubmit

        public void ExportExcelSubmit(ref LP_Temple parentTemple,  string orgid, bool isShow)
        {
            DSOFramerControl dsoFramerWordControl1 = new DSOFramerControl();
            string fname = Application.StartupPath + "\\00记录模板\\线路设备责任区划分明白表.xls";
            dsoFramerWordControl1.FileOpen(fname);
            
        
            if (parentTemple == null)
            {
                parentTemple = new LP_Temple();
                parentTemple.Status = "文档生成";
            }
            parentTemple.DocContent = dsoFramerWordControl1.FileDataGzip;
            dsoFramerWordControl1.FileSave();
            dsoFramerWordControl1.FileClose();
            dsoFramerWordControl1.FileDataGzip = parentTemple.DocContent;
            ExcelAccess ex = new ExcelAccess();
            Microsoft.Office.Interop.Excel.Workbook wb = dsoFramerWordControl1.AxFramerControl.ActiveDocument as Microsoft.Office.Interop.Excel.Workbook;
            ex.MyWorkBook = wb;
            ex.MyExcel = wb.Application;
           string filter = "";
            int i = 0;


            string sdtrorg = " ";
            if (orgid != "")
            {

                sdtrorg += "  and OrgCode='" + orgid + "'";
            }
            IList mclist = ClientHelper.PlatformSqlMap.GetList("SelectOneStr", "select distinct zrr  from PJ_xlsbzrqhfmbb where  1=1 " + sdtrorg);
            List<WF_ModleRecordWorkTaskIns> mrwtlist = new List<WF_ModleRecordWorkTaskIns>();
            foreach (string mc in mclist)
            {
                filter = " where 1=1 and zrr='" + mc + "' ";
                if (orgid != "") filter = " and OrgCode='" + orgid + "'";
                if (isWorkflowCall)
                {
                    filter = filter + " and (id not in (select ModleRecordID from WF_ModleRecordWorkTaskIns where  WorkFlowInsId='"
                        + WorkFlowData.Rows[0]["WorkFlowInsId"].ToString() + "') "
                            + " or id in  (select ModleRecordID from WF_ModleRecordWorkTaskIns where "
                        + "    RecordID='" + currRecord.ID + "')) "
                        ;
                }

                IList<PJ_xlsbzrqhfmbb> datalist = Client.ClientHelper.PlatformSqlMap.GetListByWhere<PJ_xlsbzrqhfmbb>(
                     filter
                     );
                ExportExcel(ex, datalist,mc);
            }
            ex.DeleteSheet(1);
            if (parentTemple == null)
            {
                parentTemple = new LP_Temple();
                parentTemple.Status = "文档生成";
            }
            dsoFramerWordControl1.FileSave();
            parentTemple.DocContent = dsoFramerWordControl1.FileDataGzip;
            dsoFramerWordControl1.FileSave();
            dsoFramerWordControl1.FileClose();
        }
开发者ID:s7loves,项目名称:mypowerscgl,代码行数:61,代码来源:ExportXLSBZRQHFMXB.cs

示例6: ExportExcelProjectCKD

        public void ExportExcelProjectCKD(string orgid, string strProject, string strfenProject)
        {
            ////lgm
            ExcelAccess ex = new ExcelAccess();
            SaveFileDialog saveFileDialog1 = new SaveFileDialog();
            string fname = Application.StartupPath + "\\00记录模板\\验收单.xls";
            ex.Open(fname);
            string strfirst = "";
            string filter = "";
            string filter2 = "";
            string filter3 = "";
            string filter4 = "";
            if (strProject != "全部")
                filter2 = "  where 1=1 and ssgc='" + strProject + "'  ";
            else
                filter2 = "  where 1=1  ";

            IList mclist = ClientHelper.PlatformSqlMap.GetList("SelectOneStr", "select distinct ssgc  from PJ_wgclrkysd " + filter2 + " order by ssgc");
            
            foreach (string mc in mclist)
            {
                if (strfenProject == "全部")
                    filter3 = "  where 1=1 ";
                else
                    filter3 = "  where  ssxm='" + strfenProject + "'  ";

                IList xmlist = ClientHelper.PlatformSqlMap.GetList("SelectOneStr", "select distinct ssxm  from PJ_wgclrkysd " + filter3 + " order by ssxm");
                foreach (string xm in xmlist)
                {
                    filter4 = "  where 1=1"
                        + "  and ssgc='" + mc + "' "
                        +"  and ssxm='" + xm + "' ";
                    IList sjlist = ClientHelper.PlatformSqlMap.GetList("SelectOneStr", "select distinct dhht  from PJ_wgclrkysd " + filter4 + " ");
                    foreach (string sj in sjlist)
                    {
                        filter = "  where 1=1"
                        + "  and ssgc='" + mc + "' "
                        + "  and ssxm='" + xm
                        + "' and  dhht='" + sj + "' ";
                        if (isWorkflowCall)
                        {
                          
                            filter = filter + " and id not in (select ModleRecordID from WF_ModleRecordWorkTaskIns where  WorkFlowId='"
                                + WorkFlowData.Rows[0]["WorkFlowId"].ToString() + "') "
                                    + " or id in  (select ModleRecordID from WF_ModleRecordWorkTaskIns where "
                                + "    RecordID='" + currRecord.ID + "') "
                                ;
                        }

                        IList<PJ_wgclrkysd> datalist = Client.ClientHelper.PlatformSqlMap.GetListByWhere<PJ_wgclrkysd>(
                         filter
                           );
                        ExportExcel(ex, datalist);
                    }
                }

            }

            try
            {
                ex.DeleteSheet(1);
            }
            catch { }
            ex.ShowExcel();
        }
开发者ID:s7loves,项目名称:mypowerscgl,代码行数:65,代码来源:ExportWGCLRKYSEdit.cs


注:本文中的ExcelAccess.DeleteSheet方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。