Exemplo n.º 1
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   paragraph1 = doc.OpenDataRegion("Paragraph1");
        paragraph1.Font.Color = Color.Blue;                                                                     //Font Color
        paragraph1.Font.Name  = "Arial Rounded MT Bold";                                                        // Font Style
        paragraph1.Font.Size  = 16;
        paragraph1.ParagraphFormat.Alignment = Aceoffix.WordWriter.WdParagraphAlignment.wdAlignParagraphCenter; //Alignment

        Aceoffix.WordWriter.DataRegion paragraph2 = doc.OpenDataRegion("Paragraph2");
        paragraph2.Font.Color = Color.Orange;                                                                 //Font Color
        paragraph2.Font.Name  = "Algerian";                                                                   // Font Style
        paragraph2.Font.Size  = 14;
        paragraph2.ParagraphFormat.Alignment = Aceoffix.WordWriter.WdParagraphAlignment.wdAlignParagraphLeft; //Alignment

        Aceoffix.WordWriter.DataRegion paragraph3 = doc.OpenDataRegion("Paragraph3");
        paragraph3.Font.Color = Color.Magenta;                                                                 //Font Color
        paragraph3.Font.Name  = "Blackadder ITC";                                                              // Font Style
        paragraph3.Font.Size  = 12;
        paragraph3.ParagraphFormat.Alignment = Aceoffix.WordWriter.WdParagraphAlignment.wdAlignParagraphRight; //Alignment

        AceoffixCtrl1.Bind(doc);

        AceoffixCtrl1.OpenDocument("doc/introduce.doc", Aceoffix.OpenModeType.docReadOnly, "John Scott");
    }
Exemplo n.º 2
0
    protected void AceoffixCtrl1_Load(object sender, EventArgs e)
    {
        string strUserName = Request.QueryString["user"];

        AceoffixCtrl1.ServerPage = "../aceoffix-runtime/server.aspx";

        // Create custom toolbar
        AceoffixCtrl1.AddCustomToolButton("Save", "SaveDocument()", 1);
        AceoffixCtrl1.AddCustomToolButton("-", "", 0);
        AceoffixCtrl1.AddCustomToolButton("Print", "ShowPrintDlg()", 6);

        if ((strUserName != null) && (strUserName.Length > 0))
        {
            //In Word document, developer can define any range of selection as a DataRegion object by inserting a bookmark with the prefix name "ACE_".
            //In other words, the DataRegion is a bookmark object whose name begins with "ACE_" in Word document.
            Aceoffix.WordWriter.WordDocument wd = new Aceoffix.WordWriter.WordDocument();
            if (strUserName == "John")
            {
                wd.OpenDataRegion("title").Editing     = true; // ACE_title
                wd.OpenDataRegion("firstpara").Editing = true; // ACE_firstpara
            }
            else if (strUserName == "Mike")
            {
                wd.OpenDataRegion("func1").Editing    = true; // ACE_func1
                wd.OpenDataRegion("func2").Editing    = true; // ACE_func2
                wd.OpenDataRegion("lastpara").Editing = true; // ACE_lastpara
            }
            AceoffixCtrl1.Bind(wd);
            AceoffixCtrl1.SaveFilePage = "savefile.aspx";
            AceoffixCtrl1.OpenDocument("../doc/editableregions.doc", Aceoffix.OpenModeType.docSubmitForm, strUserName);
        }
    }
Exemplo n.º 3
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.Table table1 = doc.OpenDataRegion("Table1").CreateTable(3, 5, Aceoffix.WordWriter.WdAutoFitBehavior.wdAutoFitWindow);
        table1.OpenCellRC(1, 1).MergeTo(3, 1);
        table1.OpenCellRC(1, 1).Value = "The merged cells";
        for (int i = 1; i < 4; i++)
        {
            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();
        }
        Aceoffix.WordWriter.DataRegion drTable2 = doc.CreateDataRegion("Table2", Aceoffix.WordWriter.DataRegionInsertType.After, "Table1");
        Aceoffix.WordWriter.Table      table2   = doc.OpenDataRegion("Table2").CreateTable(5, 5, Aceoffix.WordWriter.WdAutoFitBehavior.wdAutoFitWindow);
        for (int i = 1; i < 6; i++)
        {
            table2.OpenCellRC(i, 1).Value = "AA" + i.ToString();
            table2.OpenCellRC(i, 2).Value = "BB" + i.ToString();
            table2.OpenCellRC(i, 3).Value = "CC" + i.ToString();
            table2.OpenCellRC(i, 4).Value = "DD" + i.ToString();
            table2.OpenCellRC(i, 5).Value = "EE" + i.ToString();
        }


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

        AceoffixCtrl1.OpenDocument("doc/test.doc", Aceoffix.OpenModeType.docNormalEdit, "Tom");
    }
    protected void AceoffixCtrl1_Load(object sender, EventArgs e)
    {
        Aceoffix.WordWriter.WordDocument wd = new Aceoffix.WordWriter.WordDocument();
        wd.OpenDataRegion("EmployeeName").Editing   = true;
        wd.OpenDataRegion("EmployeeNumber").Editing = true;
        wd.OpenDataRegion("Department").Editing     = true;
        wd.OpenDataRegion("Manager").Editing        = true;

        wd.OpenDataRegion("FromDate").Value   = DateTime.Now.AddDays(2).ToLongDateString();
        wd.OpenDataRegion("FromDate").Editing = true;
        wd.OpenDataRegion("ToDate").Value     = DateTime.Now.AddDays(2).ToLongDateString();
        wd.OpenDataRegion("ToDate").Editing   = true;

        wd.OpenDataRegion("Reason").Editing = true;

        AceoffixCtrl1.Caption    = "Word document used as an input form.";
        AceoffixCtrl1.ServerPage = "../aceoffix-runtime/server.aspx";

        // Create custom toolbar
        AceoffixCtrl1.AddCustomToolButton("Save", "SaveDocument()", 1);
        AceoffixCtrl1.AddCustomToolButton("-", "", 0);
        AceoffixCtrl1.AddCustomToolButton("Print", "ShowPrintDlg()", 6);
        AceoffixCtrl1.AddCustomToolButton("-", "", 0);
        AceoffixCtrl1.AddCustomToolButton("Full-screen Switch", "SwitchFullScreen()", 4);

        AceoffixCtrl1.Bind(wd);
        AceoffixCtrl1.SaveDataPage = "saveworddata.aspx";
        AceoffixCtrl1.OpenDocument("../doc/doc-submit.doc", Aceoffix.OpenModeType.docSubmitForm, "John Scott");
    }
Exemplo 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 dataRegion = wd.OpenDataRegion("ACE_Table");

        Aceoffix.WordWriter.Table table = dataRegion.OpenTable(1);

        table.OpenCellRC(3, 1).Value = "Tom";
        table.OpenCellRC(3, 2).Value = "201501";
        table.OpenCellRC(3, 3).Value = "Development";
        table.OpenCellRC(3, 4).Value = "John Scott";
        table.OpenCellRC(3, 5).Value = "$5000";

        table.InsertRowAfter(table.OpenCellRC(3, 5));

        table.OpenCellRC(4, 1).Value = "Jack";
        table.OpenCellRC(4, 2).Value = "201502";
        table.OpenCellRC(4, 3).Value = "Sales";
        table.OpenCellRC(4, 4).Value = "Anna";
        table.OpenCellRC(4, 5).Value = "$5500";

        AceoffixCtrl1.Bind(wd);
        AceoffixCtrl1.OpenDocument("doc/test.doc", Aceoffix.OpenModeType.docNormalEdit, "John Scott");
    }
Exemplo n.º 6
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   dataRegion1 = doc.OpenDataRegion("Paragraph1");
        dataRegion1.Value = "[word]doc/paragraph1.doc[/word]";
        Aceoffix.WordWriter.DataRegion dataRegion2 = doc.OpenDataRegion("Paragraph2");
        dataRegion2.Value = "[word]doc/paragraph2.doc[/word]";
        Aceoffix.WordWriter.DataRegion dataRegion3 = doc.OpenDataRegion("Paragraph3");
        dataRegion3.Value = "[word]doc/paragraph3.doc[/word]";
        AceoffixCtrl1.Bind(doc);
        AceoffixCtrl1.AddCustomToolButton("Save", "SaveDocument()", 1);
        AceoffixCtrl1.SaveFilePage = "savefile.aspx";
        AceoffixCtrl1.OpenDocument("doc/merge.doc", Aceoffix.OpenModeType.docNormalEdit, "John Scott");
    }
Exemplo n.º 7
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.Table        table1 = doc.OpenDataRegion("Table1").OpenTable(1);
        table1.OpenCellRC(1, 1).Value = "Aceoffix";
        int dataRowCount = 5; //Insert the number of rows
        int oldRowCount  = 3; //The original number of rows in tables

        for (int j = 0; j < dataRowCount - oldRowCount; j++)
        {
            table1.InsertRowAfter(table1.OpenCellRC(2, 5));
        }
        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++;
        }

        AceoffixCtrl1.Bind(doc);
        AceoffixCtrl1.OpenDocument("doc/test.doc", Aceoffix.OpenModeType.docNormalEdit, "John Scott");
    }
Exemplo 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("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");
    }
Exemplo n.º 9
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");
    }
Exemplo n.º 10
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");
    }
Exemplo n.º 11
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");
    }
Exemplo n.º 12
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);
    }
Exemplo n.º 13
0
    protected void AceoffixCtrl1_Load(object sender, EventArgs e)
    {
        string[] strNames  = { "John Scott", "Tom Bush", "Steven Nicholls", "Kate Middleton" };
        string[] strGrades = { "C", "B", "A" };
        Aceoffix.WordWriter.WordDocument wd = new Aceoffix.WordWriter.WordDocument();
        System.Random rd = new Random(System.DateTime.Now.Millisecond);
        wd.OpenDataRegion("StudentName1").Value = strNames[rd.Next(4)];
        wd.OpenDataRegion("StudentName2").Value = strNames[rd.Next(4)];

        int iCreditsAttempted = 0;
        int iTemp             = 0;

        for (int i = 0; i < 9; i++)
        {
            int iCredits = rd.Next(5) + 1;
            int iScore   = rd.Next(3) + 2;
            wd.OpenDataRegion("Table4").OpenTable(1).OpenCellRC(3 + i, 2).Value = iCredits.ToString();
            wd.OpenDataRegion("Table4").OpenTable(1).OpenCellRC(3 + i, 3).Value = iCredits.ToString();
            wd.OpenDataRegion("Table4").OpenTable(1).OpenCellRC(3 + i, 4).Value = strGrades[iScore - 2];
            iCreditsAttempted = iCreditsAttempted + iCredits;
            iTemp             = iTemp + iCredits * iScore;
        }
        float fGPA = (float)iTemp / iCreditsAttempted;

        wd.OpenDataRegion("Table4").OpenTable(1).OpenCellRC(12, 1).Value = "Total Credits2:  " + iCreditsAttempted.ToString() + "        GPA:       " + fGPA.ToString("F2");

        wd.OpenDataRegion("GPA").Value = fGPA.ToString("F2");
        wd.OpenDataRegion("CreditsAttempted").Value = iCreditsAttempted.ToString();
        wd.OpenDataRegion("CreditsEarned").Value    = iCreditsAttempted.ToString();

        AceoffixCtrl1.Caption    = "Generate Word report dynamically.";
        AceoffixCtrl1.ServerPage = "../aceoffix-runtime/server.aspx";

        // Create custom toolbar
        AceoffixCtrl1.AddCustomToolButton("Save As", "SaveAsDocument()", 1);
        AceoffixCtrl1.AddCustomToolButton("-", "", 0);
        AceoffixCtrl1.AddCustomToolButton("Print", "ShowPrintDlg()", 6);
        AceoffixCtrl1.AddCustomToolButton("-", "", 0);
        AceoffixCtrl1.AddCustomToolButton("Full-screen Switch", "SwitchFullScreen()", 4);

        AceoffixCtrl1.FileTitle = "Report1";
        AceoffixCtrl1.Bind(wd);
        AceoffixCtrl1.OpenDocument("../doc/doc-report.doc", Aceoffix.OpenModeType.docReadOnly, "John Scott"); // docReadOnly: Disabled Edit, Paste.
    }
Exemplo n.º 14
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");
    }
Exemplo n.º 15
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");
    }
Exemplo n.º 16
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");
    }
Exemplo n.º 17
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();

        AceoffixCtrl1.ServerPage  = "../aceoffix-runtime/server.aspx";
        AceoffixCtrl1.BorderStyle = Aceoffix.BorderStyleType.BorderThin;
        Aceoffix.WordWriter.WordDocument doc = new Aceoffix.WordWriter.WordDocument();
        doc.DisableWindowRightClick        = true;
        doc.OpenDataRegion("name").Value   = docName;
        doc.OpenDataRegion("dept").Value   = docDept;
        doc.OpenDataRegion("cause").Value  = docCause;
        doc.OpenDataRegion("days").Value   = docDays;
        doc.OpenDataRegion("date").Value   = docSubmitTime.ToLongDateString();
        doc.OpenDataRegion("ToDate").Value = docSubmitTime.ToLongDateString();
        doc.OpenDataRegion("tip").Value    = "";
        AceoffixCtrl1.Bind(doc);
        AceoffixCtrl1.Menubar = false;
        AceoffixCtrl1.AddCustomToolButton("Print", "poPrint", 1);
        AceoffixCtrl1.AddCustomToolButton("Full-screen Switch", "poSetFullScreen", 4);

        AceoffixCtrl1.SaveDataPage = "SaveData.aspx?ID=" + docID;
        AceoffixCtrl1.OpenDocument("doc/template.doc", Aceoffix.OpenModeType.docReadOnly, "John Scott");
    }
Exemplo n.º 18
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.Table        table = doc.OpenDataRegion("Table1").OpenTable(1);

        table.OpenCellRC(1, 1).MergeTo(1, 5);
        table.OpenCellRC(1, 1).Value      = "Aceoffix";
        table.OpenCellRC(1, 1).Font.Color = Color.Red;
        table.OpenCellRC(1, 1).Font.Size  = 24;
        table.OpenCellRC(1, 1).Font.Name  = "Andalus";
        table.OpenCellRC(1, 1).ParagraphFormat.Alignment = Aceoffix.WordWriter.WdParagraphAlignment.wdAlignParagraphCenter;

        AceoffixCtrl1.Menubar       = false;
        AceoffixCtrl1.CustomToolbar = false;
        AceoffixCtrl1.Bind(doc);
        AceoffixCtrl1.SaveDataPage = "savedata.aspx";
        AceoffixCtrl1.OpenDocument("doc/test.doc", Aceoffix.OpenModeType.docSubmitForm, "John Scott");
    }
Exemplo n.º 19
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");
    }