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"); }
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"); }
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(); doc.Template.DefineDataTag("[CONTRACT NO]"); doc.Template.DefineDataTag("[DATA]"); doc.Template.DefineDataTag("[THE BUYER]"); doc.Template.DefineDataTag("[Add]"); doc.Template.DefineDataTag("{Add}"); doc.Template.DefineDataTag("[Tel]"); doc.Template.DefineDataTag("[THE SELLER]"); doc.Template.DefineDataTag("[Name]"); doc.Template.DefineDataTag("[Signature]"); doc.Template.DefineDataTag("{Date}"); AceoffixCtrl1.Bind(doc); AceoffixCtrl1.AddCustomToolButton("Save", "SaveDocument()", 1); AceoffixCtrl1.AddCustomToolButton("Define DataTags", "ShowDefineDataTags()", 3); AceoffixCtrl1.SaveFilePage = "savefile.aspx"; AceoffixCtrl1.OpenDocument("doc/test.doc", Aceoffix.OpenModeType.docNormalEdit, "Tom"); }
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); } }
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"); }
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"); }
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.DisableWindowSelection = true; // Disabled Selection and Drag. AceoffixCtrl1.Caption = "Work Mode: Read Only; [Disabled Edit, Copy, Paste, Save as, Download, PrintScreen, F12, Context Menu, Print and etc.]"; AceoffixCtrl1.ServerPage = "../aceoffix-runtime/server.aspx"; AceoffixCtrl1.JsFunction_AfterDocumentOpened = "OnAfterDocumentOpened()"; AceoffixCtrl1.AllowCopy = false; // Disabled Copy, PrintScreen, F12, Context Menu and etc. AceoffixCtrl1.Bind(wd); AceoffixCtrl1.OpenDocument("../doc/viewword.doc", Aceoffix.OpenModeType.docReadOnly, "John Scott"); // docReadOnly: Disabled Edit, Paste. }
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(); wd.WaterMark.Text = "Aceoffix"; AceoffixCtrl1.Bind(wd); AceoffixCtrl1.OpenDocument("doc/introduce.doc", Aceoffix.OpenModeType.docReadOnly, "John Scott"); }
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"); }
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"); }
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"); }
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. }
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"); }
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"); }
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"); }
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"); }
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"); }
protected void Page_Load(object sender, EventArgs e) { AceoffixCtrl1.ServerPage = "../aceoffix-runtime/server.aspx"; Aceoffix.WordWriter.WordDocument wd = new Aceoffix.WordWriter.WordDocument(); Aceoffix.WordWriter.DataTag dataTag1 = wd.OpenDataTag("{name}"); dataTag1.Value = "Tom"; Aceoffix.WordWriter.DataTag dataTag2 = wd.OpenDataTag("{Number}"); dataTag2.Value = "201501"; Aceoffix.WordWriter.DataTag dataTag3 = wd.OpenDataTag("{Department}"); dataTag3.Value = "Development"; Aceoffix.WordWriter.DataTag dataTag4 = wd.OpenDataTag("{Manager}"); dataTag4.Value = "John Scott"; Aceoffix.WordWriter.DataTag dataTag5 = wd.OpenDataTag("{Salary}"); dataTag5.Value = "$5000"; AceoffixCtrl1.Bind(wd); AceoffixCtrl1.AddCustomToolButton("Save", "SaveDocument()", 1); AceoffixCtrl1.SaveFilePage = "savefile.aspx"; AceoffixCtrl1.OpenDocument("doc/test.doc", Aceoffix.OpenModeType.docNormalEdit, "John Scott"); }
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); }
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(); doc.Template.DefineDataRegion("Date", "[Date]"); doc.Template.DefineDataRegion("Payment", "[Payment method]"); doc.Template.DefineDataRegion("Number", "[Credit card number]"); doc.Template.DefineDataRegion("Status", "[Status]"); doc.Template.DefineDataRegion("Name", "[Customer name]"); doc.Template.DefineDataRegion("Add", "[Add]"); doc.Template.DefineDataRegion("Tel", "[Tel]"); doc.Template.DefineDataRegion("Email", "[Email]"); AceoffixCtrl1.Bind(doc); AceoffixCtrl1.AddCustomToolButton("Save", "Save()", 1); AceoffixCtrl1.AddCustomToolButton("Define DataRegion", "ShowDefineDataRegions()", 3); AceoffixCtrl1.SaveFilePage = "savefile.aspx"; AceoffixCtrl1.OpenDocument("doc/test.doc", Aceoffix.OpenModeType.docNormalEdit, "Tom"); }
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"); }
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"); }
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"); }
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"); }