public IActionResult Word()
        {
            PageOfficeNetCore.PageOfficeCtrl pageofficeCtrl = new PageOfficeNetCore.PageOfficeCtrl(Request);
            pageofficeCtrl.ServerPage = "/PageOffice/POServer";

            PageOfficeNetCore.WordWriter.WordDocument doc = new PageOfficeNetCore.WordWriter.WordDocument();
            //打开数据区域
            PageOfficeNetCore.WordWriter.DataRegion dTable = doc.OpenDataRegion("PO_table");
            //设置数据区域可编辑性
            dTable.Editing = true;
            //打开数据区域中的表格,OpenTable(index)方法中的index为word文档中表格的下标,从1开始
            PageOfficeNetCore.WordWriter.Table table1 = doc.OpenDataRegion("PO_Table").OpenTable(1);
            // 给表头单元格赋值
            table1.OpenCellRC(1, 2).Value = "产品1";
            table1.OpenCellRC(1, 3).Value = "产品2";
            table1.OpenCellRC(2, 1).Value = "A部门";
            table1.OpenCellRC(3, 1).Value = "B部门";

            pageofficeCtrl.SetWriter(doc);

            //添加自定义按钮
            pageofficeCtrl.AddCustomToolButton("保存", "Save", 1);
            pageofficeCtrl.AddCustomToolButton("全屏/还原", "IsFullScreen", 4);

            //设置保存页面
            pageofficeCtrl.SaveDataPage = "SaveData";
            //打开Word文档
            pageofficeCtrl.WebOpen("doc/test.doc", PageOfficeNetCore.OpenModeType.docSubmitForm, "tom");
            ViewBag.POCtrl = pageofficeCtrl.GetHtmlCode("PageOfficeCtrl1");
            return(View());
        }
        public IActionResult Word()
        {
            PageOfficeNetCore.PageOfficeCtrl pageofficeCtrl = new PageOfficeNetCore.PageOfficeCtrl(Request);
            pageofficeCtrl.ServerPage = "/PageOffice/POServer";
            string userName = "";

            userName = Request.Form["userName"];
            if ("zhangsan" == userName)
            {
                userName = "******";
            }
            if ("lisi" == userName)
            {
                userName = "******";
            }
            if ("wangwu" == userName)
            {
                userName = "******";
            }
            //***************************卓正PageOffice组件的使用********************************

            pageofficeCtrl.AddCustomToolButton("保存", "Save", 1);
            pageofficeCtrl.AddCustomToolButton("领导圈阅", "StartHandDraw", 3);
            //pageofficeCtrl.AddCustomToolButton("分层显示手写批注", "ShowHandDrawDispBar", 7);
            pageofficeCtrl.AddCustomToolButton("全屏/还原", "IsFullScreen", 4);
            pageofficeCtrl.JsFunction_AfterDocumentOpened = "ShowByUserName";

            //设置保存页面
            pageofficeCtrl.SaveFilePage = "SaveDoc";
            //打开Word文档
            pageofficeCtrl.WebOpen("doc/test.doc", PageOfficeNetCore.OpenModeType.docNormalEdit, userName);
            ViewBag.POCtrl   = pageofficeCtrl.GetHtmlCode("PageOfficeCtrl1");
            ViewBag.userName = userName;
            return(View());
        }
        public IActionResult Word()
        {
            PageOfficeNetCore.PageOfficeCtrl pageofficeCtrl = new PageOfficeNetCore.PageOfficeCtrl(Request);
            pageofficeCtrl.ServerPage = "/PageOffice/POServer";

            PageOfficeNetCore.WordWriter.WordDocument doc = new PageOfficeNetCore.WordWriter.WordDocument();
            doc.Template.DefineDataRegion("Name", "[ 姓名 ]");
            doc.Template.DefineDataRegion("Address", "[ 地址 ]");
            doc.Template.DefineDataRegion("Tel", "[ 电话 ]");
            doc.Template.DefineDataRegion("Phone", "[ 手机 ]");
            doc.Template.DefineDataRegion("Sex", "[ 性别 ]");
            doc.Template.DefineDataRegion("Age", "[ 年龄 ]");
            doc.Template.DefineDataRegion("Email", "[ 邮箱 ]");
            doc.Template.DefineDataRegion("QQNo", "[ QQ号 ]");
            doc.Template.DefineDataRegion("MSNNo", "[ MSN号 ]");

            pageofficeCtrl.AddCustomToolButton("保存", "Save()", 1);
            pageofficeCtrl.AddCustomToolButton("定义数据区域", "ShowDefineDataRegions()", 3);
            pageofficeCtrl.Theme       = PageOfficeNetCore.ThemeType.Office2007;
            pageofficeCtrl.BorderStyle = PageOfficeNetCore.BorderStyleType.BorderThin;
            pageofficeCtrl.SetWriter(doc);
            //设置保存页面
            pageofficeCtrl.SaveFilePage = "SaveDoc";
            //打开Word文档
            pageofficeCtrl.WebOpen("doc/test.doc", PageOfficeNetCore.OpenModeType.docNormalEdit, "tom");
            ViewBag.POCtrl = pageofficeCtrl.GetHtmlCode("PageOfficeCtrl1");
            return(View());
        }
        public IActionResult template()
        {
            PageOfficeNetCore.PageOfficeCtrl pageofficeCtrl = new PageOfficeNetCore.PageOfficeCtrl(Request);
            pageofficeCtrl.ServerPage = "../PageOffice/POServer";
            PageOfficeNetCore.WordWriter.WordDocument doc = new PageOfficeNetCore.WordWriter.WordDocument();
            doc.Template.DefineDataRegion("Name", "[ 担保人姓名 ]");
            doc.Template.DefineDataRegion("Address", "[ 担保人地址 ]");
            doc.Template.DefineDataRegion("Tel", "[ 担保人电话 ]");
            doc.Template.DefineDataRegion("Phone", "[ 担保人手机 ]");
            doc.Template.DefineDataRegion("Sex", "[ 担保人性别 ]");
            doc.Template.DefineDataRegion("Age", "[ 担保人年龄 ]");
            doc.Template.DefineDataTag("{ 甲方公司名称 }");
            doc.Template.DefineDataTag("{ 乙方公司名称 }");
            doc.Template.DefineDataTag("【 合同日期 】");
            doc.Template.DefineDataTag("【 合同编号 】");
            pageofficeCtrl.AddCustomToolButton("保存", "Save()", 1);
            pageofficeCtrl.AddCustomToolButton("定义数据区域", "ShowDefineDataRegions()", 3);
            pageofficeCtrl.AddCustomToolButton("定义数据标签", "ShowDefineDataTags()", 20);
            pageofficeCtrl.Theme       = PageOfficeNetCore.ThemeType.Office2007;
            pageofficeCtrl.BorderStyle = PageOfficeNetCore.BorderStyleType.BorderThin;
            pageofficeCtrl.SetWriter(doc);
            //设置保存页面
            pageofficeCtrl.SaveFilePage = "SaveDoc";
            //打开Word文档
            pageofficeCtrl.WebOpen("/doc/test.doc", PageOfficeNetCore.OpenModeType.docNormalEdit, "tom");
            ViewBag.POCtrl = pageofficeCtrl.GetHtmlCode("PageOfficeCtrl1");

            return(View());
        }
        public IActionResult Word()
        {
            string user = Request.Query["user"];

            user = "******";
            string userName = "";

            PageOfficeNetCore.PageOfficeCtrl pageofficeCtrl = new PageOfficeNetCore.PageOfficeCtrl(Request);
            pageofficeCtrl.ServerPage = "../PageOffice/POServer";
            pageofficeCtrl.Caption    = "钢材采购合同";
            if (user == "zhangsan")
            {
                userName = "******";
                pageofficeCtrl.CustomToolbar = false;
            }
            else if (user == "lisi")
            {
                userName = "******";
                pageofficeCtrl.CustomToolbar = false;
            }
            else if (user == "wangwu")
            {
                userName = "******";
                pageofficeCtrl.SaveFilePage = "SaveDoc";
                pageofficeCtrl.AddCustomToolButton("保存", "Save", 1);
                pageofficeCtrl.AddCustomToolButton("盖章", "AddSeal", 2);
                pageofficeCtrl.AddCustomToolButton("返回", "GoBack", 21);
            }
            //打开Word文档
            pageofficeCtrl.WebOpen("/doc/test.doc", PageOfficeNetCore.OpenModeType.docReadOnly, userName);
            ViewBag.POCtrl   = pageofficeCtrl.GetHtmlCode("PageOfficeCtrl1");
            ViewBag.userName = userName;
            return(View());
        }
Пример #6
0
        public IActionResult Word()
        {
            PageOfficeNetCore.PageOfficeCtrl pageofficeCtrl = new PageOfficeNetCore.PageOfficeCtrl(Request);
            pageofficeCtrl.ServerPage = "/PageOffice/POServer";

            PageOfficeNetCore.WordWriter.WordDocument doc = new PageOfficeNetCore.WordWriter.WordDocument();
            doc.Template.DefineDataTag("{ 甲方 }");
            doc.Template.DefineDataTag("{ 乙方 }");
            doc.Template.DefineDataTag("{ 担保人 }");
            doc.Template.DefineDataTag("【 合同日期 】");
            doc.Template.DefineDataTag("【 合同编号 】");

            pageofficeCtrl.AddCustomToolButton("保存", "Save()", 1);
            pageofficeCtrl.AddCustomToolButton("定义数据标签", "ShowDefineDataTags()", 20);
            pageofficeCtrl.Theme       = PageOfficeNetCore.ThemeType.Office2007;
            pageofficeCtrl.BorderStyle = PageOfficeNetCore.BorderStyleType.BorderThin;
            pageofficeCtrl.SetWriter(doc);

            //设置保存页面
            pageofficeCtrl.SaveFilePage = "SaveDoc";
            //打开Word文档
            pageofficeCtrl.WebOpen("doc/test.doc", PageOfficeNetCore.OpenModeType.docNormalEdit, "tom");
            ViewBag.POCtrl = pageofficeCtrl.GetHtmlCode("PageOfficeCtrl1");
            return(View());
        }
Пример #7
0
        public IActionResult SubmitDataOfDoc()
        {
            string           docID = Request.Query["ID"];
            string           sql   = "select * from leaveRecord where ID = " + docID;
            SqliteConnection conn  = new SqliteConnection(connString);

            conn.Open();
            SqliteCommand cmd = new SqliteCommand(sql, conn);

            cmd.ExecuteNonQuery();
            cmd.CommandText = sql;
            SqliteDataReader dr = cmd.ExecuteReader();

            PageOfficeNetCore.PageOfficeCtrl pageofficeCtrl = new PageOfficeNetCore.PageOfficeCtrl(Request);
            pageofficeCtrl.ServerPage = "../PageOffice/POServer";
            PageOfficeNetCore.WordWriter.WordDocument doc    = new PageOfficeNetCore.WordWriter.WordDocument();
            PageOfficeNetCore.WordWriter.DataRegion   drName = doc.OpenDataRegion("PO_name");
            drName.Editing = true;
            PageOfficeNetCore.WordWriter.DataRegion drDept = doc.OpenDataRegion("PO_dept");
            drDept.Shading.BackgroundPatternColor = Color.Silver;
            //drDept.Editing = true;
            PageOfficeNetCore.WordWriter.DataRegion drCause = doc.OpenDataRegion("PO_cause");
            drCause.Editing = true;
            PageOfficeNetCore.WordWriter.DataRegion drNum = doc.OpenDataRegion("PO_num");
            drNum.Editing = true;
            PageOfficeNetCore.WordWriter.DataRegion drDate = doc.OpenDataRegion("PO_date");
            drDate.Shading.BackgroundPatternColor = Color.Pink;
            //drDate.Editing = true;
            PageOfficeNetCore.WordWriter.DataRegion drTip = doc.OpenDataRegion("PO_tip");
            drTip.Font.Italic = true;
            drTip.Value       = "提示:带背景色的文字是只能通过选择设置,[]中的文字是可以录入编辑的。";
            if (dr.Read())
            {
                doc.OpenDataRegion("PO_name").Value  = dr["Name"].ToString();
                doc.OpenDataRegion("PO_dept").Value  = dr["Dept"].ToString();
                doc.OpenDataRegion("PO_cause").Value = dr["Cause"].ToString();
                doc.OpenDataRegion("PO_num").Value   = dr["Num"].ToString();;
                doc.OpenDataRegion("PO_date").Value  = dr["SubmitTime"].ToString();;
            }
            dr.Close();
            conn.Close();
            // 设置界面样式
            pageofficeCtrl.Caption     = "用户填写请假条";
            pageofficeCtrl.BorderStyle = PageOfficeNetCore.BorderStyleType.BorderThin;
            // 添加自定义工具条按钮
            pageofficeCtrl.AddCustomToolButton("保存", "poSave", 1);
            pageofficeCtrl.AddCustomToolButton("全屏/还原", "poSetFullScreen", 4);
            pageofficeCtrl.JsFunction_OnWordDataRegionClick = "OnWordDataRegionClick()";
            //获取数据对象
            pageofficeCtrl.SetWriter(doc);
            //设置保存页面
            pageofficeCtrl.SaveDataPage = "SaveData?ID=" + docID;
            //打开Word文档
            pageofficeCtrl.WebOpen("/doc/template.doc", PageOfficeNetCore.OpenModeType.docSubmitForm, "tom");
            ViewBag.POCtrl = pageofficeCtrl.GetHtmlCode("PageOfficeCtrl1");
            return(View());
        }
Пример #8
0
        public IActionResult word3()
        {
            string           DocID = Request.Query["ID"];
            string           sql   = "select * from word where id= " + DocID + ";";
            SqliteConnection conn  = new SqliteConnection(connString);
            String           lz    = "张三批阅";//流转

            conn.Open();
            SqliteCommand cmd = new SqliteCommand(sql, conn);

            cmd.ExecuteNonQuery();
            cmd.CommandText = sql;
            SqliteDataReader dr = cmd.ExecuteReader();

            PageOfficeNetCore.PageOfficeCtrl pageofficeCtrl = new PageOfficeNetCore.PageOfficeCtrl(Request);
            pageofficeCtrl.ServerPage = "../PageOffice/POServer";
            string Literal_Subject_Text = "";
            string Literal_Lc_Text      = "";
            string fileName             = "";

            while (dr.Read())
            {
                Literal_Subject_Text = dr["Subject"].ToString();//文件名称

                if ("正式发文" == dr["Status"].ToString())
                {
                    Literal_Lc_Text = dr["Status"].ToString();//当前文件的流程
                }
                else
                {
                    Literal_Lc_Text = "已流转到“" + dr["Status"].ToString() + "”,当前是“只读模式”打开文件的效果。";
                }
                fileName = dr["FileName"].ToString();
                string fileSubject = dr["Subject"].ToString();
                pageofficeCtrl.Caption = fileSubject;
            }
            //设置保存页面
            pageofficeCtrl.SaveFilePage = "/Edit/SaveDoc";

            pageofficeCtrl.AddCustomToolButton("另存到本地", "ShowDialog(0)", 5);
            pageofficeCtrl.AddCustomToolButton("页面设置", "ShowDialog(1)", 0);
            pageofficeCtrl.AddCustomToolButton("打印", "ShowDialog(2)", 6);
            pageofficeCtrl.AddCustomToolButton("全屏/还原", "IsFullScreen", 4);
            //打开Word文档
            pageofficeCtrl.WebOpen("/doc/" + fileName, PageOfficeNetCore.OpenModeType.docReadOnly, "tom");
            ViewBag.POCtrl = pageofficeCtrl.GetHtmlCode("PageOfficeCtrl1");
            ViewBag.Literal_Subject_Text = Literal_Subject_Text;
            ViewBag.Literal_Lc_Text      = Literal_Lc_Text;
            ViewBag.DocID    = DocID;
            ViewBag.lz       = lz;
            ViewBag.fileName = fileName;
            return(View());
        }
        public IActionResult Word()
        {
            PageOfficeNetCore.PageOfficeCtrl pageofficeCtrl = new PageOfficeNetCore.PageOfficeCtrl(Request);
            pageofficeCtrl.ServerPage = "/PageOffice/POServer";

            //添加自定义按钮
            pageofficeCtrl.AddCustomToolButton("删除光标处的", "delBookMark()", 7);
            pageofficeCtrl.AddCustomToolButton("删除选中文本中的", "delChoBookMark()", 7);
            //打开Word文档
            pageofficeCtrl.WebOpen("doc/template.doc", PageOfficeNetCore.OpenModeType.docNormalEdit, "tom");
            ViewBag.POCtrl = pageofficeCtrl.GetHtmlCode("PageOfficeCtrl1");
            return(View());
        }
Пример #10
0
        public IActionResult Word()
        {
            PageOfficeNetCore.PageOfficeCtrl pageofficeCtrl = new PageOfficeNetCore.PageOfficeCtrl(Request);
            pageofficeCtrl.ServerPage = "/PageOffice/POServer";

            pageofficeCtrl.AddCustomToolButton("保存", "Save()", 1);
            pageofficeCtrl.AddCustomToolButton("保存首页为图片", "SaveFirstAsImg()", 1);

            //设置保存页面
            pageofficeCtrl.SaveFilePage = "SaveDoc";
            //打开Word文档
            pageofficeCtrl.WebOpen("doc/test.doc", PageOfficeNetCore.OpenModeType.docNormalEdit, "tom");
            ViewBag.POCtrl = pageofficeCtrl.GetHtmlCode("PageOfficeCtrl1");
            return(View());
        }
        public IActionResult Word3()
        {
            PageOfficeNetCore.PageOfficeCtrl pageofficeCtrl = new PageOfficeNetCore.PageOfficeCtrl(Request);
            pageofficeCtrl.ServerPage = "/PageOffice/POServer";
            //添加自定义按钮
            pageofficeCtrl.AddCustomToolButton("保存", "Save", 1);
            pageofficeCtrl.AddCustomToolButton("签字", "InsertHandSign()", 3);
            //设置保存页面
            pageofficeCtrl.SaveFilePage = "SaveDoc3";
            //打开Word文档
            pageofficeCtrl.WebOpen("/InsertSeal/Word/AddSign3/test.doc", PageOfficeNetCore.OpenModeType.docAdmin, "tom");
            ViewBag.POCtrl = pageofficeCtrl.GetHtmlCode("PageOfficeCtrl1");

            return(View());
        }
 public IActionResult Excel4()
 {
     PageOfficeNetCore.PageOfficeCtrl pageofficeCtrl = new PageOfficeNetCore.PageOfficeCtrl(Request);
     pageofficeCtrl.ServerPage = "/PageOffice/POServer";
     //添加自定义按钮
     pageofficeCtrl.AddCustomToolButton("保存", "Save", 1);
     pageofficeCtrl.AddCustomToolButton("加盖印章", "InsertSeal()", 2);
     pageofficeCtrl.AddCustomToolButton("验证印章", "VerifySeal()", 5);
     //设置保存页面
     pageofficeCtrl.SaveFilePage = "SaveDoc4";
     //打开Word文档
     pageofficeCtrl.WebOpen("/InsertSeal/Excel/AddSeal4/test.xls", PageOfficeNetCore.OpenModeType.xlsNormalEdit, "tom");
     ViewBag.POCtrl = pageofficeCtrl.GetHtmlCode("PageOfficeCtrl1");
     return(View());
 }
 public IActionResult Word()
 {
     PageOfficeNetCore.PageOfficeCtrl pageofficeCtrl = new PageOfficeNetCore.PageOfficeCtrl(Request);
     pageofficeCtrl.ServerPage = "../PageOffice/POServer";
     //添加自定义按钮
     pageofficeCtrl.AddCustomToolButton("保存", "SaveFile()", 1);
     pageofficeCtrl.AddCustomToolButton("打印", "PrintFile()", 6);
     pageofficeCtrl.AddCustomToolButton("关闭", "CloseFile()", 21);
     //设置保存页面
     pageofficeCtrl.SaveFilePage = "SaveDoc";
     //打开Word文档
     pageofficeCtrl.WebOpen("/simplediv/doc/test.doc", PageOfficeNetCore.OpenModeType.docRevisionOnly, "tom");
     ViewBag.POCtrl = pageofficeCtrl.GetHtmlCode("PageOfficeCtrl1");
     return(View());
 }
        public IActionResult Word()
        {
            PageOfficeNetCore.PageOfficeCtrl pageofficeCtrl = new PageOfficeNetCore.PageOfficeCtrl(Request);
            pageofficeCtrl.ServerPage = "/PageOffice/POServer";

            pageofficeCtrl.AddCustomToolButton("导入文件", "importData()", 5);
            pageofficeCtrl.AddCustomToolButton("提交数据", "submitData()", 1);
            PageOfficeNetCore.WordWriter.WordDocument wordDoc = new PageOfficeNetCore.WordWriter.WordDocument();
            pageofficeCtrl.SetWriter(wordDoc);

            //设置保存页面
            pageofficeCtrl.SaveDataPage = "SaveDoc";
            ViewBag.POCtrl = pageofficeCtrl.GetHtmlCode("PageOfficeCtrl1");
            return(View());
        }
        public IActionResult Word()
        {
            PageOfficeNetCore.PageOfficeCtrl pageofficeCtrl = new PageOfficeNetCore.PageOfficeCtrl(Request);
            pageofficeCtrl.ServerPage = "/PageOffice/POServer";
            // Create custom toolbar
            pageofficeCtrl.AddCustomToolButton("保存", "SaveDocument()", 1);
            pageofficeCtrl.AddCustomToolButton("显示A文档", "ShowFile1View()", 0);
            pageofficeCtrl.AddCustomToolButton("显示B文档", "ShowFile2View()", 0);
            pageofficeCtrl.AddCustomToolButton("显示比较结果", "ShowCompareView()", 0);


            pageofficeCtrl.WordCompare("doc/aaa1.doc", "doc/aaa2.doc", PageOfficeNetCore.OpenModeType.docAdmin, "Tom");
            ViewBag.POCtrl = pageofficeCtrl.GetHtmlCode("PageOfficeCtrl1");
            return(View());
        }
        public IActionResult Word()
        {
            string user     = "";
            string userName = Request.Form["userName"];

            PageOfficeNetCore.PageOfficeCtrl pageofficeCtrl = new PageOfficeNetCore.PageOfficeCtrl(Request);
            pageofficeCtrl.ServerPage = "/PageOffice/POServer";

            //***************************卓正PageOffice组件的使用********************************
            PageOfficeNetCore.WordWriter.WordDocument doc = new PageOfficeNetCore.WordWriter.WordDocument();

            PageOfficeNetCore.WordWriter.DataRegion dA1 = doc.OpenDataRegion("PO_A_pro1");
            PageOfficeNetCore.WordWriter.DataRegion dA2 = doc.OpenDataRegion("PO_A_pro2");
            PageOfficeNetCore.WordWriter.DataRegion dB1 = doc.OpenDataRegion("PO_B_pro1");
            PageOfficeNetCore.WordWriter.DataRegion dB2 = doc.OpenDataRegion("PO_B_pro2");

            //根据登录用户名设置数据区域可编辑性
            //A部门经理登录后
            if (userName.Equals("zhangsan"))
            {
                dA1.Editing = true;
                dA2.Editing = true;
                dB1.Editing = false;
                dB2.Editing = false;
                user        = "******";
            }
            //B部门经理登录后
            else
            {
                dB1.Editing = true;
                dB2.Editing = true;
                dA1.Editing = false;
                dA2.Editing = false;
                user        = "******";
            }

            pageofficeCtrl.SetWriter(doc);
            //添加自定义按钮
            pageofficeCtrl.AddCustomToolButton("保存", "Save", 1);
            pageofficeCtrl.AddCustomToolButton("全屏/还原", "IsFullScreen", 4);
            //设置保存页面
            pageofficeCtrl.SaveFilePage = "SaveDoc";
            //打开Word文档
            pageofficeCtrl.WebOpen("doc/test.doc", PageOfficeNetCore.OpenModeType.docSubmitForm, user);
            ViewBag.POCtrl = pageofficeCtrl.GetHtmlCode("PageOfficeCtrl1");
            ViewBag.user   = user;
            return(View());
        }
Пример #17
0
        public IActionResult Word()
        {
            String userName = "******";
            String userId   = Request.Query["userid"];

            if (userId.Equals("1"))
            {
                userName = "******";
            }
            else
            {
                userName = "******";
            }

            PageOfficeNetCore.PageOfficeCtrl pageofficeCtrl = new PageOfficeNetCore.PageOfficeCtrl(Request);
            pageofficeCtrl.ServerPage = "/PageOffice/POServer";

            //添加自定义按钮
            pageofficeCtrl.AddCustomToolButton("保存", "Save()", 1);
            //设置保存页面
            pageofficeCtrl.SaveFilePage = "SaveDoc";
            //设置并发控制时间
            pageofficeCtrl.TimeSlice = 20; // 设置并发控制时间, 单位:分钟
            //打开Word文档
            pageofficeCtrl.WebOpen("doc/test.doc", PageOfficeNetCore.OpenModeType.docRevisionOnly, userName);
            ViewBag.POCtrl   = pageofficeCtrl.GetHtmlCode("PageOfficeCtrl1");
            ViewBag.userName = userName;
            return(View());
        }
Пример #18
0
        public IActionResult edit()
        {
            PageOfficeNetCore.PageOfficeCtrl pageofficeCtrl = new PageOfficeNetCore.PageOfficeCtrl(Request);
            pageofficeCtrl.ServerPage = "/PageOffice/POServer";

            //添加自定义按钮
            pageofficeCtrl.AddCustomToolButton("保存", "Save", 1);
            pageofficeCtrl.AddCustomToolButton("全屏/还原", "IsFullScreen", 4);

            //设置保存页面
            pageofficeCtrl.SaveFilePage = "SaveDoc";
            //打开Word文档
            pageofficeCtrl.WebOpen("doc/test.doc", PageOfficeNetCore.OpenModeType.docNormalEdit, "tom");
            ViewBag.POCtrl = pageofficeCtrl.GetHtmlCode("PageOfficeCtrl1");
            return(View());
        }
Пример #19
0
        public IActionResult Word()
        {
            PageOfficeNetCore.PageOfficeCtrl pageofficeCtrl = new PageOfficeNetCore.PageOfficeCtrl(Request);
            pageofficeCtrl.ServerPage = "/PageOffice/POServer";

            // 设置保存文件页面
            PageOfficeNetCore.WordWriter.WordDocument wordDoc = new PageOfficeNetCore.WordWriter.WordDocument();
            pageofficeCtrl.AddCustomToolButton("保存", "Save()", 1);
            pageofficeCtrl.CustomToolbar = true;
            //打开数据区域,openDataRegion方法的参数代表Word文档中的书签名称
            PageOfficeNetCore.WordWriter.DataRegion dataRegion1 = wordDoc.OpenDataRegion("PO_test1");
            dataRegion1.SubmitAsFile = true;
            PageOfficeNetCore.WordWriter.DataRegion dataRegion2 = wordDoc.OpenDataRegion("PO_test2");
            dataRegion2.SubmitAsFile = true;
            dataRegion2.Editing      = true;
            PageOfficeNetCore.WordWriter.DataRegion dataRegion3 = wordDoc.OpenDataRegion("PO_test3");
            dataRegion3.SubmitAsFile = true;

            pageofficeCtrl.SetWriter(wordDoc);

            pageofficeCtrl.SaveDataPage = "SaveData";
            //打开Word文档
            pageofficeCtrl.WebOpen("doc/test.doc", PageOfficeNetCore.OpenModeType.docSubmitForm, "tom");
            ViewBag.POCtrl = pageofficeCtrl.GetHtmlCode("PageOfficeCtrl1");
            return(View());
        }
Пример #20
0
        public IActionResult ExcelFill()
        {
            PageOfficeNetCore.PageOfficeCtrl pageofficeCtrl = new PageOfficeNetCore.PageOfficeCtrl(Request);
            pageofficeCtrl.ServerPage = "/PageOffice/POServer";

            PageOfficeNetCore.ExcelWriter.Workbook wk    = new PageOfficeNetCore.ExcelWriter.Workbook();
            PageOfficeNetCore.ExcelWriter.Sheet    sheet = wk.OpenSheet("Sheet1");
            PageOfficeNetCore.ExcelWriter.Table    table = sheet.OpenTableByDefinedName("report", 10, 5, false);
            table.DataFields[0].Value = "轮胎";
            table.DataFields[1].Value = "100";
            table.DataFields[2].Value = "120";
            table.DataFields[3].Value = "500";
            table.DataFields[4].Value = "120%";
            table.NextRow();
            table.Close();
            pageofficeCtrl.SetWriter(wk);// 注意不要忘记此代码,如果缺少此句代码,不会赋值成功。

            pageofficeCtrl.Caption      = "给Excel文档中定义名称的单元格赋值";
            pageofficeCtrl.SaveDataPage = "SaveData";
            pageofficeCtrl.AddCustomToolButton("保存", "Save()", 1);
            //打开Word文档
            pageofficeCtrl.WebOpen("doc/test.xls", PageOfficeNetCore.OpenModeType.xlsSubmitForm, "tom");
            ViewBag.POCtrl = pageofficeCtrl.GetHtmlCode("PageOfficeCtrl1");
            return(View());
        }
        public IActionResult Word()
        {
            PageOfficeNetCore.PageOfficeCtrl pageofficeCtrl = new PageOfficeNetCore.PageOfficeCtrl(Request);
            pageofficeCtrl.ServerPage = "/PageOffice/POServer";

            pageofficeCtrl.Caption = "演示:向保存页面传递参数,更新人员信息";
            pageofficeCtrl.AddCustomToolButton("保存", "Save()", 1);
            pageofficeCtrl.AddCustomToolButton("全屏", "SetFullScreen()", 4);

            //设置保存页面
            pageofficeCtrl.SaveFilePage = "SaveDoc?id=1";//传递查询参数
            //打开Word文档
            pageofficeCtrl.WebOpen("doc/test.doc", PageOfficeNetCore.OpenModeType.docNormalEdit, "tom");
            ViewBag.POCtrl = pageofficeCtrl.GetHtmlCode("PageOfficeCtrl1");
            return(View());
        }
Пример #22
0
        public IActionResult Excel()
        {
            PageOfficeNetCore.PageOfficeCtrl pageofficeCtrl = new PageOfficeNetCore.PageOfficeCtrl(Request);
            pageofficeCtrl.ServerPage = "/PageOffice/POServer";

            PageOfficeNetCore.ExcelWriter.Workbook workBook = new PageOfficeNetCore.ExcelWriter.Workbook();
            PageOfficeNetCore.ExcelWriter.Sheet    sheet    = workBook.OpenSheet("Sheet1");
            //定义table对象,设置table对象的设置范围
            PageOfficeNetCore.ExcelWriter.Table table = sheet.OpenTable("B4:D8");
            //设置table对象的提交名称,以便保存页面获取提交的数据
            table.SubmitName = "Info";
            pageofficeCtrl.SetWriter(workBook);

            // 设置响应单元格点击事件的js function
            pageofficeCtrl.JsFunction_OnExcelCellClick = "OnCellClick()";

            pageofficeCtrl.AddCustomToolButton("保存", "Save()", 1);

            //设置保存页面
            pageofficeCtrl.SaveDataPage = "SaveData";
            //打开Word文档
            pageofficeCtrl.WebOpen("doc/test.xls", PageOfficeNetCore.OpenModeType.xlsSubmitForm, "tom");
            ViewBag.POCtrl = pageofficeCtrl.GetHtmlCode("PageOfficeCtrl1");
            return(View());
        }
Пример #23
0
        public IActionResult PPT()
        {
            PageOfficeNetCore.PageOfficeCtrl pageofficeCtrl = new PageOfficeNetCore.PageOfficeCtrl(Request);
            pageofficeCtrl.ServerPage = "/PageOffice/POServer";

            //添加自定义按钮
            pageofficeCtrl.AddCustomToolButton("保存", "Save()", 1);
            pageofficeCtrl.AddCustomToolButton("关闭", "Close()", 21);

            //设置保存页面
            pageofficeCtrl.SaveFilePage = "SaveDoc";
            //打开Word文档
            pageofficeCtrl.WebOpen("doc/test.ppt", PageOfficeNetCore.OpenModeType.pptNormalEdit, "tom");
            ViewBag.POCtrl = pageofficeCtrl.GetHtmlCode("PageOfficeCtrl1");
            return(View());
        }
        public IActionResult Word()
        {
            PageOfficeNetCore.PageOfficeCtrl pageofficeCtrl = new PageOfficeNetCore.PageOfficeCtrl(Request);
            pageofficeCtrl.ServerPage = "/PageOffice/POServer";

            PageOfficeNetCore.WordWriter.WordDocument doc     = new PageOfficeNetCore.WordWriter.WordDocument();
            PageOfficeNetCore.WordWriter.DataRegion   dataReg = doc.OpenDataRegion("PO_deptName");
            //为方便用户知道哪些地方可以编辑,所以设置了数据区域的背景色
            dataReg.Shading.BackgroundPatternColor = Color.Pink;
            //dataReg.Editing = true;

            pageofficeCtrl.SetWriter(doc); // 不要忘记此句代码

            // 设置数据区域点击时的响应js函数
            pageofficeCtrl.JsFunction_OnWordDataRegionClick = "OnWordDataRegionClick()";

            pageofficeCtrl.AddCustomToolButton("保存", "Save", 1);
            pageofficeCtrl.OfficeToolbars = false;
            pageofficeCtrl.Caption        = "为方便用户知道哪些地方可以编辑,所以设置了数据区域的背景色";
            //设置保存页面
            pageofficeCtrl.SaveFilePage = "SaveDoc";
            //打开Word文档
            pageofficeCtrl.WebOpen("doc/test.doc", PageOfficeNetCore.OpenModeType.docSubmitForm, "tom");
            ViewBag.POCtrl = pageofficeCtrl.GetHtmlCode("PageOfficeCtrl1");
            return(View());
        }
        public IActionResult Word()
        {
            PageOfficeNetCore.PageOfficeCtrl pageofficeCtrl = new PageOfficeNetCore.PageOfficeCtrl(Request);
            pageofficeCtrl.ServerPage = "/PageOffice/POServer";

            PageOfficeNetCore.WordWriter.WordDocument wordDoc = new PageOfficeNetCore.WordWriter.WordDocument();

            //打开数据区域,OpenDataRegion方法的参数代表Word文档中的书签名称
            PageOfficeNetCore.WordWriter.DataRegion dataRegion1 = wordDoc.OpenDataRegion("PO_userName");
            //设置DataRegion的可编辑性
            dataRegion1.Editing = true;
            //为DataRegion赋值,此处的值可在页面中打开Word文档后在自己进行修改
            dataRegion1.Value = "";

            PageOfficeNetCore.WordWriter.DataRegion dataRegion2 = wordDoc.OpenDataRegion("PO_deptName");
            dataRegion2.Editing = true;
            dataRegion2.Value   = "";

            pageofficeCtrl.SetWriter(wordDoc);
            pageofficeCtrl.SaveDataPage = "SaveData";
            pageofficeCtrl.AddCustomToolButton("保存", "Save()", 1);

            //打开Word文档
            pageofficeCtrl.WebOpen("doc/test.doc", PageOfficeNetCore.OpenModeType.docSubmitForm, "tom");
            ViewBag.POCtrl = pageofficeCtrl.GetHtmlCode("PageOfficeCtrl1");
            return(View());
        }
Пример #26
0
        public IActionResult Word()
        {
            string userName = Request.Form["userName"];

            PageOfficeNetCore.PageOfficeCtrl pageofficeCtrl = new PageOfficeNetCore.PageOfficeCtrl(Request);
            pageofficeCtrl.ServerPage = "/PageOffice/POServer";
            PageOfficeNetCore.WordWriter.WordDocument doc = new PageOfficeNetCore.WordWriter.WordDocument();

            //打开数据区域
            PageOfficeNetCore.WordWriter.DataRegion d1 = doc.OpenDataRegion("PO_com1");
            //给数据区域赋值
            d1.Value = "[word]doc/content1.doc[/word]";
            //若要将数据区域内容存入文件中,则必须设置属性“SubmitAsFile”值为true
            d1.SubmitAsFile = true;

            PageOfficeNetCore.WordWriter.DataRegion d2 = doc.OpenDataRegion("PO_com2");
            d2.Value        = "[word]doc/content2.doc[/word]";
            d2.SubmitAsFile = true;

            //根据登录用户名设置数据区域可编辑性
            //甲客户:zhangsan 登录后登录后
            if (userName.Equals("zhangsan"))
            {
                d1.Editing = true;
                d2.Editing = false;
            }
            //乙客户:lisi 登录后登录后
            else
            {
                d2.Editing = true;
                d1.Editing = false;
            }

            pageofficeCtrl.SetWriter(doc);

            //添加自定义按钮
            pageofficeCtrl.AddCustomToolButton("保存", "Save", 1);
            pageofficeCtrl.AddCustomToolButton("全屏/还原", "IsFullScreen", 4);

            //设置保存页面
            pageofficeCtrl.SaveDataPage = "SaveData?userName="******"doc/test.doc", PageOfficeNetCore.OpenModeType.docSubmitForm, userName);
            ViewBag.POCtrl   = pageofficeCtrl.GetHtmlCode("PageOfficeCtrl1");
            ViewBag.userName = userName;
            return(View());
        }
Пример #27
0
        public IActionResult Word()
        {
            PageOfficeNetCore.PageOfficeCtrl pageofficeCtrl = new PageOfficeNetCore.PageOfficeCtrl(Request);
            pageofficeCtrl.ServerPage = "/PageOffice/POServer";

            pageofficeCtrl.JsFunction_AfterDocumentOpened = "AfterDocumentOpened()";
            pageofficeCtrl.OfficeToolbars = false;
            pageofficeCtrl.AddCustomToolButton("保存", "Save()", 1);
            pageofficeCtrl.AddCustomToolButton("新建批注", "InsertComment()", 3);

            //设置保存页面
            pageofficeCtrl.SaveFilePage = "SaveDoc";
            //打开Word文档
            pageofficeCtrl.WebOpen("doc/test.doc", PageOfficeNetCore.OpenModeType.docRevisionOnly, "tom");
            ViewBag.POCtrl = pageofficeCtrl.GetHtmlCode("PageOfficeCtrl1");
            return(View());
        }
        public IActionResult Word()
        {
            PageOfficeNetCore.PageOfficeCtrl pageofficeCtrl = new PageOfficeNetCore.PageOfficeCtrl(Request);
            pageofficeCtrl.ServerPage = "/PageOffice/POServer";

            //添加自定义按钮
            pageofficeCtrl.AddCustomToolButton("保存", "Save()", 1);
            pageofficeCtrl.AddCustomToolButton("隐藏痕迹", "hideRevision()", 18);
            pageofficeCtrl.AddCustomToolButton("显示痕迹", "showRevision()", 9);

            //设置保存页面
            pageofficeCtrl.SaveFilePage = "SaveDoc";
            //打开Word文档
            pageofficeCtrl.WebOpen("doc/test.doc", PageOfficeNetCore.OpenModeType.docRevisionOnly, "tom");
            ViewBag.POCtrl = pageofficeCtrl.GetHtmlCode("PageOfficeCtrl1");
            return(View());
        }
        public IActionResult Excel2()
        {
            PageOfficeNetCore.PageOfficeCtrl pageofficeCtrl = new PageOfficeNetCore.PageOfficeCtrl(Request);
            pageofficeCtrl.ServerPage = "/PageOffice/POServer";

            //添加自定义按钮
            pageofficeCtrl.AddCustomToolButton("保存", "Save", 1);
            pageofficeCtrl.AddCustomToolButton("签字", "AddHandSign()", 3);
            pageofficeCtrl.AddCustomToolButton("修改密码", "ChangePsw()", 0);
            //设置保存页面
            pageofficeCtrl.SaveFilePage = "SaveDoc2";
            //打开Word文档
            pageofficeCtrl.WebOpen("/InsertSeal/Excel/AddSign2/test.xls", PageOfficeNetCore.OpenModeType.xlsNormalEdit, "tom");
            ViewBag.POCtrl = pageofficeCtrl.GetHtmlCode("PageOfficeCtrl1");

            return(View());
        }
Пример #30
0
        public IActionResult Word9()
        {
            PageOfficeNetCore.PageOfficeCtrl pageofficeCtrl = new PageOfficeNetCore.PageOfficeCtrl(Request);
            pageofficeCtrl.ServerPage = "/PageOffice/POServer";
            //添加自定义按钮
            pageofficeCtrl.AddCustomToolButton("保存", "Save", 1);
            pageofficeCtrl.AddCustomToolButton("加盖印章", "InsertSeal()", 2);
            pageofficeCtrl.AddCustomToolButton("删除指定印章", "DeleteSeal()", 21);
            pageofficeCtrl.AddCustomToolButton("清除所有印章", "DeleteAllSeal()", 21);
            //设置保存页面
            pageofficeCtrl.SaveFilePage = "SaveDoc9";
            //打开Word文档
            pageofficeCtrl.WebOpen("/InsertSeal/Word/AddSeal9/word9.doc", PageOfficeNetCore.OpenModeType.docAdmin, "tom");
            ViewBag.POCtrl = pageofficeCtrl.GetHtmlCode("PageOfficeCtrl1");

            return(View());
        }