public static void OnCreateReportUsingFieldMergeCell(IWin32Window owner, string reportTitle, List <Hashtable> listSource, Hashtable fieldParams, Hashtable bookMarkParams, string reportName, string templateDir, Hashtable mapMergeCell, bool includeSumRow, bool isItalicHeader, bool autoIndex, string prefixParam, string posfixParam) { string tempFile; bool returnCode = UpdateTempFile(owner, templateDir, reportName, out tempFile); if (!returnCode) { return; } try { WordAppUtil.ThreadForWaitingExport(); // tao wordApp tu template WordAppUtil.CreateMsWordFromTemplate(); UpdateTableData(listSource, autoIndex, includeSumRow, isItalicHeader); DoMergeCell(mapMergeCell); UpdateParamUsingMergeField(fieldParams, prefixParam, posfixParam); UpdateParamUsingBookmark(bookMarkParams); } finally { WordAppUtil.QuitMsWordApp(true); WordAppUtil.ThreadForClosingExport(); } WordViewerUtil.LoadDocument(owner, reportTitle, tempFile, true); }
public static void OnCreateReportUsingBookmark(IWin32Window owner, string reportTitle, List <Hashtable> listSource, Hashtable mapParams, string reportName, string templateDir, bool includeSumRow, bool autoIndex) { string tempFile; bool returnCode = UpdateTempFile(owner, templateDir, reportName, out tempFile); if (!returnCode) { return; } try { WordAppUtil.ThreadForWaitingExport(); // tao wordApp tu template WordAppUtil.CreateMsWordFromTemplate(); UpdateTableData(listSource, autoIndex, includeSumRow, false); UpdateParamUsingBookmark(mapParams); } finally { WordAppUtil.QuitMsWordApp(true); WordAppUtil.ThreadForClosingExport(); } WordViewerUtil.LoadDocument(owner, reportTitle, tempFile, true); }