示例#1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        String id       = Request.QueryString["id"].Trim();
        String filePath = "";

        if ("1".Equals(id))
        {
            filePath = Server.MapPath("doc/PageOffice产品简介.doc");
        }
        if ("2".Equals(id))
        {
            filePath = Server.MapPath("doc/Pageoffice客户端安装步骤.doc");
        }
        if ("3".Equals(id))
        {
            filePath = Server.MapPath("doc/PageOffice的应用领域.doc");
        }
        if ("4".Equals(id))
        {
            filePath = Server.MapPath("doc/PageOffice产品对客户端环境要求.doc");
        }


        // 设置PageOffice组件服务页面
        PageOfficeCtrl1.ServerPage = Request.ApplicationPath + "/pageoffice/server.aspx";
        // 设置保存文件页面
        PageOfficeCtrl1.SaveFilePage = "SaveFile.aspx";
        //添加自定义的保存按钮
        PageOfficeCtrl1.AddCustomToolButton("保存", "Save()", 1);
        // 打开文档
        PageOfficeCtrl1.WebOpen(filePath, PageOffice.OpenModeType.docNormalEdit, "Tom");
    }
    protected string userName = "";//登录的用户名
    protected void Page_Load(object sender, EventArgs e)
    {
        userName = Request.Form["userName"];
        if ("zhangsan" == userName)
        {
            userName = "******";
        }
        if ("lisi" == userName)
        {
            userName = "******";
        }
        if ("wangwu" == userName)
        {
            userName = "******";
        }
        //***************************卓正PageOffice组件的使用********************************

        PageOfficeCtrl1.AddCustomToolButton("保存", "Save", 1);
        PageOfficeCtrl1.AddCustomToolButton("领导圈阅", "StartHandDraw", 3);
        //PageOfficeCtrl1.AddCustomToolButton("分层显示手写批注", "ShowHandDrawDispBar", 7);
        PageOfficeCtrl1.AddCustomToolButton("全屏/还原", "IsFullScreen", 4);
        PageOfficeCtrl1.ServerPage   = Request.ApplicationPath + "/pageoffice/server.aspx"; //此行必须
        PageOfficeCtrl1.SaveFilePage = "Savefile.aspx";
        PageOfficeCtrl1.JsFunction_AfterDocumentOpened = "AfterDocumentOpened";
        PageOfficeCtrl1.WebOpen("doc/test.doc", PageOffice.OpenModeType.docNormalEdit, userName);
    }
示例#3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     PageOfficeCtrl1.ServerPage   = Request.ApplicationPath + "/pageoffice/server.aspx";
     PageOfficeCtrl1.SaveFilePage = "SaveFile.aspx?id=1";
     PageOfficeCtrl1.AddCustomToolButton("保存", "Save()", 1);
     PageOfficeCtrl1.WebOpen("Openstream.aspx?id=1", PageOffice.OpenModeType.docRevisionOnly, "somebody");
 }
示例#4
0
 protected void PageOfficeCtrl1_Load(object sender, EventArgs e)
 {
     PageOfficeCtrl1.ServerPage   = Request.ApplicationPath + "/pageoffice/server.aspx";
     PageOfficeCtrl1.SaveFilePage = "SaveFile.aspx";
     PageOfficeCtrl1.AddCustomToolButton("保存", "Save", 1);
     PageOfficeCtrl1.WebOpen(Server.MapPath("doc/") + fileName, PageOffice.OpenModeType.docNormalEdit, "somebody");
 }
示例#5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        PageOffice.WordWriter.WordDocument doc = new PageOffice.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号 ]");


        PageOfficeCtrl1.AddCustomToolButton("保存", "Save()", 1);
        PageOfficeCtrl1.AddCustomToolButton("定义数据区域", "ShowDefineDataRegions()", 3);

        PageOfficeCtrl1.ServerPage   = Request.ApplicationPath + "/pageoffice/server.aspx";
        PageOfficeCtrl1.SaveFilePage = "SaveFile.aspx";

        PageOfficeCtrl1.Theme       = PageOffice.ThemeType.Office2007;
        PageOfficeCtrl1.BorderStyle = PageOffice.BorderStyleType.BorderThin;
        PageOfficeCtrl1.SetWriter(doc);
        PageOfficeCtrl1.WebOpen("doc/test.doc", PageOffice.OpenModeType.docNormalEdit, "zhangsan");
    }
示例#6
0
    protected void PageOfficeCtrl1_Load(object sender, EventArgs e)
    {
        // 设置PageOffice组件服务页面
        PageOfficeCtrl1.ServerPage = Request.ApplicationPath + "/pageoffice/server.aspx";
        // 设置保存文件页面
        PageOffice.WordWriter.WordDocument wordDoc = new PageOffice.WordWriter.WordDocument();
        PageOfficeCtrl1.AddCustomToolButton("保存", "Save()", 1);
        PageOfficeCtrl1.CustomToolbar = true;
        //打开数据区域,openDataRegion方法的参数代表Word文档中的书签名称
        PageOffice.WordWriter.DataRegion dataRegion1 = wordDoc.OpenDataRegion("PO_test1");
        dataRegion1.SubmitAsFile = true;
        PageOffice.WordWriter.DataRegion dataRegion2 = wordDoc.OpenDataRegion("PO_test2");
        dataRegion2.SubmitAsFile = true;
        dataRegion2.Editing      = true;
        PageOffice.WordWriter.DataRegion dataRegion3 = wordDoc.OpenDataRegion("PO_test3");
        dataRegion3.SubmitAsFile = true;


        PageOfficeCtrl1.SetWriter(wordDoc);

        PageOfficeCtrl1.SaveDataPage = "SaveData.aspx";

        // 打开文档
        PageOfficeCtrl1.WebOpen("doc/test.doc", PageOffice.OpenModeType.docSubmitForm, "Tom");
    }
示例#7
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //***************************卓正PageOffice组件的使用********************************
        WordDocument doc = new WordDocument();
        //打开数据区域
        DataRegion dTable = doc.OpenDataRegion("PO_table");

        //设置数据区域可编辑性
        dTable.Editing = true;
        //打开数据区域中的表格,OpenTable(index)方法中的index为word文档中表格的下标,从1开始
        PageOffice.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部门";

        PageOfficeCtrl1.SetWriter(doc);

        //添加自定义按钮
        PageOfficeCtrl1.AddCustomToolButton("保存", "Save", 1);
        PageOfficeCtrl1.AddCustomToolButton("全屏/还原", "IsFullScreen", 4);
        //设置服务器页面
        PageOfficeCtrl1.ServerPage = Request.ApplicationPath + "/pageoffice/server.aspx";
        //设置保存页
        PageOfficeCtrl1.SaveDataPage = "SaveData.aspx";
        //设置文档打开方式
        PageOfficeCtrl1.WebOpen("doc/test.doc", PageOffice.OpenModeType.docSubmitForm, "张佚名");
    }
示例#8
0
    protected void Page_Load(object sender, EventArgs e)
    {
        PageOffice.WordWriter.WordDocument doc = new PageOffice.WordWriter.WordDocument();
        DataRegion d1 = doc.OpenDataRegion("d1");

        d1.Font.Color = Color.Green;                                                //设置数据区域文本字体颜色
        d1.Font.Name  = "华文彩云";                                                     //设置数据区域文本字体样式
        d1.Font.Size  = 16;                                                         //设置数据区域文本字体大小
        d1.ParagraphFormat.Alignment = WdParagraphAlignment.wdAlignParagraphCenter; //设置数据区域文本对齐方式


        DataRegion d2 = doc.OpenDataRegion("d2");

        d2.Font.Color = Color.MediumAquamarine;                                   //设置数据区域文本字体颜色
        d2.Font.Name  = "黑体";                                                     //设置数据区域文本字体样式
        d2.Font.Size  = 14;                                                       //设置数据区域文本字体大小
        d2.ParagraphFormat.Alignment = WdParagraphAlignment.wdAlignParagraphLeft; //设置数据区域文本对齐方式

        DataRegion d3 = doc.OpenDataRegion("d3");

        d3.Font.Color = Color.Purple;                                              //设置数据区域文本字体颜色
        d3.Font.Name  = "华文行楷";                                                    //设置数据区域文本字体样式
        d3.Font.Size  = 12;                                                        //设置数据区域文本字体大小
        d3.ParagraphFormat.Alignment = WdParagraphAlignment.wdAlignParagraphRight; //设置数据区域文本对齐方式


        PageOfficeCtrl1.SetWriter(doc);

        //添加自定义按钮
        PageOfficeCtrl1.AddCustomToolButton("全屏/还原", "IsFullScreen", 4);
        //设置服务器页面
        PageOfficeCtrl1.ServerPage = Request.ApplicationPath + "/pageoffice/server.aspx"; //此行必须
        //设置文档打开方式
        PageOfficeCtrl1.WebOpen("doc/test.doc", PageOffice.OpenModeType.docSubmitForm, "张三");
    }
示例#9
0
    protected void Page_Load(object sender, EventArgs e)
    {
        // 设置PageOffice组件服务页面

        /**
         * 如果访问项目的时候浏览器地址栏中的地址都不带后缀(例如"http://localhost:3306/Samples/Deafult"),则这里给ServerPage赋值的时候也不能带后缀,
         * 直接就是“ PageOfficeCtrl1.ServerPage = Request.ApplicationPath + "/pageoffice/server";”,否则会报“error:0”的错误
         */
        PageOfficeCtrl1.ServerPage = Request.ApplicationPath + "/pageoffice/server.aspx";
        //添加自定义按钮
        PageOfficeCtrl1.AddCustomToolButton("保存", "SaveDocument()", 1);
        // PageOfficeCtrl1.AddCustomToolButton("打印设置", "PrintSet()", 0);
        //PageOfficeCtrl1.AddCustomToolButton("打印", "PrintFile()", 6);
        //PageOfficeCtrl1.AddCustomToolButton("全屏/还原", "IsFullScreen()", 4);
        //PageOfficeCtrl1.AddCustomToolButton("-", "", 0);
        //PageOfficeCtrl1.AddCustomToolButton("关闭", "Close()", 21);

        // 设置保存文件页面
        PageOfficeCtrl1.SaveFilePage = "SaveFile.aspx";
        // 打开文档
        PageOfficeCtrl1.WebOpen("D:\\project\\pageOffice\\test\\工.doc", PageOffice.OpenModeType.docNormalEdit, "Tom");

        //PageOfficeCtrl1.WebOpen("aaa/工.doc", PageOffice.OpenModeType.docNormalEdit, "Tom");
        //PageOfficeCtrl1.GetHtmlCode("PageOfficeCtrl1");
    }
示例#10
0
 /// <summary>
 /// 打开word文件
 /// </summary>
 /// <param name="fileName"></param>
 private void OpenWord(string fileName)
 {
     //***************************卓正PageOffice组件的使用********************************
     Session.Add("fileName", fileName);//保存word文件名称
     PageOfficeCtrl1.AddCustomToolButton("全屏/还原", "IsFullScreen", 4);
     PageOfficeCtrl1.SaveFilePage = "Savefile.aspx";
     PageOfficeCtrl1.WebOpen("doc/" + fileName, PageOffice.OpenModeType.docNormalEdit, "张三");
 }
示例#11
0
 protected void Page_Load(object sender, EventArgs e)
 {
     PageOfficeCtrl1.ServerPage = Request.ApplicationPath + "/pageoffice/server.aspx";
     PageOfficeCtrl1.AddCustomToolButton("导入文件", "importData()", 5);
     PageOfficeCtrl1.AddCustomToolButton("提交数据", "submitData()", 1);
     PageOffice.WordWriter.WordDocument wordDoc = new PageOffice.WordWriter.WordDocument();
     PageOfficeCtrl1.SetWriter(wordDoc);
     PageOfficeCtrl1.SaveDataPage = "SaveData.aspx";
 }
示例#12
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //设置PageOfficeCtrl控件的服务页面
        PageOfficeCtrl1.ServerPage = Request.ApplicationPath + "/pageoffice/server.aspx";
        PageOfficeCtrl1.Caption    = "简单的给Excel赋值";
        PageOfficeCtrl1.AddCustomToolButton("保存", "Save()", 1);

        PageOfficeCtrl1.WebOpen("doc/test4.xls", PageOffice.OpenModeType.xlsNormalEdit, "操作人姓名");
    }
示例#13
0
 protected void PageOfficeCtrl1_Load(object sender, EventArgs e)
 {
     PageOfficeCtrl1.ServerPage   = Request.ApplicationPath + "/pageoffice/server.aspx";
     PageOfficeCtrl1.SaveFilePage = "SaveNewFile.aspx";
     PageOfficeCtrl1.AddCustomToolButton("保存", "Save()", 1);
     PageOfficeCtrl1.JsFunction_BeforeDocumentSaved = "BeforeDocumentSaved()";
     //创建文件
     PageOfficeCtrl1.WebCreateNew("somebody", PageOffice.DocumentVersion.Word2003);//可创建不同版本的word文件
 }
示例#14
0
    protected void Page_Load(object sender, EventArgs e)
    {
        DocID = Request.QueryString["ID"];

        strSql = "select * from word where ID = " + DocID;
        DataSet ds = new DataSet();

        using (OleDbConnection connection = new OleDbConnection(connectionString))
        {
            connection.Open();
            OleDbDataAdapter command = new OleDbDataAdapter(strSql.ToString(), connection);
            command.Fill(ds, "ds");
            connection.Close();
        }

        DataTable dt = new DataTable();

        dt = ds.Tables[0];
        if ("文员清稿" == dt.Rows[0]["Status"].ToString())
        {
            Literal_Subject.Text = dt.Rows[0]["Subject"].ToString(); //文件名称
            Literal_Lc.Text      = dt.Rows[0]["Status"].ToString();  //当前文件的流程
            Literal_Lz.Text      = "正式发文";                           //流转
        }
        else
        {
            Literal_Lc.Text = "已流转到“" + dt.Rows[0]["Status"].ToString() + "”,当前是“核稿模式”打开文件的效果。";
        }

        string fileName = dt.Rows[0]["FileName"].ToString();

        PageOfficeCtrl1.CustomMenuCaption = "自定义菜单";
        PageOfficeCtrl1.AddCustomMenuItem("显示痕迹", "ShowRevisions", true);
        PageOfficeCtrl1.AddCustomMenuItem("隐藏痕迹", "HiddenRevisions", true);
        PageOfficeCtrl1.AddCustomMenuItem("-", "", false);
        PageOfficeCtrl1.AddCustomMenuItem("显示标题", "ShowTitle", true);
        PageOfficeCtrl1.AddCustomMenuItem("-", "", false);
        PageOfficeCtrl1.AddCustomMenuItem("领导签批", "InsertHandSign", true);
        PageOfficeCtrl1.AddCustomMenuItem("插入印章", "InsertSeal", true);
        PageOfficeCtrl1.AddCustomMenuItem("接受所有修订", "AcceptAllRevisions", true);
        PageOfficeCtrl1.AddCustomMenuItem("-", "", false);
        PageOfficeCtrl1.AddCustomMenuItem("分层显示手写批注", "ShowHandDrawDispBar", true);

        PageOfficeCtrl1.AddCustomToolButton("保存", "Save", 1);
        PageOfficeCtrl1.AddCustomToolButton("另存为Html", "SaveAsHtml", 0);
        PageOfficeCtrl1.AddCustomToolButton("显示/隐藏痕迹", "Show_HidRevisions", 5);
        PageOfficeCtrl1.AddCustomToolButton("插入印章/签名", "InsertSeal", 2);
        PageOfficeCtrl1.AddCustomToolButton("领导签批", "InsertHandSign", 3);
        PageOfficeCtrl1.AddCustomToolButton("接受所有修订", "AcceptAllRevisions", 5);
        PageOfficeCtrl1.AddCustomToolButton("分层显示手写批注", "ShowHandDrawDispBar", 7);
        PageOfficeCtrl1.AddCustomToolButton("全屏/还原", "IsFullScreen", 4);

        PageOfficeCtrl1.ServerPage   = "pageoffice/server.aspx";
        PageOfficeCtrl1.SaveFilePage = "savedoc.aspx";
        PageOfficeCtrl1.WebOpen(Server.MapPath("doc/") + fileName, PageOffice.OpenModeType.docAdmin, "张佚名");
    }
示例#15
0
    protected void PageOfficeCtrl1_Load(object sender, EventArgs e)
    {
        string fileName = "OrderForm.xls";

        PageOfficeCtrl1.AddCustomToolButton("保存", "Store", 1);
        PageOfficeCtrl1.AddCustomToolButton("全屏/还原", "SetScreen", 4);
        PageOfficeCtrl1.ServerPage   = "pageoffice/server.aspx";
        PageOfficeCtrl1.SaveDataPage = "UpdateOrder.aspx?";
        PageOfficeCtrl1.WebOpen(Server.MapPath("doc/") + fileName, PageOffice.OpenModeType.xlsSubmitForm, "admin");
    }
示例#16
0
 protected void Page_Load(object sender, EventArgs e)
 {
     PageOfficeCtrl1.ServerPage   = Request.ApplicationPath + "/pageoffice/server.aspx";
     PageOfficeCtrl1.SaveFilePage = "save.aspx";
     PageOfficeCtrl1.JsFunction_AfterDocumentOpened = "AfterDocumentOpened()";
     PageOfficeCtrl1.OfficeToolbars = false;
     PageOfficeCtrl1.AddCustomToolButton("保存", "Save()", 1);
     PageOfficeCtrl1.AddCustomToolButton("新建批注", "InsertComment()", 3);
     PageOfficeCtrl1.WebOpen("doc/test.doc", PageOffice.OpenModeType.docRevisionOnly, "John");
 }
示例#17
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string fileName = "test.doc"; // 正文文件

        PageOfficeCtrl1.AddCustomToolButton("保存", "Save", 1);
        PageOfficeCtrl1.AddCustomToolButton("全屏/还原", "IsFullScreen", 4);
        PageOfficeCtrl1.ServerPage   = Request.ApplicationPath + "/pageoffice/server.aspx"; //此行必须
        PageOfficeCtrl1.SaveFilePage = "Savefile.aspx";
        PageOfficeCtrl1.WebOpen("doc/" + fileName, PageOffice.OpenModeType.docNormalEdit, "张三");
    }
示例#18
0
 protected void PageOfficeCtrl1_Load(object sender, EventArgs e)
 {
     // 设置PageOffice组件服务页面
     PageOfficeCtrl1.ServerPage = Request.ApplicationPath + "/pageoffice/server.aspx";
     // 设置保存文件页面
     PageOfficeCtrl1.AddCustomToolButton("保存", "SaveFile()", 1);
     PageOfficeCtrl1.SaveFilePage = "SaveFile.aspx";
     // 打开文档
     PageOfficeCtrl1.WebOpen("doc/test.xls", PageOffice.OpenModeType.xlsNormalEdit, "Tom");
 }
示例#19
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string fileName = "zhengshi.doc";//正式发文文件

        PageOfficeCtrl1.AddCustomToolButton("另存到本地", "ShowDialog(0)", 5);
        PageOfficeCtrl1.AddCustomToolButton("页面设置", "ShowDialog(1)", 0);
        PageOfficeCtrl1.AddCustomToolButton("打印", "ShowDialog(2)", 6);
        PageOfficeCtrl1.AddCustomToolButton("全屏/还原", "IsFullScreen()", 4);
        PageOfficeCtrl1.ServerPage = Request.ApplicationPath + "/pageoffice/server.aspx"; //此行必须
        PageOfficeCtrl1.WebOpen("doc/" + fileName, PageOffice.OpenModeType.docReadOnly, "张三");
    }
示例#20
0
    protected void Page_Load(object sender, EventArgs e)
    {
        // 设置PageOffice组件服务页面
        PageOfficeCtrl1.ServerPage = Request.ApplicationPath + "/pageoffice/server.aspx";

        // 添加一个自定义工具条上的按钮,AddCustomToolButton的参数说明,详见开发帮助。
        PageOfficeCtrl1.AddCustomToolButton("插入分页符", " InsertPageBreak()", 1);

        // 打开文档
        PageOfficeCtrl1.WebOpen("doc/test.doc", PageOffice.OpenModeType.docNormalEdit, "Tom");
    }
示例#21
0
    protected void Page_Load(object sender, EventArgs e)
    {
        docID = Request.QueryString["ID"];

        string          connString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|demo.mdb";
        OleDbConnection conn       = new OleDbConnection(connString);

        conn.Open();

        string       sql = "select * from leaveRecord where ID=" + docID;
        OleDbCommand cmd = new OleDbCommand(sql, conn);

        cmd.CommandType = CommandType.Text;
        OleDbDataReader Reader = cmd.ExecuteReader();

        if (Reader.Read())
        {
            docFile       = Reader["FileName"].ToString();
            docName       = Reader["Name"].ToString();
            docDept       = Reader["Dept"].ToString();
            docCause      = Reader["Cause"].ToString();
            docNum        = Reader["Num"].ToString();
            docSubmitTime = DateTime.Parse(Reader["SubmitTime"].ToString());
        }
        Reader.Close();
        conn.Close();

        //-----------  PageOffice 服务器端编程开始  -------------------//

        PageOffice.WordWriter.WordDocument doc = new PageOffice.WordWriter.WordDocument();
        doc.DisableWindowRightClick          = true;
        doc.OpenDataRegion("PO_name").Value  = docName;
        doc.OpenDataRegion("PO_dept").Value  = docDept;
        doc.OpenDataRegion("PO_cause").Value = docCause;
        doc.OpenDataRegion("PO_num").Value   = docNum;
        doc.OpenDataRegion("PO_date").Value  = docSubmitTime.ToLongDateString();
        doc.OpenDataRegion("PO_tip").Value   = "";;

        // 设置PageOffice组件服务页面
        PageOfficeCtrl1.ServerPage = "pageoffice/server.aspx";

        // 设置界面样式
        PageOfficeCtrl1.Caption     = "动态生成格式文件";
        PageOfficeCtrl1.BorderStyle = PageOffice.BorderStyleType.BorderThin;
        // 添加自定义工具条按钮
        PageOfficeCtrl1.AddCustomToolButton("打印", "poPrint", 6);
        PageOfficeCtrl1.AddCustomToolButton("全屏/还原", "poSetFullScreen", 4);

        ////获取数据对象
        PageOfficeCtrl1.SetWriter(doc);
        // 打开文档
        PageOfficeCtrl1.WebOpen("doc/template.doc", PageOffice.OpenModeType.docReadOnly, "Tom");
        //-----------  PageOffice 服务器端编程结束  -------------------//
    }
示例#22
0
    protected void PageOfficeCtrl1_Load(object sender, EventArgs e)
    {
        //PageOffice组件的引用
        //首先确保已安装了pageoffice服务器端组件,且在项目中已添加了pageoffice文件夹,
        //在该文件夹中已存在posetup.exe和server.aspx服务器端页面,再在前台页面中引入PageOfficeCtrl控件

        //设置服务器页面
        PageOfficeCtrl1.ServerPage = Request.ApplicationPath + "/pageoffice/server.aspx";
        PageOfficeCtrl1.AddCustomToolButton("显示/隐藏标尺", "Hidden()", 7);
        //打开文件
        PageOfficeCtrl1.WebOpen("doc/template.doc", PageOffice.OpenModeType.docNormalEdit, "张佚名");
    }
示例#23
0
 protected void Page_Load(object sender, EventArgs e)
 {
     // 设置PageOffice组件服务页面
     PageOfficeCtrl1.ServerPage = Request.ApplicationPath + "/pageoffice/server.aspx";
     PageOfficeCtrl1.JsFunction_AfterDocumentOpened = "AfterDocumentOpened()";
     PageOfficeCtrl1.AddCustomToolButton("保存", "Save()", 1);
     PageOfficeCtrl1.OfficeToolbars = false;
     // 设置保存文件页面
     PageOfficeCtrl1.SaveFilePage = "SaveFile.aspx";
     // 打开文档
     PageOfficeCtrl1.WebOpen("doc/test.doc", PageOffice.OpenModeType.docRevisionOnly, "Tom");
 }
示例#24
0
    protected void Page_Load(object sender, EventArgs e)
    {
        // 设置PageOffice组件服务页面
        PageOfficeCtrl1.ServerPage = Request.ApplicationPath + "/pageoffice/server.aspx";
        // 设置保存文件页面
        PageOfficeCtrl1.SaveFilePage = "SaveFile.aspx";

        // 添加一个自定义工具条上的按钮,AddCustomToolButton的参数说明,详见开发帮助。
        PageOfficeCtrl1.AddCustomToolButton("测试按钮", "myTest", 0);

        // 打开文档
        PageOfficeCtrl1.WebOpen("doc/test.doc", PageOffice.OpenModeType.docNormalEdit, "Tom");
    }
示例#25
0
    protected void Page_Load(object sender, EventArgs e)
    {
        PageOfficeCtrl1.ServerPage = Request.ApplicationPath + "/pageoffice/server.aspx";
        // Create custom toolbar
        PageOfficeCtrl1.AddCustomToolButton("保存", "SaveDocument()", 1);
        PageOfficeCtrl1.AddCustomToolButton("显示A文档", "ShowFile1View()", 0);
        PageOfficeCtrl1.AddCustomToolButton("显示B文档", "ShowFile2View()", 0);
        PageOfficeCtrl1.AddCustomToolButton("显示比较结果", "ShowCompareView()", 0);

        PageOfficeCtrl1.SaveFilePage = "SaveFile.aspx";

        PageOfficeCtrl1.WordCompare("doc/aaa1.doc", "doc/aaa2.doc", PageOffice.OpenModeType.docAdmin, "Tom");
    }
示例#26
0
 protected void Page_Load(object sender, EventArgs e)
 {
     //获取index.aspx页面传递过来参数的值
     userName = Session["userName"].ToString();
     //获取index.aspx用?传递过来的id的值
     id = Request.QueryString["id"];
     // 设置PageOffice组件服务页面
     PageOfficeCtrl1.ServerPage = Request.ApplicationPath + "/pageoffice/server.aspx";
     PageOfficeCtrl1.AddCustomToolButton("保存", "Save()", 1);
     // 设置保存文件页面
     PageOfficeCtrl1.SaveFilePage = "SaveFile.aspx";
     // 打开文档
     PageOfficeCtrl1.WebOpen("doc/test.doc", PageOffice.OpenModeType.docNormalEdit, "Tom");
 }
示例#27
0
    protected void Page_Load(object sender, EventArgs e)
    {
        txt = Session["txt"].ToString();

        // 设置PageOffice组件服务页面
        PageOfficeCtrl1.ServerPage = Request.ApplicationPath + "/pageoffice/server.aspx";
        // 设置保存文件页面
        PageOfficeCtrl1.SaveFilePage = "SaveFile.aspx";

        PageOfficeCtrl1.AddCustomToolButton("保存并关闭", "Save()", 1);

        // 打开文档
        PageOfficeCtrl1.WebOpen("doc/test.doc", PageOffice.OpenModeType.docNormalEdit, "Tom");
    }
示例#28
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //PageOffice组件的引用
        //首先确保已安装了pageoffice服务器端组件,且在项目中已添加了pageoffice文件夹,
        //在该文件夹中已存在posetup.exe和server.aspx服务器端页面,再在前台页面中引入PageOfficeCtrl控件

        //设置服务器页面
        PageOfficeCtrl1.ServerPage = Request.ApplicationPath + "/pageoffice/server.aspx";
        PageOfficeCtrl1.AddCustomToolButton("定位光标书签", "locateBookMark();", 5);
        string fileName = "template.doc";

        //打开文件
        PageOfficeCtrl1.WebOpen(Server.MapPath("doc/") + fileName, PageOffice.OpenModeType.docNormalEdit, "张佚名");
    }
示例#29
0
 protected void Page_Load(object sender, EventArgs e)
 {
     // 设置PageOffice组件服务页面
     PageOfficeCtrl1.ServerPage = Request.ApplicationPath + "/pageoffice/server.aspx";
     //添加自定义的保存按钮
     PageOfficeCtrl1.AddCustomToolButton("保存图片", "Save", 1);
     PageOffice.WordWriter.WordDocument wordDoc     = new PageOffice.WordWriter.WordDocument();
     PageOffice.WordWriter.DataRegion   dataRegion1 = wordDoc.OpenDataRegion("PO_image");
     dataRegion1.Editing = true;//放图片的数据区域是可以编辑的,其它部分不可编辑
     PageOfficeCtrl1.SetWriter(wordDoc);
     //设置数据提交的保存页面
     PageOfficeCtrl1.SaveDataPage = "SaveData.aspx";
     // 打开文档
     PageOfficeCtrl1.WebOpen("doc/test.doc", PageOffice.OpenModeType.docSubmitForm, "Tom");
 }
示例#30
0
 protected void PageOfficeCtrl1_Load(object sender, EventArgs e)
 {
     PageOffice.ExcelWriter.Workbook wb     = new PageOffice.ExcelWriter.Workbook();
     PageOffice.ExcelWriter.Sheet    sheet1 = wb.OpenSheet("Sheet1");
     //设置当工作表只读时,是否允许用户手动调整行列。
     sheet1.AllowAdjustRC = true;
     // 设置PageOffice组件服务页面
     PageOfficeCtrl1.ServerPage = Request.ApplicationPath + "/pageoffice/server.aspx";
     PageOfficeCtrl1.AddCustomToolButton("保存", "Save()", 1);
     // 设置保存文件页面
     PageOfficeCtrl1.SaveFilePage = "SaveFile.aspx";
     PageOfficeCtrl1.SetWriter(wb);
     // 打开文档
     PageOfficeCtrl1.WebOpen("doc/test.xls", PageOffice.OpenModeType.xlsReadOnly, "Tom");
 }