/// <summary> /// Invokes and executes a call to the Kirkwood database via Xapi /// to obtain report configuration data including the actual /// rdlc report definitions /// </summary> /// <returns>Report definition list XML document</returns> private XmlDocument GetServerReportsConfig() { string returnValue; XmlDocument xmlReportsDoc = new XmlDocument(); string reportName = "get_report_definitions"; // Parameters Dictionary <string, string> parms = new Dictionary <string, string>(); parms.Add("LocaleCode", Program.CurrentLanguage); if (_isCreedenceOrLater) { parms.Add("ReportVersion", "Creedence"); parms.Add("PoolId", _pool.uuid); } AsyncAction action = new WlbReportAction(_pool.Connection, Helpers.GetMaster(_pool.Connection), reportName, Messages.WLB_REPORT_DEFINITIONS, true, parms); using (var dlg = new ActionProgressDialog(action, ProgressBarStyle.Marquee)) dlg.ShowDialog(); returnValue = action.Result; if ((action.Succeeded) && (!String.IsNullOrEmpty(returnValue))) { try { xmlReportsDoc.LoadXml(returnValue); string rdlcText; foreach (XmlNode currentRdlc in xmlReportsDoc.SelectNodes(@"Reports/Report/Rdlc")) { rdlcText = currentRdlc.InnerText; currentRdlc.InnerText = String.Empty; currentRdlc.InnerText = rdlcText; } } catch (Exception) { xmlReportsDoc = null; } } return(xmlReportsDoc); }
/// <summary> /// Invokes and executes a call to the Kirkwood database via Xapi to obtain report data. /// </summary> /// <param name="reportKey"></param> /// <param name="currentParams"></param> /// <returns></returns> private string GetReportData(string reportKey, ReportParameterInfoCollection currentParams) { string returnValue = string.Empty; List <string> reportQueryParams; reportQueryParams = _reportInfo.ReportQueryParameterNames; reportQueryParams.Add("UTCOffset"); reportQueryParams.Add("LocaleCode"); Dictionary <string, string> parms = new Dictionary <string, string>(); for (int i = 0; i < reportQueryParams.Count; i++) { parms[reportQueryParams[i].ToString()] = currentParams[reportQueryParams[i].ToString()].Values[0].ToString(); } AsyncAction a = new WlbReportAction(Pool.Connection, Helpers.GetMaster(Pool.Connection), reportKey, _reportInfo.ReportName, false, parms); new ActionProgressDialog(a, ProgressBarStyle.Marquee).ShowDialog(); if (a.Succeeded) { returnValue = a.Result; } else { _bDisplayedError = true; } return(returnValue); }