devexpress-reporting
Version:
DevExpress Reporting provides the capability to develop a reporting application to create and customize reports.
58 lines (57 loc) • 2.26 kB
JavaScript
/**
* DevExpress HTML/JS Reporting (designer\wizard\internal\_legacyReportRequestModel.js)
* Version: 25.2.3
* Build date: Dec 15, 2025
* Copyright (c) 2012 - 2025 Developer Express Inc. ALL RIGHTS RESERVED
* License: https://www.devexpress.com/Support/EULAs/universal.xml
*/
import { PaperKind } from '../../utils/paperKind';
import { ReportType } from '../reportWizardState';
import { CommonRequestModel } from './_commonRequestModel';
export class LegacyReportRequestModel extends CommonRequestModel {
constructor(state) {
super(state);
if (state.reportType === ReportType.Standard) {
this.AdjustFieldWidth = state.fitFieldsToPage;
if (state.fields.length) {
this.Columns = state.fields.map((value) => { return value.name; });
this.ColumnInfo = state.fields.map(value => {
return {
Name: value.name,
DisplayName: value.displayName,
TypeSpecifics: 0
};
});
}
else {
this.Columns = null;
this.ColumnInfo = null;
}
this.DataSourceName = null;
this.GroupingLevels = state.groups;
this.Layout = state.layout;
this.Portrait = state.portrait;
this.ReportStyleId = state.style;
this.SummaryOptions = (state.summaryOptions || []).map((item) => {
return {
ColumnName: item.columnName,
Flags: item.flags
};
});
if (state.pageSetup) {
this.PaperKind = PaperKind[state.pageSetup.paperKind];
this.PaperSize = {
width: state.pageSetup.width,
height: state.pageSetup.height
};
this.Margins = {
left: state.pageSetup.marginLeft,
right: state.pageSetup.marginRight,
top: state.pageSetup.marginTop,
bottom: state.pageSetup.marginBottom
};
this.ReportUnit = state.pageSetup.reportUnit;
}
}
}
}