/*--- 匯出PDF ---*/ private void btnExportToPDF_Click(object sender, EventArgs e) { ExportPDF exportPDF = new ExportPDF(); string placeName = table.placeName; int year = table.date.Year; year -= 1911; //換算成民國 string datrStr = table.date.ToString(year + " 年 MM 月 dd 日"); string fileName = datrStr + " 問事報名資料表 " + placeName; //Console.WriteLine(table.placeName); //Console.WriteLine(fileName); exportPDF.GeneratePDF(fileName, askingTableView); }
/*--- 匯出PDF ---*/ private void btnExportPDF_Click(object sender, EventArgs e) { /*-- 設定 AskingTable 的日期和地點 --*/ SetDateAndPlace(formTitle.Text); /*-- 取得問事資料,並加到DataTable中 --*/ GetAskingTableData(formTitle.Text); /*-- 存檔 & 匯出PDF --*/ ExportPDF exportPDF = new ExportPDF(); string placeName = askingTable.placeName; //問事地點 /*- 西元轉民國 -*/ int year = askingTable.date.Year; year -= 1911; string datrStr = askingTable.date.ToString(year + " 年 MM 月 dd 日"); /*- 存檔預設檔名 -*/ string fileName = datrStr + " 問事報名資料表 " + placeName; //Console.WriteLine(askingTable.placeName); //Console.WriteLine(fileName); exportPDF.GeneratePDF(fileName, askingDT); this.Close(); /* * foreach (DataColumn c in askingDT.Columns) * { * Console.Write(c+"\t"); * } * Console.WriteLine("輛:"+askingDT.Rows.Count); * for (int i=0; i< askingDT.Rows.Count; i++) * { * for(int j = 0; j < askingDT.Columns.Count; j++) * { * Console.Write(askingDT.Rows[i][j]+"\t"); * } * Console.WriteLine(); * }*/ }