Здравствуйте.
После вызова из террасофта ReportPreviewer.Prepare(); хочется сохранить отчет как то так: ReportPreviewer.Save('C:\rez.xls','xls'); Как то это можно сделать?
var ReportDataset = fbcFilters.DatasetLink.Dataset;
var Report = Services.GetNewItemByUSI('fr_IncidentNotCloseOfPeriud');
var ReportPreviewer = Services.GetNewItemByUSI('wnd_BaseFastReportPreview');
var mainReportPreviewer = Services.GetNewItemByUSI('wnd_IncidentNotCloseOfPeriud');
var ReportPreviewerComponent = ReportPreviewer.Attributes('ReportPreviewer');
FilterEngine.ReportPreviewer = ReportPreviewerComponent;
FilterEngine.Report = FilterEngine.ReportPreviewer.Report;
FilterEngine.DateFilterWindow = wndDateFilter.Window;
var PeriodDataset = FilterEngine.DateFilterWindow.ComponentsByName('dlData').Dataset;
SetAttribute(ReportPreviewer, 'Report', Report);
ApplyDatasetFilter(ReportDataset, 'BeginDate', PeriodDataset('DateFrom'), true);
ApplyDatasetFilter(ReportDataset, 'EndDate', PeriodDataset('DateTo'), true);
fbcFilters.ApplyFilter();
if (ReportDataset.State != dstInactive) {
ReportDataset.Close();
}
ReportDataset.Open();
Report.Attributes('BeginDate') = PeriodDataset('DateFrom');
Report.Attributes('EndDate') = PeriodDataset('DateTo');
FilterEngine.ReportPreviewer = ReportPreviewerComponent;
FilterEngine.Report = FilterEngine.ReportPreviewer.Report;
FilterEngine.DateFilterWindow = wndDateFilter.Window;
ReportPreviewer.Build();
ReportPreviewer.Prepare();