public void printReport(string templateFile, List<string> data, bool previewFlg) { this.mConvMode = 0; if (this.mTimeStamp.Ticks == 0L) { this.mTimeStamp = DateTime.Now; } XmlDocument source = new XmlDocument(); source.Load(templateFile); if (data == null) { this.mIsNullData = true; } XmlDocument printXml = new PrintXml { ConvertMode = 0, JobConf = this.mJobConfig, InfoUniqueNo = this.mInputInfo, ServerRecvTime = this.mServerRecvTime, TimeStamp = this.mTimeStamp }.createPrintXml(source, data); this.execPrint(printXml, previewFlg); }
public void printTemplate(AbstractJobConfig jobconf, List<string> data, bool previewFlg) { try { if (jobconf != null) { XmlDocument source = null; this.mConvMode = 0; if (data == null) { this.mIsNullData = true; } if (this.mTimeStamp.Ticks == 0L) { this.mTimeStamp = DateTime.Now; } this.JobConfig = jobconf; PrintXml xml = new PrintXml(); if ((this.mJobConfig.jobStyle == JobStyle.normal) || (this.mJobConfig.jobStyle == JobStyle.combi)) { string str; if (this.mJobConfig.jobStyle == JobStyle.combi) { this.mJobConfig = ((CombiConfig) this.mJobConfig).configs[1].config; } NormalConfig mJobConfig = (NormalConfig) this.mJobConfig; if (mJobConfig.Print.Trim().Length == 0) { ConvertTemplate template = ConvertTemplate.CreateInstance(true); str = mJobConfig.Display.Trim(); if (this.mCustomTemplatePath.Length > 0) { string fileName = Path.GetFileName(str); str = this.mCustomTemplatePath.Trim(new char[] { '\\' }) + @"\" + fileName; } source = template.convertDisplayToReport(str); this.mConvMode = 1; } else { source = new XmlDocument(); str = mJobConfig.Print.Trim(); if (this.mCustomTemplatePath.Length > 0) { string str3 = Path.GetFileName(str); str = this.mCustomTemplatePath.Trim(new char[] { '\\' }) + @"\" + str3; } source.Load(str); this.mConvMode = 0; } xml.PrintPageNo = 0; xml.ConvertMode = this.mConvMode; xml.JobConf = jobconf; xml.InfoUniqueNo = this.mInputInfo; xml.ServerRecvTime = this.mServerRecvTime; xml.Contained = this.mContained; xml.TimeStamp = this.mTimeStamp; XmlDocument printXml = xml.createPrintXml(source, data); this.execPrint(printXml, previewFlg); } else if (this.mJobConfig.jobStyle == JobStyle.divide) { DivideConfig config2 = (DivideConfig) this.mJobConfig; if (config2.printDivision == null) { throw new NaccsException(MessageKind.Error, 0x25c, Resources.ResourceManager.GetString("COM16")); } source = new XmlDocument(); XmlDocument[] documentArray = new XmlDocument[config2.printDivision.count]; XmlDocument itemxml = new XmlDocument(); itemxml.Load(config2.printDivision.iteminfo); xml.PrintPageNo = 0; for (int i = 0; i < config2.printDivision.count; i++) { string filename = config2.printDivision.templates[i].filename; if (this.mCustomTemplatePath.Length > 0) { string str5 = Path.GetFileName(filename); filename = this.mCustomTemplatePath.Trim(new char[] { '\\' }) + @"\" + str5; } source.Load(filename); xml.ConvertMode = this.mConvMode; xml.JobConf = jobconf; xml.InfoUniqueNo = this.mInputInfo; xml.ServerRecvTime = this.mServerRecvTime; xml.Contained = this.mContained; xml.TimeStamp = this.mTimeStamp; documentArray[i] = xml.createPrintXml(source, itemxml, data); } XmlDocument document4 = documentArray[0]; for (int j = 1; j < config2.printDivision.count; j++) { foreach (XmlNode node in documentArray[j].SelectNodes("jobform/layout/page")) { XmlFunc.copyXmlNode(document4.SelectSingleNode("jobform/layout"), node); } } this.execPrint(document4, previewFlg); } } } catch (NaccsException) { throw; } catch (Exception exception) { throw new NaccsException(MessageKind.Error, 0x261, exception.Message); } }
public void printDataView(List<string> data, bool previewFlg) { try { this.mConvMode = 0; if (this.mTimeStamp.Ticks == 0L) { this.mTimeStamp = DateTime.Now; } if (data == null) { this.mIsNullData = true; } PrintXml xml = new PrintXml(); XmlDocument source = new XmlDocument(); source.LoadXml(DllResource.DataViewListTmp); xml.PrintPageNo = 0; xml.ConvertMode = 0; xml.Contained = this.mContained; xml.TimeStamp = this.mTimeStamp; XmlDocument printXml = xml.createPrintXml(source, data); this.execPrint(printXml, previewFlg); } catch (NaccsException) { throw; } catch (Exception exception) { throw new NaccsException(MessageKind.Error, 0x261, exception.Message); } }