本文整理汇总了C#中Report.GetAllFieldList方法的典型用法代码示例。如果您正苦于以下问题:C# Report.GetAllFieldList方法的具体用法?C# Report.GetAllFieldList怎么用?C# Report.GetAllFieldList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Report
的用法示例。
在下文中一共展示了Report.GetAllFieldList方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetReport
/// <summary>
/// Retrieve report data for a case
/// </summary>
/// <param name="item">Case item</param>
/// <returns>Report data for the case in question</returns>
public Report GetReport(CaseListItem item)
{
Log.Debug("Retrieving report data...");
// Always return a valid object for binding
Report rep = new Report();
if (item == null)
{
Log.Error("Missing parameter: caselistitem.");
return rep;
}
// first we need to get the report template based on the type indicate in the accession number
AccessionNumber accNum = new AccessionNumber(item.AccessionNumber);
VixReportTemplateObject templateObj = GetReportTemplate(item.SiteCode, accNum.Type);
// in case there is an error in the tranmission
if (templateObj.TemplateXML == string.Empty)
{
Log.Error("Failed to get template.");
return rep;
}
// retrieve a list of fields to grab data from the template
rep.ReportTemplate = templateObj.GetReportTemplate();
//List<string> fields = rep.GetFieldList();
List<string> fields = rep.GetAllFieldList();
string URI = String.Format("pathology/case/template/{0}", item.CaseURN);
IRestResponse response;
try
{
PathologyCaseTemplateInputFieldsType fieldList = new PathologyCaseTemplateInputFieldsType(fields);
string xml = ResponseParser.SerializeToXml<PathologyCaseTemplateInputFieldsType>(fieldList);
response = ExecutePost(URI, VixServiceTypes.Pathology, xml);
ValidateRestResponse(response);
PathologyCaseTemplateType rawRep = ResponseParser.ParseGetReport(response.Content);
rep.LoadReportData(rawRep);
}
catch (MagResponseParsingFailureException rpf)
{
Log.Error("Failed to parse report fields.", rpf);
}
catch (MagVixFailureException vfe)
{
Log.Error("Unexpected response.", vfe);
}
catch (Exception ex)
{
Log.Error("Could not complete request to retrieve report data.", ex);
}
return rep;
}