示例#1
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");
    }
示例#2
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");
    }
示例#3
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, "张三");
    }
示例#4
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, "张佚名");
    }
示例#5
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");
    }
示例#6
0
    protected void Page_Load(object sender, EventArgs e)
    {
        WordDocument doc = new WordDocument();

        PageOffice.WordWriter.Table table1 = doc.OpenDataRegion("PO_T001").OpenTable(1);
        table1.OpenCellRC(1, 1).Value = "[image]doc/wang.gif[/image]";

        int oldRowCount  = 3; //表格中原有的行数
        int dataRowCount = 5; //要填充数据的行数

        // 扩充表格
        for (int j = 0; j < dataRowCount - oldRowCount; j++)
        {
            table1.InsertRowAfter(table1.OpenCellRC(2, 5));  //在第2行的最后一个单元格下插入新行
        }

        // 填充数据
        int i = 1;

        while (i <= dataRowCount)
        {
            table1.OpenCellRC(i, 2).Value = "AA" + i.ToString();
            table1.OpenCellRC(i, 3).Value = "BB" + i.ToString();
            table1.OpenCellRC(i, 4).Value = "CC" + i.ToString();
            table1.OpenCellRC(i, 5).Value = "DD" + i.ToString();
            i++;
        }
        PageOfficeCtrl1.SetWriter(doc);
        PageOfficeCtrl1.ServerPage = Request.ApplicationPath + "/pageoffice/server.aspx";
        PageOfficeCtrl1.WebOpen("doc/test_table.doc", PageOffice.OpenModeType.docNormalEdit, "张佚名");
    }
示例#7
0
 protected void Page_Load(object sender, EventArgs e)
 {
     //设置服务器页面
     PageOfficeCtrl1.ServerPage = Request.ApplicationPath + "/pageoffice/server.aspx"; //此行必须
     //设置文档打开方式
     PageOfficeCtrl1.WebOpen("doc/test.doc", PageOffice.OpenModeType.docSubmitForm, "张三");
 }
示例#8
0
    protected void Page_Load(object sender, EventArgs e)
    {
        PageOfficeCtrl1.ServerPage = Request.ApplicationPath + "/pageoffice/server.aspx";
        string id = Request.QueryString["id"];

        PageOfficeCtrl1.SaveFilePage = "SaveFile.aspx?id=" + id;
        PageOfficeCtrl1.WebOpen("Openfile.aspx?id=" + id, PageOffice.OpenModeType.docNormalEdit, "someBody");
    }
示例#9
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, "张三");
 }
示例#10
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, "操作人姓名");
    }
示例#11
0
 protected void PageOfficeCtrl1_Load(object sender, EventArgs e)
 {
     // 设置PageOffice组件服务页面
     PageOfficeCtrl1.ServerPage = Request.ApplicationPath + "/pageoffice/server.aspx";
     // 设置保存文件页面
     PageOfficeCtrl1.SaveFilePage = "SaveFile.aspx";
     // 打开文档
     PageOfficeCtrl1.WebOpen(filePath, PageOffice.OpenModeType.docNormalEdit, "Tom");
 }
示例#12
0
 protected void PageOfficeCtrl1_Load(object sender, EventArgs e)
 {
     // 设置PageOffice组件服务页面
     PageOfficeCtrl1.ServerPage = "pageoffice/server.aspx";
     // 设置保存文件页面
     PageOfficeCtrl1.SaveFilePage = "SaveFile.aspx";
     // 打开文档
     PageOfficeCtrl1.WebOpen("doc/test.doc", PageOffice.OpenModeType.docNormalEdit, "Tom");
 }
示例#13
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, "张佚名");
    }
示例#14
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");
 }
示例#15
0
 protected void PageOfficeCtrl1_Load(object sender, EventArgs e)
 {
     // 设置PageOffice组件服务页面
     PageOfficeCtrl1.ServerPage = Request.ApplicationPath + "/pageoffice/server.aspx";
     // 设置保存文件页面
     PageOfficeCtrl1.SaveFilePage = "SaveFile.aspx";
     PageOfficeCtrl1.JsFunction_AfterDocumentOpened = "AfterDocumentOpened()";
     // 打开文档
     PageOfficeCtrl1.WebOpen("doc/test.doc", PageOffice.OpenModeType.docNormalEdit, "Tom");
 }
示例#16
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");
 }
示例#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)
    {
        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");
    }
示例#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)
 {
     PageOfficeCtrl1.Titlebar       = false; //隐藏标题栏
     PageOfficeCtrl1.Menubar        = false; //隐藏菜单栏
     PageOfficeCtrl1.OfficeToolbars = false; //隐藏Office工具栏
     PageOfficeCtrl1.CustomToolbar  = false; //隐藏自定义工具栏
     //设置服务器页面
     PageOfficeCtrl1.ServerPage = Request.ApplicationPath + "/pageoffice/server.aspx";
     //打开文件
     PageOfficeCtrl1.WebOpen("doc/template.doc", PageOffice.OpenModeType.docReadOnly, "张佚名");
 }
示例#22
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 服务器端编程结束  -------------------//
    }
示例#23
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, "张佚名");
    }
示例#24
0
 protected void Page_Load(object sender, EventArgs e)
 {
     TextBox1.Text = "sub myfunc() \r\n"
                     + "msgbox \"123\" \r\n"
                     + "end sub";
     // 设置PageOffice组件服务页面
     PageOfficeCtrl1.ServerPage = Request.ApplicationPath + "/pageoffice/server.aspx";
     // 设置保存文件页面
     PageOfficeCtrl1.SaveFilePage = "SaveFile.aspx";
     // 打开文档
     PageOfficeCtrl1.WebOpen("doc/test.doc", PageOffice.OpenModeType.docNormalEdit, "Tom");
 }
示例#25
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");
 }
示例#26
0
    protected void Page_Load(object sender, EventArgs e)
    {
        PageOfficeCtrl1.ServerPage = Request.ApplicationPath + "/pageoffice/server.aspx";

        // 设置文件保存之前执行的事件
        PageOfficeCtrl1.JsFunction_BeforeDocumentSaved = "BeforeDocumentSaved()";
        // 设置文件保存之后执行的事件
        PageOfficeCtrl1.JsFunction_AfterDocumentSaved = "AfterDocumentSaved()";

        PageOfficeCtrl1.SaveFilePage = "SaveFile.aspx";
        PageOfficeCtrl1.WebOpen("doc/test.doc", PageOffice.OpenModeType.docNormalEdit, "Tom");
    }
示例#27
0
    protected void PageOfficeCtrl1_Load(object sender, EventArgs e)
    {
        // 设置PageOffice组件服务页面
        PageOfficeCtrl1.ServerPage = Request.ApplicationPath + "/pageoffice/server.aspx";

        PageOfficeCtrl1.OfficeToolbars = false;
        //PageOfficeCtrl1.Menubar = false; // 隐藏菜单栏
        PageOfficeCtrl1.JsFunction_AfterDocumentOpened = "AfterDocumentOpened";
        PageOfficeCtrl1.AllowCopy = false;  // 禁止拷贝
        // 打开文档
        PageOfficeCtrl1.WebOpen("doc/test.doc", PageOffice.OpenModeType.docReadOnly, "Tom");
    }
示例#28
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");
    }
示例#29
0
    protected void Page_Load(object sender, EventArgs e)
    {
        PageOffice.WordWriter.WordDocument wordDoc = new PageOffice.WordWriter.WordDocument();

        wordDoc.OpenDataRegion("PO_company").Value = "北京幻想科技有限公司";
        wordDoc.OpenDataRegion("PO_logo").Value    = "[image]doc/logo.gif[/image]";
        wordDoc.OpenDataRegion("PO_dr1").Value     = "左边的文本:xxxx";

        PageOfficeCtrl1.SetWriter(wordDoc);// 注意不要忘记此代码,如果缺少此句代码,不会赋值成功。
        //设置服务器页面
        PageOfficeCtrl1.ServerPage = Request.ApplicationPath + "/pageoffice/server.aspx";
        PageOfficeCtrl1.WebOpen("doc/test.doc", PageOffice.OpenModeType.docNormalEdit, "文档操作人姓名");
    }
示例#30
0
    protected void PageOfficeCtrl1_Load(object sender, EventArgs e)
    {
        //PageOffice组件的引用
        //首先确保已安装了pageoffice服务器端组件,且在项目中已添加了pageoffice文件夹,
        //在该文件夹中已存在posetup.exe和server.aspx服务器端页面,再在前台页面中引入PageOfficeCtrl控件

        //设置服务器页面
        PageOfficeCtrl1.ServerPage = Request.ApplicationPath + "/pageoffice/server.aspx";
        //设置PageOfficeCtrl的Theme属性,该属性默认的主题类型是Office2007类型,ThemeType为枚举类型,用户可自行选择相应类型
        PageOfficeCtrl1.Theme = PageOffice.ThemeType.Office2010;
        //打开文件
        PageOfficeCtrl1.WebOpen(Server.MapPath("doc/test.doc"), PageOffice.OpenModeType.docNormalEdit, "张佚名");
    }