public static bool WriteTempQuickReport(ReportTemplateInfo info) { string hostName = Dns.GetHostName(); System.Net.IPAddress[] addressList = Dns.GetHostAddresses(hostName); string tempDir = AppDomain.CurrentDomain.BaseDirectory + "\\SystemData\\Report\\QuickReport\\"; Directory.CreateDirectory(tempDir); tempQuickReportXML = tempDir + "\\" + addressList[addressList.Length - 1] + "_ReportTemplateInfo.xml"; XElement root = new XElement("QuickTempletCommand"); XElement children = new XElement("QuickTemplateIndexID"); children.SetValue(info.ReportTemplateID); root.Add(children); root.Save(tempQuickReportXML); return(true); }
public static bool WriteQuickReportArgs(ReportTemplateInfo info, string reportTimeFile) { string hostName = Dns.GetHostName(); System.Net.IPAddress[] addressList = Dns.GetHostAddresses(hostName); string tempDir = AppDomain.CurrentDomain.BaseDirectory + "\\SystemData\\Report\\QuickReport\\"; Directory.CreateDirectory(tempDir); ReportArgsFile = tempDir + "\\" + addressList[addressList.Length - 1] + "_QuickReportArg.txt"; List <string> fileContexts = new List <string>(); fileContexts.Add(info.ReportSubProType); fileContexts.Add(info.ReportTemplateName); fileContexts.Add(info.ReportTemplateID.ToString()); string reportStartTime = GetReportTime(reportTimeFile); fileContexts.Add(string.IsNullOrEmpty(reportStartTime) ? DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") : reportStartTime.ToString()); File.WriteAllLines(ReportArgsFile, fileContexts.ToArray(), Encoding.Default); return(true); }