protected void Page_Load(object sender, EventArgs e)
    {
        Aceoffix.WordReader.WordDocument doc = new Aceoffix.WordReader.WordDocument();
        Byte[] bWord;
        Aceoffix.WordReader.DataRegion dr1 = doc.OpenDataRegion("Paragraph1");
        bWord = dr1.FileBytes;
        Stream s1 = new FileStream(Server.MapPath("doc/") + "Paragraph1.doc", FileMode.Create);

        s1.Write(bWord, 0, bWord.Length);
        s1.Close();


        Aceoffix.WordReader.DataRegion dr2 = doc.OpenDataRegion("Paragraph2");
        bWord = dr2.FileBytes;
        Stream s2 = new FileStream(Server.MapPath("doc/") + "Paragraph2.doc", FileMode.Create);

        s2.Write(bWord, 0, bWord.Length);
        s2.Close();


        Aceoffix.WordReader.DataRegion dr3 = doc.OpenDataRegion("Paragraph3");
        bWord = dr3.FileBytes;
        Stream s3 = new FileStream(Server.MapPath("doc/") + "Paragraph3.doc", FileMode.Create);

        s3.Write(bWord, 0, bWord.Length);
        s3.Close();

        doc.Close();
    }
Beispiel #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Aceoffix.WordReader.WordDocument doc = new Aceoffix.WordReader.WordDocument();
        string Name = doc.OpenDataRegion("Name").Value;

        string Department  = doc.OpenDataRegion("Department").Value;
        string companyName = doc.GetFormField("txtCompany");

        //You can save them to the database.

        doc.Close();
    }
Beispiel #3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Aceoffix.WordReader.WordDocument doc = new Aceoffix.WordReader.WordDocument();

        try{
            Aceoffix.WordReader.DataRegion poName = doc.OpenDataRegion("Name");
            Response.Write("Get the value of ACE-Name from back end:" + poName.Value);
        }
        catch {
            Response.Write("No DataRegion named ACE-Name submitted from client side.");
        }
        doc.ShowPage(400, 300);
        doc.Close();
    }
Beispiel #4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Aceoffix.WordReader.WordDocument doc = new Aceoffix.WordReader.WordDocument();

        if (Request.QueryString["userName"] != null && Request.QueryString["userName"].Equals("zhangsan"))
        {
            saveBytesToFile(doc.OpenDataRegion("Paragraph1").FileBytes, Server.MapPath("doc/paragraph1.doc"));
        }
        else
        {
            saveBytesToFile(doc.OpenDataRegion("Paragraph2").FileBytes, Server.MapPath("doc/paragraph2.doc"));
        }

        doc.Close();
    }
Beispiel #5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        // This page is used to receive the data submitted by AceoffixCtrl.
        Aceoffix.WordReader.WordDocument wd = new Aceoffix.WordReader.WordDocument();

        StringBuilder sb = new StringBuilder();

        sb.Append("<p>EmployeeName: <span class='TypeValue'>" + wd.OpenDataRegion("EmployeeName").Value + "</span></p>");
        sb.Append("<p>EmployeeNumber: <span class='TypeValue'>" + wd.OpenDataRegion("EmployeeNumber").Value + "</span></p>");
        sb.Append("<p>Department: <span class='TypeValue'>" + wd.OpenDataRegion("Department").Value + "</span></p>");
        sb.Append("<p>Manager: <span class='TypeValue'>" + wd.OpenDataRegion("Manager").Value + "</span></p>");
        sb.Append("<p>FromDate: <span class='TypeValue'>" + wd.OpenDataRegion("FromDate").Value + "</span></p>");
        sb.Append("<p>ToDate: <span class='TypeValue'>" + wd.OpenDataRegion("ToDate").Value + "</span></p>");
        sb.Append("<p>Reason: <span class='TypeValue'>" + wd.OpenDataRegion("Reason").Value + "</span></p>");
        Label1.Text = sb.ToString();

        // In general, SaveDataPage do not need to dispaly anything. But if you call ShowPage method, this page will be shown in a popup dialog box after saving document.
        wd.ShowPage(800, 600);
        // Once you saved data, please call this method finally.
        wd.Close();
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        Aceoffix.WordReader.WordDocument doc     = new Aceoffix.WordReader.WordDocument();
        Aceoffix.WordReader.DataRegion   dataReg = doc.OpenDataRegion("table");
        Aceoffix.WordReader.Table        table   = dataReg.OpenTable(1);
        Response.Write("Table Data:<br/><br/>");
        StringBuilder dataStr = new StringBuilder();

        for (int i = 1; i <= table.RowsCount; i++)
        {
            dataStr.Append("<div style='width:220px;'>");
            for (int j = 1; j <= table.ColumnsCount; j++)
            {
                dataStr.Append("<div style='float:left;width:70px;border:1px solid red;'>" + table.OpenCellRC(i, j).Value + "</div>");
            }
            dataStr.Append("</div>");
        }
        Response.Write(dataStr.ToString());
        doc.ShowPage(350, 300);
        doc.Close();
    }
Beispiel #7
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string strID = Request.QueryString["ID"];

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

        conn.Open();

        string       strsql;
        OleDbCommand cmd = new OleDbCommand();

        cmd.Connection  = conn;
        cmd.CommandType = CommandType.Text;

        Aceoffix.WordReader.WordDocument doc = new  Aceoffix.WordReader.WordDocument();
        string sName  = doc.OpenDataRegion("name").Value;
        string sDept  = doc.OpenDataRegion("dept").Value;
        string sCause = doc.OpenDataRegion("cause").Value;
        string sDays  = doc.OpenDataRegion("days").Value;
        string sDate  = doc.OpenDataRegion("date").Value;

        if (sName == "")
        {
            ErrorMsg = ErrorMsg + "<li>Name</li>";
        }
        if (sDept == "")
        {
            ErrorMsg = ErrorMsg + "<li>Department</li>";
        }
        if (sCause == "")
        {
            ErrorMsg = ErrorMsg + "<li>Cause</li>";
        }
        if (sDate == "")
        {
            ErrorMsg = ErrorMsg + "<li>Date</li>";
        }
        try
        {
            if (sDays != "")
            {
                if (Int32.Parse(sDays) < 0)
                {
                    ErrorMsg = ErrorMsg + "<li>The number of the days can't be minus.</li>";
                }
            }
            else
            {
                ErrorMsg = ErrorMsg + "<li>Days</li>";
            }
        }
        catch
        {
            ErrorMsg = ErrorMsg + "<li><font color=red>Notice:</font>You should fill the 'Days' with numbers.</li>";
        }

        if (ErrorMsg == "")
        {
            strsql = "update leaveRecord set Name='" + sName
                     + "', Dept='" + sDept + "', Cause='" + sCause
                     + "', Num=" + sDays + ", SubmitTime='" + sDate
                     + "' where  ID=" + strID;
            cmd.CommandText = strsql;
            cmd.ExecuteNonQuery();
        }
        else
        {
            doc.ShowPage(578, 380);
        }
        doc.Close();
        conn.Close();


        string mScriptName = "savedata.aspx";
        string mHttpUrl    = "http://" + Request.ServerVariables["HTTP_HOST"] + Request.ServerVariables["SCRIPT_NAME"];

        BaseUrl = mHttpUrl.Substring(0, mHttpUrl.Length - mScriptName.Length);
    }