示例#1
0
        /// <summary>
        /// 导出到Word中
        /// </summary>
        public void ExportToDoc()
        {
            NetUserJournal uJoul     = new NetUserJournal();
            UserJournal    jourlInfo = new UserJournal();

            System.Data.DataTable dt    = uJoul.GetJournalDataSet(KeyWord, beginSearchDate, endSearchDate, 0, 1, true).Tables[0];
            StringBuilder         sbXml = new StringBuilder();
            string title = string.Empty;

            if (this.beginTime.Value == this.endTime.Value)
            {
                title = this.beginTime.Value + "工作总结内容列表";
            }
            else
            {
                title = this.drop_UserList.SelectedItem.Text + "从" + this.beginTime.Value + "到" + this.endTime.Value + "的工作总结内容列表";
            }
            sbXml.Append(title + "\t\t\t\t\n\n\n");
            foreach (DataRow row in dt.Rows)
            {
                sbXml.Append(row["realName"] + "\t" + Convert.ToDateTime(row["writetime"]).ToString("yyyy-MM-dd") + "\t\n");
                sbXml.Append(string.Format("{0}\n\n", row["jourDesc"]));
            }
            ExportData.ExportWebData("Word", title, sbXml);
        }
        /// <summary>
        /// 导出到Word中
        /// </summary>
        public void ExportToDoc()
        {
            NetUserMission uMission = new NetUserMission();
            UserMission    uinfo    = new UserMission();

            DataTable     dt    = uMission.GetMissionDataSet("2", beginSearchDate, endSearchDate, KeyWord).Tables[0];
            StringBuilder sbXml = new StringBuilder();
            string        title = string.Empty;

            if (this.beginTime.Value == this.endTime.Value)
            {
                title = this.beginTime.Value + "工作任务列表";
            }
            else
            {
                title = "从" + this.beginTime.Value + "到" + this.endTime.Value + "的修改完成的列表";
            }
            sbXml.Append(title + "\t\t\t\t\n\n\n");
            sbXml.Append("编号\t\t\t\t任务内容\n\n");
            foreach (DataRow row in dt.Rows)
            {
                sbXml.Append(string.Format("{0}", "1"));

                sbXml.Append(string.Format("\t\t\t\t{0}\n\n", row["MissionDesc"]));
            }
            ExportData.ExportWebData("Word", title, sbXml);
        }