Ejemplo n.º 1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        AceoffixCtrl1.ServerPage  = "../aceoffix-runtime/server.aspx";
        AceoffixCtrl1.Theme       = Aceoffix.ThemeType.Office2007;
        AceoffixCtrl1.BorderStyle = Aceoffix.BorderStyleType.BorderThin;
        Aceoffix.WordWriter.WordDocument doc = new Aceoffix.WordWriter.WordDocument();

        Aceoffix.WordWriter.DataRegion dataReg = doc.OpenDataRegion("test");
        dataReg.Shading.BackgroundPatternColor = Color.Pink;

        AceoffixCtrl1.Bind(doc);
        AceoffixCtrl1.AddCustomToolButton("Save", "SaveDocument()", 1);
        AceoffixCtrl1.JsFunction_OnWordDataRegionClick = "OnWordDataRegionClick()";
        AceoffixCtrl1.OfficeToolbars = false;
        AceoffixCtrl1.SaveFilePage   = "savefile.aspx";

        AceoffixCtrl1.OpenDocument("doc/test.doc", Aceoffix.OpenModeType.docSubmitForm, "Tom");
    }
Ejemplo n.º 2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        AceoffixCtrl1.ServerPage  = "../aceoffix-runtime/server.aspx";
        AceoffixCtrl1.Theme       = Aceoffix.ThemeType.Office2007;
        AceoffixCtrl1.BorderStyle = Aceoffix.BorderStyleType.BorderThin;
        Aceoffix.WordWriter.WordDocument doc = new Aceoffix.WordWriter.WordDocument();

        Aceoffix.WordWriter.DataRegion data1 = doc.OpenDataRegion("Text1");
        data1.Value = "Aceoffix";

        Aceoffix.WordWriter.DataRegion data2 = doc.OpenDataRegion("Text2");
        data2.Value = "[image]doc/image.png[/image]";

        AceoffixCtrl1.Bind(doc);
        AceoffixCtrl1.CustomToolbar = false;
        AceoffixCtrl1.Menubar       = false;

        AceoffixCtrl1.OpenDocument("doc/test.doc", Aceoffix.OpenModeType.docNormalEdit, "Tom");
    }
Ejemplo n.º 3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        AceoffixCtrl1.ServerPage = "../aceoffix-runtime/server.aspx";

        Aceoffix.WordWriter.WordDocument wd          = new Aceoffix.WordWriter.WordDocument();
        Aceoffix.WordWriter.DataRegion   dataRegion1 = wd.OpenDataRegion("Name");
        dataRegion1.Editing = true;
        dataRegion1.Value   = "Tom";
        Aceoffix.WordWriter.DataRegion dataRegion3 = wd.OpenDataRegion("Department");
        dataRegion3.Editing = true;
        dataRegion3.Value   = "Development";


        AceoffixCtrl1.Bind(wd);
        AceoffixCtrl1.AddCustomToolButton("Save", "SaveDocument()", 1);
        AceoffixCtrl1.SaveDataPage = "savedata.aspx"; //Key code in this demo.
        AceoffixCtrl1.SaveFilePage = "savefile.aspx"; //Key code in this demo.

        AceoffixCtrl1.OpenDocument("doc/test.doc", Aceoffix.OpenModeType.docSubmitForm, "John Scott");
    }
Ejemplo n.º 4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        AceoffixCtrl1.ServerPage = "../aceoffix-runtime/server.aspx";

        Aceoffix.WordWriter.WordDocument doc    = new Aceoffix.WordWriter.WordDocument();
        Aceoffix.WordWriter.DataRegion   dTable = doc.OpenDataRegion("table");
        dTable.Editing = true;
        Aceoffix.WordWriter.Table table1 = doc.OpenDataRegion("Table").OpenTable(1);

        table1.OpenCellRC(1, 2).Value = "Product 1";
        table1.OpenCellRC(1, 3).Value = "Product 2";
        table1.OpenCellRC(2, 1).Value = "A";
        table1.OpenCellRC(3, 1).Value = "B";

        AceoffixCtrl1.AddCustomToolButton("Save", "Save", 1);
        AceoffixCtrl1.AddCustomToolButton("Full-screen Switch", "IsFullScreen", 4);
        AceoffixCtrl1.Bind(doc);
        AceoffixCtrl1.SaveDataPage = "savedata.aspx";
        AceoffixCtrl1.OpenDocument("doc/test.doc", Aceoffix.OpenModeType.docSubmitForm, "John Scott");
    }
Ejemplo n.º 5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        AceoffixCtrl1.ServerPage = "../aceoffix-runtime/server.aspx";

        Aceoffix.WordWriter.WordDocument wd          = new Aceoffix.WordWriter.WordDocument();
        Aceoffix.WordWriter.DataRegion   dataRegion1 = wd.OpenDataRegion("Paragraph1");
        dataRegion1.SubmitAsFile = true;
        dataRegion1.Editing      = true;
        Aceoffix.WordWriter.DataRegion dataRegion2 = wd.OpenDataRegion("Paragraph2");
        dataRegion2.SubmitAsFile = true;
        dataRegion2.Editing      = true;
        Aceoffix.WordWriter.DataRegion dataRegion3 = wd.OpenDataRegion("Paragraph3");
        dataRegion3.SubmitAsFile = true;
        dataRegion3.Editing      = true;

        AceoffixCtrl1.Bind(wd);
        AceoffixCtrl1.AddCustomToolButton("Save", "SaveDocument()", 1);
        AceoffixCtrl1.SaveDataPage = "savedata.aspx";
        AceoffixCtrl1.OpenDocument("doc/split.doc", Aceoffix.OpenModeType.docSubmitForm, "John Scott");
    }
Ejemplo n.º 6
0
    protected void Page_Load(object sender, EventArgs e)
    {
        userName = Request.QueryString["userName"];

        AceoffixCtrl1.ServerPage  = "../aceoffix-runtime/server.aspx";
        AceoffixCtrl1.Theme       = Aceoffix.ThemeType.Office2007;
        AceoffixCtrl1.BorderStyle = Aceoffix.BorderStyleType.BorderThin;


        Aceoffix.WordWriter.WordDocument doc = new Aceoffix.WordWriter.WordDocument();

        Aceoffix.WordWriter.DataRegion data1 = doc.OpenDataRegion("Paragraph1");
        data1.Value        = "[word]doc/paragraph1.doc[/word]";
        data1.SubmitAsFile = true;
        Aceoffix.WordWriter.DataRegion data2 = doc.OpenDataRegion("Paragraph2");
        data2.Value        = "[word]doc/paragraph2.doc[/word]";
        data2.SubmitAsFile = true;
        Aceoffix.WordWriter.DataRegion data3 = doc.OpenDataRegion("Paragraph3");
        data3.Value = "[word]doc/paragraph3.doc[/word]";

        if (userName.Equals("Tom"))
        {
            data1.Editing = true;
            data2.Editing = false;
            data3.Editing = false;
        }
        else
        {
            data1.Editing = false;
            data2.Editing = true;
            data3.Editing = false;
        }

        AceoffixCtrl1.Bind(doc);
        AceoffixCtrl1.AddCustomToolButton("Save", "SaveDocument()", 1);

        AceoffixCtrl1.SaveDataPage = "savedata.aspx?userName="******"doc/merge.doc", Aceoffix.OpenModeType.docSubmitForm, userName);
    }
Ejemplo n.º 7
0
    protected void Page_Load(object sender, EventArgs e)
    {
        AceoffixCtrl1.ServerPage = "../aceoffix-runtime/server.aspx";

        AceoffixCtrl1.Theme         = Aceoffix.ThemeType.Office2007;
        AceoffixCtrl1.BorderStyle   = Aceoffix.BorderStyleType.BorderThin;
        AceoffixCtrl1.CustomToolbar = false;
        AceoffixCtrl1.Menubar       = false;

        Aceoffix.WordWriter.WordDocument wd     = new Aceoffix.WordWriter.WordDocument();
        Aceoffix.WordWriter.DataRegion   image1 = wd.OpenDataRegion("Image1");
        image1.Value = "[image]doc/image1.png[/image]";
        Aceoffix.WordWriter.DataRegion image2 = wd.OpenDataRegion("Image2");
        image2.Value = "[image]doc/image2.png[/image]";
        Aceoffix.WordWriter.DataRegion data1 = wd.OpenDataRegion("Paragraph1");
        data1.Value = "[word]doc/paragraph1.doc[/word]";
        Aceoffix.WordWriter.DataRegion data2 = wd.OpenDataRegion("Paragraph2");
        data2.Value = "[word]doc/paragraph2.doc[/word]";
        Aceoffix.WordWriter.DataRegion data3 = wd.OpenDataRegion("Paragraph3");
        data3.Value = "[word]doc/paragraph3.doc[/word]";

        AceoffixCtrl1.Bind(wd);
        AceoffixCtrl1.OpenDocument("doc/merge.doc", Aceoffix.OpenModeType.docNormalEdit, "John Scott");
    }
Ejemplo n.º 8
0
    protected void Page_Load(object sender, EventArgs e)
    {
        AceoffixCtrl1.ServerPage  = "../aceoffix-runtime/server.aspx";
        AceoffixCtrl1.Theme       = Aceoffix.ThemeType.Office2007;
        AceoffixCtrl1.BorderStyle = Aceoffix.BorderStyleType.BorderThin;
        Aceoffix.WordWriter.WordDocument doc = new Aceoffix.WordWriter.WordDocument();

        Aceoffix.WordWriter.DataRegion data1 = doc.OpenDataRegion("Name");
        data1.Value      = "Tom";
        data1.Font.Color = Color.Blue;
        data1.Font.Size  = 24;
        data1.Font.Name  = "Berlin Sans FB Demi";
        data1.Font.Bold  = true;

        Aceoffix.WordWriter.DataRegion data2 = doc.OpenDataRegion("Department");
        data2.Value      = "Sales Department";
        data2.Font.Color = Color.Red;

        AceoffixCtrl1.Bind(doc);
        AceoffixCtrl1.CustomToolbar = false;
        AceoffixCtrl1.Menubar       = false;

        AceoffixCtrl1.OpenDocument("doc/test.doc", Aceoffix.OpenModeType.docNormalEdit, "Tom");
    }
Ejemplo n.º 9
0
    protected void Page_Load(object sender, EventArgs e)
    {
        AceoffixCtrl1.ServerPage = "../aceoffix-runtime/server.aspx";

        AceoffixCtrl1.Theme       = Aceoffix.ThemeType.Office2007;
        AceoffixCtrl1.BorderStyle = Aceoffix.BorderStyleType.BorderThin;
        AceoffixCtrl1.AddCustomToolButton("save", "SaveDocument()", 1);
        AceoffixCtrl1.Menubar = false;

        Aceoffix.WordWriter.WordDocument wd    = new Aceoffix.WordWriter.WordDocument();
        Aceoffix.WordWriter.DataRegion   title = wd.CreateDataRegion("title",
                                                                     Aceoffix.WordWriter.DataRegionInsertType.After, "[home]");
        title.Font.Bold   = true;
        title.Font.Size   = 20;
        title.Font.Name   = "Aharoni";
        title.Font.Italic = false;

        Aceoffix.WordWriter.ParagraphFormat titlePara = title.ParagraphFormat;
        titlePara.Alignment = Aceoffix.WordWriter.WdParagraphAlignment.wdAlignParagraphCenter;

        Aceoffix.WordWriter.DataRegion body = wd.CreateDataRegion("body",
                                                                  Aceoffix.WordWriter.DataRegionInsertType.After, "title");
        body.Font.Bold   = false;
        body.Font.Italic = true;
        body.Font.Size   = 10;
        body.Font.Name   = "Berlin Sans FB Demi";
        body.Font.Color  = Color.Red;
        body.Value       = "Aceoffix is a flexible and professional web component for Microsoft Office, with the simplified interfaces and powerful functions that make it terrific not only for online editing and saving Office documents, but also importing and exporting data from database to Office documents. Aceoffix supports many Office document formats, such as *.doc, *.docx, *.xls, *.xlsx, *.ppt, *.pptx, *.xml and *.rtf. \n";
        Aceoffix.WordWriter.ParagraphFormat bodyPara = body.ParagraphFormat;
        bodyPara.LineSpacingRule = Aceoffix.WordWriter.WdLineSpacing.wdLineSpaceAtLeast;
        bodyPara.Alignment       = Aceoffix.WordWriter.WdParagraphAlignment.wdAlignParagraphLeft;
        bodyPara.FirstLineIndent = 21;
        Aceoffix.WordWriter.DataRegion body2 = wd.CreateDataRegion("body2",
                                                                   Aceoffix.WordWriter.DataRegionInsertType.After, "body");
        body2.Font.Bold = false;
        body2.Font.Size = 12;
        body2.Font.Name = "Arial Rounded MT Bold";
        body2.Value     = "Without installing Microsoft Office at the server side, web developers can easily embed and call Microsoft Office in web pages, just like using a Java or .Net control. Aceoffix edits the real Microsoft Office documents online without converting any formats. Intuitive examples with source code are included to speed up your development time.  In general management systems base on Browser/Server architecture, developers have to manage Word/Excel documents by downloading and uploading. With Aceoffix, you can not only online view, edit and save Office documents on web, but also access the contents of them. In addition, Aceoffix has many other powerful functions as well, like read-only control, authority control, editable region control, forced revision mode, generating formal documents and etc.\n";
        Aceoffix.WordWriter.ParagraphFormat bodyPara2 = body2.ParagraphFormat;
        bodyPara2.LineSpacingRule = Aceoffix.WordWriter.WdLineSpacing.wdLineSpace1pt5;
        bodyPara2.Alignment       = Aceoffix.WordWriter.WdParagraphAlignment.wdAlignParagraphLeft;
        bodyPara2.FirstLineIndent = 21;
        Aceoffix.WordWriter.DataRegion body3 = wd.CreateDataRegion("body3",
                                                                   Aceoffix.WordWriter.DataRegionInsertType.After, "body2");
        body3.Font.Bold  = false;
        body3.Font.Color = Color.Orange;
        body3.Font.Size  = 14;
        body3.Font.Name  = "Broadway";
        body3.Value      = "Aceoffix includes a group of easy-to-use components. They are the object modules that are developed based on commonly used functions of Word/Excel. These components have the complete objects hierarchies. Developer will be able to understand and handle them easily. With simple code, they can accomplish the functions of Microsoft Office that they could hardly achieve before. Developers will be able to create their own business components based on these components as well. Developers do not have to face with the complex interfaces of Microsoft Office COM automation and VBA (Visual Basic for Applications). They will be able to save their time with Aceoffix. We make it easy to call the components of Aceoffix, and we insist on continuing efforts to keep the simplest calling interfaces of Aceoffix.\n";
        Aceoffix.WordWriter.ParagraphFormat bodyPara3 = body3.ParagraphFormat;
        bodyPara3.LineSpacingRule = Aceoffix.WordWriter.WdLineSpacing.wdLineSpaceDouble;
        bodyPara3.Alignment       = Aceoffix.WordWriter.WdParagraphAlignment.wdAlignParagraphLeft;
        bodyPara3.FirstLineIndent = 21;
        Aceoffix.WordWriter.DataRegion body4 = wd.CreateDataRegion("body4",
                                                                   Aceoffix.WordWriter.DataRegionInsertType.After, "body3");
        body4.Value = "[image]doc/image.png[/image]";
        Aceoffix.WordWriter.ParagraphFormat bodyPara4 = body4.ParagraphFormat;
        bodyPara4.Alignment = Aceoffix.WordWriter.WdParagraphAlignment.wdAlignParagraphCenter;

        AceoffixCtrl1.Bind(wd);
        AceoffixCtrl1.JsFunction_AfterDocumentSaved = "SaveOK()";
        AceoffixCtrl1.SaveFilePage = "savefile.aspx";

        AceoffixCtrl1.OpenDocument("doc/merge.doc", Aceoffix.OpenModeType.docNormalEdit, "John Scott");
    }
Ejemplo n.º 10
0
    protected void Page_Load(object sender, EventArgs e)
    {
        docID = Request.QueryString["ID"];

        string          connString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|demo2.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();
            docDays       = Reader["Num"].ToString();
            docSubmitTime = DateTime.Parse(Reader["SubmitTime"].ToString());
        }
        Reader.Close();
        conn.Close();



        Aceoffix.WordWriter.WordDocument doc    = new Aceoffix.WordWriter.WordDocument();
        Aceoffix.WordWriter.DataRegion   drName = doc.OpenDataRegion("name");
        drName.Value   = docName;
        drName.Editing = true;
        Aceoffix.WordWriter.DataRegion drDept = doc.OpenDataRegion("dept");
        drDept.Value = docDept;
        drDept.Shading.BackgroundPatternColor = Color.Gray;
        //drDept.setEditing(true);
        Aceoffix.WordWriter.DataRegion drCause = doc.OpenDataRegion("cause");
        drCause.Value   = docCause;
        drCause.Editing = true;
        Aceoffix.WordWriter.DataRegion drNum = doc.OpenDataRegion("days");
        drNum.Value   = docDays;
        drNum.Editing = true;
        Aceoffix.WordWriter.DataRegion drDate = doc.OpenDataRegion("date");
        drDate.Value = docSubmitTime.ToLongDateString();
        drDate.Shading.BackgroundPatternColor = Color.Pink;
        Aceoffix.WordWriter.DataRegion toDate = doc.OpenDataRegion("ToDate");
        toDate.Editing = true;
        toDate.Value   = docSubmitTime.ToLongDateString();

        AceoffixCtrl1.ServerPage  = "../aceoffix-runtime/server.aspx";
        AceoffixCtrl1.BorderStyle = Aceoffix.BorderStyleType.BorderThin;

        AceoffixCtrl1.AddCustomToolButton("Save", "poSave()", 1);
        AceoffixCtrl1.AddCustomToolButton("Full-screen Switch", "poSetFullScreen()", 4);

        AceoffixCtrl1.OfficeToolbars = false;
        AceoffixCtrl1.Menubar        = false;

        AceoffixCtrl1.JsFunction_OnWordDataRegionClick = "OnWordDataRegionClick()";

        AceoffixCtrl1.SaveDataPage = "SaveData.aspx?ID=" + docID;

        AceoffixCtrl1.Bind(doc);

        AceoffixCtrl1.OpenDocument("doc/template.doc", Aceoffix.OpenModeType.docSubmitForm, "Tom");
    }