private void buttonExport_Click(object sender, EventArgs e) { UseWaitCursor = true; Application.DoEvents(); try { if (appraisalEntrust == null) { appraisalEntrust = new AppraisalEntrust(); appraisalEntrust.FilePath = Utility.GetFileSavePath() + Utility.BuilderFileName(); } appraisalEntrust.Status = 1; SaveData(); WordDocument doc = new WordDocument("鉴定委托书"); doc.AddField("DocTitle", appraisalEntrust.DocTitle); doc.AddField("AppraisalUnit", appraisalEntrust.AppraisalUnit); doc.AddField("AppraisalPoints", appraisalEntrust.AppraisalPoints); doc.AddField("AppraisaDate", appraisalEntrust.AppraisaDate.ToString("yyyy年MM月dd日")); doc.AddField("ContactUserName", appraisalEntrust.ContactUserName); doc.AddField("ContactUserPhone", appraisalEntrust.ContactUserPhone); doc.AddFootField("DocManageArea", appraisalEntrust.DocManageArea); //doc.AddFootField("FirstPageTest", "测试"); //doc.AddFootField("Test", "测试"); Grid grid = doc.NewGrid(); grid.TableMark = "Table"; int i = 0; foreach (SamplingContent sc in appraisalEntrust.Items) { i++; GridRow row = grid.NewRow(); row.AddRowItem(i.ToString()); row.AddRowItem(sc.SDocTitle); row.AddRowItem(sc.ItemName); row.AddRowItem(sc.ItemRule); row.AddRowItem(sc.Count.ToString() + sc.ItemUnit); } OnNavigationRequest(new Maleos.NavigationRequestEventArgs("Maleos.Modules.OutputDocuemnt", new object[] { doc, "EnforceForm.frmAppraisalEntrust", appraisalEntrust.FilePath })); } catch (Exception ex) { CommonInvoke.ErrorMessageBox(ex); } UseWaitCursor = false; }
private void buttonExport_Click(object sender, EventArgs e) { UseWaitCursor = true; Application.DoEvents(); try { if (writServiceReceipt == null) { writServiceReceipt = new WritServiceReceipt(); writServiceReceipt.FilePath = Utility.GetFileSavePath() + Utility.BuilderFileName(); } writServiceReceipt.Status = 1; SaveData(); WordDocument doc = new WordDocument("文书送达回执"); doc.AddField("DocTitle", writServiceReceipt.DocTitle); doc.AddField("CaseName", writServiceReceipt.CaseName); doc.AddField("ServiceCompany", writServiceReceipt.ServiceCompany); doc.AddField("DocManageArea", writServiceReceipt.DocManageArea); doc.AddField("Note", writServiceReceipt.Note); Grid grid = doc.NewGrid(); grid.TableMark = "Table"; foreach (WritServiceReceiptItem sc in writServiceReceipt.Items) { GridRow row = grid.NewRow(); row.AddRowItem(sc.WritName); row.AddRowItem(sc.Recipient); row.AddRowItem(sc.ServiceDate.ToString("yyyy年M月d日")); row.AddRowItem(sc.ServiceAddress); row.AddRowItem(sc.ServiceWay); row.AddRowItem(sc.ServicePerson); } OnNavigationRequest(new Maleos.NavigationRequestEventArgs("Maleos.Modules.OutputDocuemnt", new object[] { doc, "EnforceForm.frmWritServiceReceipts", writServiceReceipt.FilePath })); } catch (Exception ex) { CommonInvoke.ErrorMessageBox(ex); } UseWaitCursor = false; }
private void toolStripButtonOutPut_Click(object sender, EventArgs e) { if (enforceLawGridViewReformReView.SelectedRows.Count == 0) return; UseWaitCursor = true; Application.DoEvents(); try { ReformReView reformReView = enforceLawGridViewReformReView.SelectedRows[0].Tag as ReformReView; WordDocument doc = new WordDocument("整改复查意见书.rtf"); doc.AddField("DocTitle", reformReView.DocTitle); doc.AddField("ReviewCompany", reformReView.ReviewCompany); doc.AddField("ReviewDateYear", reformReView.ReviewDate.Year.ToString()); doc.AddField("ReviewDateMonth", reformReView.ReviewDate.Month.ToString()); doc.AddField("ReviewDateDay", reformReView.ReviewDate.Day.ToString()); doc.AddField("Decide", reformReView.Decide); doc.AddField("DocTitle2", reformReView.DocTitle2); doc.AddField("Idea", reformReView.Idea); doc.AddField("OfficerName1", reformReView.OfficerName1); doc.AddField("CID1", reformReView.CID1); doc.AddField("OfficerName2", reformReView.OfficerName2); doc.AddField("CID2", reformReView.CID2); doc.AddField("DocManageArea", reformReView.DocManageArea); doc.AddField("DocDate", reformReView.DocDate.ToString("yyyy年M月d日")); Grid grid = doc.NewGrid(); grid.TableMark = "Table"; GridRow row = grid.NewRow(); row.AddRowItem("台安监管回2012 (1) 号"); row.AddRowItem("张三"); row.AddRowItem("2012-01-01"); row.AddRowItem("宁波"); row.AddRowItem("当面"); row.AddRowItem("李四"); row = grid.NewRow(); row.AddRowItem("台安监管回2012 (2) 号"); row.AddRowItem("王五"); row.AddRowItem("2013-12-01"); row.AddRowItem("宁波"); row.AddRowItem("当面"); row.AddRowItem("李四"); OutputDocuemnt frm = new OutputDocuemnt(doc); frm.OpenWindow(this); } catch (Exception ex) { CommonInvoke.ErrorMessageBox(ex); } UseWaitCursor = false; }
private void buttonExport_Click(object sender, EventArgs e) { UseWaitCursor = true; Application.DoEvents(); try { if (sampling == null) { sampling = new Sampling(); sampling.FilePath = Utility.GetFileSavePath() + Utility.BuilderFileName(); } sampling.Status = 1; SaveData(); WordDocument doc = new WordDocument("抽样取证凭证"); doc.AddField("DocTitle", sampling.DocTitle); doc.AddField("FieldECompanyName", sampling.FieldECompanyName); doc.AddField("FieldEPeopleName", sampling.FieldEPeopleName); doc.AddField("FieldEAddress", sampling.FieldEAddress); doc.AddField("FieldEPeoplePhone", sampling.FieldEPeoplePhone); doc.AddField("FieldEPeopleZio", sampling.FieldEPeopleZio); doc.AddField("BeganTimeYear", sampling.BeganTime.Year.ToString()); doc.AddField("BeganTimeMonth", sampling.BeganTime.Month.ToString()); doc.AddField("BeganTimeDay", sampling.BeganTime.Day.ToString()); doc.AddField("BeganTimeHour", sampling.BeganTime.Hour.ToString()); doc.AddField("BeganTimeMinute", sampling.BeganTime.Minute.ToString()); doc.AddField("ToTimeDay", sampling.ToTime.Day.ToString()); doc.AddField("ToTimeHour", sampling.ToTime.Hour.ToString()); doc.AddField("ToTimeMinute", sampling.ToTime.Minute.ToString()); doc.AddField("SamplingAddress", sampling.SamplingAddress); doc.AddFootField("DocManageArea", sampling.DocManageArea); //doc.AddFootField("FirstPageTest", "测试"); //doc.AddFootField("Test", "测试"); Grid grid = doc.NewGrid(); grid.TableMark = "Table"; int i = 0; foreach (SamplingContent sc in sampling.Items) { i++; GridRow row = grid.NewRow(); row.AddRowItem(i.ToString()); row.AddRowItem(sc.SDocTitle); row.AddRowItem(sc.ItemName); row.AddRowItem(sc.ItemRule); row.AddRowItem(sc.Count.ToString() + sc.ItemUnit); } OnNavigationRequest(new Maleos.NavigationRequestEventArgs("Maleos.Modules.OutputDocuemnt", new object[] { doc, "EnforceForm.frmSamplings", sampling.FilePath })); } catch (Exception ex) { CommonInvoke.ErrorMessageBox(ex); } UseWaitCursor = false; }