public void GetReportTemplate()
        {
            ReportsRestClient restClient = CreateRestClient();

            IList <ReportTemplateInfo> reportTemplates = restClient.GetReportTemplatesInfo();

            string firstTypeCode = reportTemplates.First().TypeCodes.First();

            //Если в качестве второго праметра передан null, вернется базовый шаблон general.
            ReportTemplate reportType = restClient.GetReportTemplate(firstTypeCode, null /*reportTemplateCode*/);

            Assert.NotNull(reportType);
            Assert.NotNull(reportType.TemplateContent); //В этом массиве байтов содержится шаблон XtraReport (см. http://help.devexpress.com/#XtraReports/CustomDocument2162)
        }
        public void GetReportTemplates()
        {
            ReportsRestClient restClient = CreateRestClient();

            IList <ReportTemplateInfo> reportTemplates = restClient.GetReportTemplatesInfo();

            Assert.NotNull(reportTemplates);
            Assert.Greater(reportTemplates.Count, 0);

            //Создаем словарь шаблонов по их типам
            Dictionary <string, List <ReportTemplateInfo> > templatesByType =
                (from reportTemplate in reportTemplates
                 from typeCode in reportTemplate.TypeCodes
                 select new { reportTemplate, typeCode })
                .GroupBy(item => item.typeCode)
                .ToDictionary(group => group.Key, group => group.Select(item => item.reportTemplate).ToList());


            //Теперь очень просто получить все шаблоны по заданному типу.
            List <ReportTemplateInfo> templatesForInInvoice = templatesByType["ininvoice"];

            Assert.Greater(templatesForInInvoice.Count, 0);
        }