static void Main(string[] args) { Dictionary <string, string> connStrDict = GetConnectionStrDictionary(); ReportSection reportSection = (ReportSection)System.Configuration.ConfigurationManager.GetSection("reportGroup/report"); ShowSupportedReports(reportSection); Console.WriteLine("Type the report name and press enter:"); string reportName = Console.ReadLine(); foreach (ReportElement report in reportSection.ReportElementCollection) { if (report.ReportName.ToLower() == reportName.ToLower()) { if (!string.IsNullOrWhiteSpace(report.DbList)) { string[] dbList = report.DbList.Split(','); foreach (string dbShortName in dbList) { GenerateReports(report, connStrDict[dbShortName], dbShortName); } } break; } } Console.WriteLine("Done."); Console.ReadKey(); }
private static void ShowSupportedReports(ReportSection reportSection) { //print reports names to console Console.WriteLine("Supported Reports:"); foreach (var report in reportSection.ReportElementCollection) { Console.WriteLine(report.ReportName); } }