devexpress-reporting
Version:
DevExpress Reporting provides the capability to develop a reporting application to create and customize reports.
650 lines • 443 kB
JavaScript
require('jquery-ui/ui/focusable');
require('jquery-ui/ui/keycode');
require('devextreme/ui/tag_box');
var $ = require('jquery');
var ko = require('knockout');
var DevExpress = require('./dx-designer');
var Html = require('./html/web-document-viewer.html');
DevExpress.ui = DevExpress.ui || {};
DevExpress.ui.dxTextBox = DevExpress.ui.dxTextBox || require('devextreme/ui/text_box');
DevExpress.ui.dxGallery = DevExpress.ui.dxGallery || require('devextreme/ui/gallery');
DevExpress.ui.dxMenu = DevExpress.ui.dxMenu || require('devextreme/ui/menu');
DevExpress.utils = DevExpress.utils || {};
DevExpress.utils.browser = DevExpress.utils.browser || require('devextreme/core/utils/browser');
module.exports = { DevExpress: DevExpress, Html: Html };
module.exports.default = module.exports;
var __extends = (this && this.__extends) || function (d, b) {
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
var DevExpress;
(function (DevExpress) {
var Report;
(function (Report) {
var Preview;
(function (Preview) {
var MultiValueEditorOptions = (function (_super) {
__extends(MultiValueEditorOptions, _super);
function MultiValueEditorOptions(value, items) {
var _this = this;
_super.call(this);
this.selectedItems = ko.observable([]);
var values = value();
this.value = value;
var valueHasMutated = function () {
_this.editorValue.notifySubscribers(_this.displayItems[0]);
};
this._items = items.map(function (item) {
var selected = ko.observable(_this._isValueSelected(item.value, values));
return { selected: selected, value: item.value, displayValue: item.displayValue || item.value, toggleSelected: function () { selected(!selected()); valueHasMutated(); } };
});
this._disposables.push(this.selectedItems = ko.pureComputed(function () {
return _this._items.filter(function (item) { return item.selected(); });
}));
var selectionInProcess = ko.observable(false), isSelectedAllState, stringValue;
this._disposables.push(this.selectedValuesString = ko.pureComputed({
read: function () {
if (selectionInProcess())
return stringValue;
stringValue = "";
_this.selectedItems().forEach(function (item, index, array) {
stringValue += item.displayValue;
if (index < array.length - 1) {
stringValue += ", ";
}
});
return stringValue;
},
write: function (newValue) { }
}));
this._disposables.push(this.isSelectedAll = ko.pureComputed({
read: function () {
if (selectionInProcess())
return isSelectedAllState;
var selectedItemCount = _this.selectedItems().length;
if (selectedItemCount > 0 && selectedItemCount < _this._items.length) {
return undefined;
}
isSelectedAllState = selectedItemCount === _this._items.length;
return isSelectedAllState;
},
write: function (newValue) {
isSelectedAllState = newValue;
try {
selectionInProcess(true);
_this._items.forEach(function (item) { item.selected(newValue); });
}
finally {
selectionInProcess(false);
}
}
}));
var selectAllItem = { selected: this.isSelectedAll, value: null, displayValue: DevExpress.JS.Utils.getLocalization('(Select All)'), toggleSelected: function () { _this.isSelectedAll(!_this.isSelectedAll()); valueHasMutated(); } };
this.displayItems = [selectAllItem].concat(this._items);
this.dataSource = this.displayItems;
this.editorValue = ko.observable(selectAllItem);
this.updateValue = function () {
value(_this._items.filter(function (item) { return item.selected(); }).map(function (item) { return item.value; }));
valueHasMutated();
};
this.onOptionChanged = function (e) {
if (e.name !== "opened" || e.value)
return;
_this.updateValue();
};
}
MultiValueEditorOptions.prototype._isValueSelected = function (value, array) {
if (value instanceof Date) {
return array.filter(function (item) { return item - value === 0; }).length > 0;
}
return array.indexOf(value) !== -1;
};
return MultiValueEditorOptions;
})(DevExpress.JS.Utils.Disposable);
Preview.MultiValueEditorOptions = MultiValueEditorOptions;
var MultiValueEditor = (function (_super) {
__extends(MultiValueEditor, _super);
function MultiValueEditor(modelPropertyInfo, level, parentDisabled, textToSearch) {
var _this = this;
_super.call(this, modelPropertyInfo, level, parentDisabled, textToSearch);
this.options = ko.observable(null);
this.value.subscribe(function (newVal) {
_this.options() && _this.options().dispose();
_this.options(_this._createOptions(newVal));
});
this.options(this._createOptions(this.value()));
}
MultiValueEditor.prototype._createOptions = function (helper) {
if (!helper)
return null;
return new MultiValueEditorOptions(helper.value, helper.items);
};
return MultiValueEditor;
})(DevExpress.JS.Widgets.Editor);
Preview.MultiValueEditor = MultiValueEditor;
})(Preview = Report.Preview || (Report.Preview = {}));
})(Report = DevExpress.Report || (DevExpress.Report = {}));
})(DevExpress || (DevExpress = {}));
var DevExpress;
(function (DevExpress) {
var Report;
(function (Report) {
var Preview;
(function (Preview) {
Preview.cultureInfo = {};
Preview.editorTemplates = {
multiValue: { header: "dxrd-multivalue" },
multiValueEditable: { custom: "dxrd-multivalue-editable" },
multiValueSelectBox: { header: "dxrd-multivalue-selectbox", editorType: Preview.MultiValueEditor },
csvSeparator: { header: DevExpress.JS.Widgets.editorTemplates.text.header, extendedOptions: { placeholder: function () { return (DevExpress.Report.Preview.cultureInfo["csvTextSeparator"] || "") + " " + DevExpress.Designer.getLocalization("(Using System Separator)", "PreviewStringId.ExportOption_CsvSeparator_UsingSystem"); } } },
selectBox: { header: "dx-selectbox" }
};
})(Preview = Report.Preview || (Report.Preview = {}));
})(Report = DevExpress.Report || (DevExpress.Report = {}));
})(DevExpress || (DevExpress = {}));
var DevExpress;
(function (DevExpress) {
var Designer;
(function (Designer) {
var Report;
(function (Report) {
Report.pageBorderColor = { propertyName: "pageBorderColor", modelName: "@PageBorderColor", from: Designer.colorFromString, toJsonObject: Designer.colorToString, displayName: "Page Border Color", localizationId: "DevExpress.XtraPrinting.HtmlExportOptionsBase.PageBorderColor", editor: Designer.Widgets.editorTemplates.customColorEditor, defaultVal: "Black" };
Report.pageBorderWidth = { propertyName: "pageBorderWidth", modelName: "@PageBorderWidth", displayName: "Page Border Width", localizationId: "DevExpress.XtraPrinting.HtmlExportOptionsBase.PageBorderWidth", from: Designer.floatFromModel, editor: DevExpress.JS.Widgets.editorTemplates.numeric, defaultVal: 1 };
Report.pageRange = { propertyName: "pageRange", modelName: "@PageRange", displayName: "Page Range", localizationId: "DevExpress.XtraPrinting.HtmlExportOptionsBase.PageRange", editor: DevExpress.JS.Widgets.editorTemplates.text, defaultVal: "" };
Report.expotOptionsTitle = { propertyName: "title", modelName: "@Title", displayName: "Title", localizationId: "DevExpress.XtraPrinting.HtmlExportOptionsBase.Title", editor: DevExpress.JS.Widgets.editorTemplates.text, defaultVal: "Document" };
Report.htmlTableLayout = { propertyName: "tableLayout", modelName: "@TableLayout", displayName: "Table Layout", localizationId: "DevExpress.XtraPrinting.HtmlExportOptionsBase.TableLayout", editor: DevExpress.JS.Widgets.editorTemplates.bool, from: Designer.parseBool, defaultVal: true };
Report.docxTableLayout = { propertyName: "tableLayout", modelName: "@TableLayout", displayName: "Table Layout", localizationId: "DevExpress.XtraPrinting.DocxExportOptions.TableLayout", editor: DevExpress.JS.Widgets.editorTemplates.bool, from: Designer.parseBool, defaultVal: false };
Report.allowURLsWithJSContent = { propertyName: "allowURLsWithJSContent", modelName: "@AllowURLsWithJSContent", displayName: "Allow URLs with JS Content", localizationId: "DevExpress.XtraPrinting.HtmlExportOptionsBase.AllowURLsWithJSContent", editor: DevExpress.JS.Widgets.editorTemplates.bool, from: Designer.parseBool, defaultVal: true };
Report.rasterizationResolution = { propertyName: "rasterizationResolution", modelName: "@RasterizationResolution", displayName: "Rasterization Resolution", localizationId: "DevExpress.XtraPrinting.PageByPageExportOptionsBase.RasterizationResolution", editor: DevExpress.JS.Widgets.editorTemplates.numeric, defaultVal: 96 };
Report.rasterizeImages = { propertyName: "rasterizeImages", modelName: "@RasterizeImages", displayName: "Rasterize Images", localizationId: "DevExpress.XtraPrinting.PageByPageExportOptionsBase.RasterizeImages", defaultVal: true, editor: DevExpress.JS.Widgets.editorTemplates.bool, from: Designer.parseBool };
Report.useHRefHyperlinks = { propertyName: "useHRefHyperlinks", modelName: "@UseHRefHyperlinks", displayName: "Use HRef Hyperlinks", localizationId: "DevExpress.XtraPrinting.HtmlExportOptionsBase.UseHRefHyperlinks", editor: DevExpress.JS.Widgets.editorTemplates.bool, from: Designer.parseBool, defaultVal: false };
Report.exportWatermarks = { propertyName: "exportWatermarks", modelName: "@ExportWatermarks", displayName: "Export Watermarks", localizationId: "DevExpress.XtraPrinting.HtmlExportOptionsBase.ExportWatermarks", defaultVal: true, editor: DevExpress.JS.Widgets.editorTemplates.bool, from: Designer.parseBool };
Report.inlineCss = { propertyName: "inlineCss", modelName: "@InlineCss", displayName: "Inline CSS", localizationId: "DevExpress.XtraPrinting.HtmlExportOptionsBase.InlineCss", defaultVal: false, editor: DevExpress.JS.Widgets.editorTemplates.bool, from: Designer.parseBool };
Report.removeSecondarySymbols = { propertyName: "removeSecondarySymbols", modelName: "@RemoveSecondarySymbols", displayName: "Remove Secondary Symbols", localizationId: "DevExpress.XtraPrinting.HtmlExportOptionsBase.RemoveSecondarySymbols", editor: DevExpress.JS.Widgets.editorTemplates.bool, from: Designer.parseBool, defaultVal: false };
Report.characterSet = {
propertyName: "characterSet", modelName: "@CharacterSet", displayName: "Character Set", localizationId: "DevExpress.XtraPrinting.HtmlExportOptionsBase.CharacterSet", editor: DevExpress.JS.Widgets.editorTemplates.combobox, defaultVal: "utf-8",
valuesArray: [{ value: "windows-1256", displayValue: "Arabic (Windows)" }, { value: "iso-8859-4", displayValue: "Baltic (ISO)" }, { value: "windows-1257", displayValue: "Baltic (Windows)" }, { value: "iso-8859-2", displayValue: "Central European (ISO)" }, { value: "windows-1250", displayValue: "Central European (Windows)" }, { value: "iso-8859-5", displayValue: "Cyrillic (ISO)" }, { value: "koi8-r", displayValue: "Cyrillic (KOI8-r)" }, { value: "windows-1251", displayValue: "Cyrillic (Windows)" }, { value: "iso-8859-15", displayValue: "Latin 9 (ISO)" }, { value: "utf-7", displayValue: "Unicode (UTF-7)" }, { value: "utf-8", displayValue: "Unicode (UTF-8)" }, { value: "iso-8859-1", displayValue: "Western European (ISO)" }, { value: "windows-1252", displayValue: "Western European (Windows)" }]
};
function getExportModeValues(format, preview, merged) {
if (format === void 0) { format = "Html"; }
var singleFile = { value: "SingleFile", displayValue: "Single File", localizationId: DevExpress.JS.Utils.formatUnicorn("PreviewStringId.ExportOption_{0}ExportMode_SingleFile", format) };
var singleFilePageByPage = { value: "SingleFilePageByPage", displayValue: "Single File PageByPage", localizationId: DevExpress.JS.Utils.formatUnicorn("PreviewStringId.ExportOption_{0}ExportMode_SingleFilePageByPage", format) };
var differentFiles = { value: "DifferentFiles", displayValue: "Different Files", localizationId: DevExpress.JS.Utils.formatUnicorn("PreviewStringId.ExportOption_{0}ExportMode_DifferentFiles", format) };
var values = [];
if (merged) {
return [singleFilePageByPage];
}
else if (preview) {
return [singleFile, singleFilePageByPage];
}
else {
return [singleFile, singleFilePageByPage, differentFiles];
}
}
Report.getExportModeValues = getExportModeValues;
Report.exportPageBreaks = { propertyName: "exportPageBreaks", modelName: "@ExportPageBreaks", displayName: "Export Page Breaks", localizationId: "DevExpress.XtraPrinting.FormattedTextExportOptions.ExportPageBreaks", defaultVal: true, editor: DevExpress.JS.Widgets.editorTemplates.bool, from: Designer.parseBool };
Report.rtfExportMode = {
propertyName: "rtfExportMode", modelName: "@ExportMode", defaultVal: "SingleFilePageByPage",
editor: DevExpress.JS.Widgets.editorTemplates.combobox, displayName: "Export Mode", localizationId: "DevExpress.XtraPrinting.RtfExportOptions.ExportMode",
valuesArray: getExportModeValues("Rtf", true)
};
Report.docxExportMode = {
propertyName: "docxExportMode", modelName: "@ExportMode", defaultVal: "SingleFilePageByPage",
editor: DevExpress.JS.Widgets.editorTemplates.combobox, displayName: "Export Mode", localizationId: "DevExpress.XtraPrinting.DocxExportOptions.ExportMode",
valuesArray: getExportModeValues("Docx", true)
};
Report.rtfExportModeMergedPreview = $.extend({}, Report.rtfExportMode, {
valuesArray: getExportModeValues("Rtf", true, true)
});
Report.docxExportModeMergedPreview = $.extend({}, Report.docxExportMode, {
valuesArray: getExportModeValues("Docx", true, true)
});
Report.htmlExportMode = {
propertyName: "htmlExportMode", modelName: "@ExportMode", defaultVal: "SingleFile",
editor: DevExpress.JS.Widgets.editorTemplates.combobox, displayName: "Export Mode", localizationId: "DevExpress.XtraPrinting.HtmlExportOptionsBase.ExportMode",
valuesArray: getExportModeValues("Html")
};
Report.embedImagesInHTML = {
propertyName: "embedImagesInHTML", modelName: "@EmbedImagesInHTML", defaultVal: false,
editor: DevExpress.JS.Widgets.editorTemplates.bool, from: Designer.parseBool, displayName: "Embed Images In HTML", localizationId: "DevExpress.XtraPrinting.HtmlExportOptions.EmbedImagesInHTML"
};
Report.imageExportMode = {
propertyName: "imageExportMode", modelName: "@ExportMode", defaultVal: "SingleFile",
editor: DevExpress.JS.Widgets.editorTemplates.combobox, displayName: "Export Mode", localizationId: "DevExpress.XtraPrinting.ImageExportOptions.ExportMode",
valuesArray: getExportModeValues("Image")
};
Report.xlsExportMode = {
propertyName: "xlsExportMode", modelName: "@ExportMode", defaultVal: "SingleFile",
editor: DevExpress.JS.Widgets.editorTemplates.combobox, displayName: "Export Mode", localizationId: "DevExpress.XtraPrinting.XlsExportOptions.ExportMode",
valuesArray: getExportModeValues("Xls")
};
Report.xlsxExportMode = {
propertyName: "xlsxExportMode", modelName: "@ExportMode", defaultVal: "SingleFile",
editor: DevExpress.JS.Widgets.editorTemplates.combobox, displayName: "Export Mode", localizationId: "DevExpress.XtraPrinting.XlsxExportOptions.ExportMode",
valuesArray: getExportModeValues("Xlsx")
};
function getTextExportModeValues() {
return [
{ value: "Text", displayValue: "Text", localizationId: "DevExpress.XtraPrinting.TextExportMode.Text" },
{ value: "Value", displayValue: "Value", localizationId: "DevExpress.XtraPrinting.TextExportMode.Value" }
];
}
Report.textExportMode = {
propertyName: "textExportMode", modelName: "@TextExportMode", displayName: "Text Export Mode", localizationId: "DevExpress.XtraPrinting.TextExportOptionsBase.TextExportMode", defaultVal: "Text", editor: DevExpress.JS.Widgets.editorTemplates.combobox,
valuesArray: getTextExportModeValues()
};
Report.xlsTextExportMode = {
propertyName: "textExportMode", modelName: "@TextExportMode", displayName: "Text Export Mode", localizationId: "DevExpress.XtraPrinting.XlExportOptionsBase.TextExportMode", defaultVal: "Value", editor: DevExpress.JS.Widgets.editorTemplates.combobox,
valuesArray: getTextExportModeValues()
};
Report.csvTextSeparator = { propertyName: "separator", modelName: "@Separator", defaultVal: "", displayName: "Separator", localizationId: "DevExpress.XtraPrinting.TextExportOptionsBase.Separator", editor: DevExpress.Report.Preview.editorTemplates.csvSeparator }, Report.useCustomSeparator = { propertyName: "useCustomSeparator", displayName: "Use Custom Separator", localizationId: "DevExpress.XtraPrinting.CsvExportOptions.UseCustomSeparator", editor: DevExpress.JS.Widgets.editorTemplates.bool };
Report.textEncodingType = {
propertyName: "encodingType", modelName: "@EncodingType", displayName: "Encoding", localizationId: "DevExpress.XtraPrinting.TextExportOptionsBase.Encoding", editor: DevExpress.JS.Widgets.editorTemplates.combobox, defaultVal: "Default", from: Designer.fromEnum,
valuesArray: [
{ value: "Default", displayValue: "Windows-1252", localizationId: "DevExpress.XtraPrinting.EncodingType.Default" },
{ value: "ASCII", displayValue: "us-ascii", localizationId: "DevExpress.XtraPrinting.EncodingType.ASCII" },
{ value: "Unicode", displayValue: "utf-16", localizationId: "DevExpress.XtraPrinting.EncodingType.Unicode" },
{ value: "BigEndianUnicode", displayValue: "utf-16BE", localizationId: "DevExpress.XtraPrinting.EncodingType.BigEndianUnicode" },
{ value: "UTF7", displayValue: "utf-7", localizationId: "DevExpress.XtraPrinting.EncodingType.UTF7" },
{ value: "UTF8", displayValue: "utf-8", localizationId: "DevExpress.XtraPrinting.EncodingType.UTF8" },
{ value: "UTF32", displayValue: "utf-32", localizationId: "DevExpress.XtraPrinting.EncodingType.UTF32" }
]
};
Report.xlsExportHyperlinks = {
propertyName: "exportHyperlinks", modelName: "@ExportHyperlinks", displayName: "Export Hyperlinks", localizationId: "DevExpress.XtraPrinting.XlsExportOptions.ExportHyperlinks", defaultVal: true, editor: DevExpress.JS.Widgets.editorTemplates.bool, from: Designer.parseBool
};
Report.xlsRawDataMode = {
propertyName: "rawDataMode", modelName: "@RawDataMode", displayName: "Raw Data Mode", localizationId: "DevExpress.XtraPrinting.XlsExportOptions.RawDataMode", defaultVal: false, editor: DevExpress.JS.Widgets.editorTemplates.bool, from: Designer.parseBool
};
Report.xlsShowGridLines = {
propertyName: "showGridLines", modelName: "@ShowGridLines", displayName: "Show Grid Lines", localizationId: "DevExpress.XtraPrinting.XlsExportOptions.ShowGridLines", defaultVal: false, editor: DevExpress.JS.Widgets.editorTemplates.bool, from: Designer.parseBool
};
Report.xlsExportOptionsSheetName = {
propertyName: "sheetName", modelName: "@SheetName", displayName: "Sheet Name", localizationId: "DevExpress.XtraPrinting.XlsExportOptions.SheetName", defaultVal: "Sheet", editor: DevExpress.JS.Widgets.editorTemplates.text
};
function excludeModesForMergedDocuments(val) {
return ko.observable("SingleFilePageByPage");
}
Report.excludeModesForMergedDocuments = excludeModesForMergedDocuments;
function excludeDifferentFilesMode(val) {
return ko.observable(val === "DifferentFiles" ? "SingleFile" : val);
}
Report.excludeDifferentFilesMode = excludeDifferentFilesMode;
Report.htmlExportModePreviewBase = {
propertyName: Report.htmlExportMode.propertyName, modelName: Report.htmlExportMode.modelName, defaultVal: Report.htmlExportMode.defaultVal,
editor: Report.htmlExportMode.editor, displayName: Report.htmlExportMode.displayName, localizationId: Report.htmlExportMode.localizationId
};
Report.htmlExportModePreview = $.extend({}, Report.htmlExportModePreviewBase, {
from: excludeDifferentFilesMode,
valuesArray: getExportModeValues("Html", true)
});
Report.htmlExportModeMergedPreview = $.extend({}, Report.htmlExportModePreviewBase, {
valuesArray: getExportModeValues("Html", true, true)
});
Report.xlsExportModePreviewBase = {
propertyName: Report.xlsExportMode.propertyName, modelName: Report.xlsExportMode.modelName, defaultVal: Report.xlsExportMode.defaultVal,
editor: Report.xlsExportMode.editor, displayName: Report.xlsExportMode.displayName, localizationId: Report.xlsExportMode.localizationId
};
Report.xlsExportModePreview = $.extend({}, Report.xlsExportModePreviewBase, {
from: excludeDifferentFilesMode,
valuesArray: getExportModeValues("Xls", true)
});
Report.xlsExportModeMergedPreview = $.extend({}, Report.xlsExportModePreviewBase, {
valuesArray: getExportModeValues("Xls", true, true)
});
Report.imageExportModePreviewBase = {
propertyName: Report.imageExportMode.propertyName, modelName: Report.imageExportMode.modelName, defaultVal: Report.imageExportMode.defaultVal,
editor: Report.imageExportMode.editor, displayName: Report.imageExportMode.displayName, localizationId: Report.imageExportMode.localizationId
};
Report.imageExportModePreview = $.extend({}, Report.imageExportModePreviewBase, {
from: excludeDifferentFilesMode,
valuesArray: getExportModeValues("Image", true)
});
Report.imageExportModeMergedPreview = $.extend({}, Report.imageExportModePreviewBase, {
valuesArray: getExportModeValues("Image", true, true)
});
Report.xlsxExportModePreviewBase = {
propertyName: Report.xlsxExportMode.propertyName, modelName: Report.xlsxExportMode.modelName, defaultVal: Report.xlsxExportMode.defaultVal,
editor: Report.xlsxExportMode.editor, displayName: Report.xlsxExportMode.displayName, localizationId: Report.xlsxExportMode.localizationId
};
Report.xlsxExportModePreview = $.extend({}, Report.xlsxExportModePreviewBase, {
from: excludeDifferentFilesMode,
valuesArray: getExportModeValues("Xlsx", true)
});
Report.xlsxExportModeMergedPreview = $.extend({}, Report.xlsxExportModePreviewBase, {
valuesArray: getExportModeValues("Xlsx", true, true)
});
Report.previewBackColor = { propertyName: "backColor", modelName: "@BackColor", from: Designer.colorFromString, toJsonObject: Designer.colorToString };
Report.previewSides = { propertyName: "borders", modelName: "@Sides" };
Report.previewBorderColor = { propertyName: "borderColor", modelName: "@BorderColor", from: Designer.colorFromString, toJsonObject: Designer.colorToString };
Report.previewBorderStyle = { propertyName: "borderStyle", modelName: "@BorderStyle" };
Report.previewBorderDashStyle = { propertyName: "borderDashStyle", modelName: "@BorderDashStyle" };
Report.previewBorderWidth = { propertyName: "borderWidth", modelName: "@BorderWidthSerializable", from: Designer.floatFromModel };
Report.previewForeColor = { propertyName: "foreColor", modelName: "@ForeColor", from: Designer.colorFromString, toJsonObject: Designer.colorToString };
Report.previewFont = { propertyName: "font", modelName: "@Font" };
Report.previewPadding = { propertyName: "padding", modelName: "@Padding", from: Designer.Widgets.PaddingModel.from };
Report.previewTextAlignment = { propertyName: "textAlignment", modelName: "@TextAlignment" };
Report.brickStyleSerializationsInfo = [
Report.previewBackColor,
Report.previewSides,
Report.previewBorderColor,
Report.previewBorderStyle,
Report.previewBorderDashStyle,
Report.previewBorderWidth,
Report.previewForeColor,
Report.previewFont,
Report.previewPadding,
Report.previewTextAlignment
];
})(Report = Designer.Report || (Designer.Report = {}));
})(Designer = DevExpress.Designer || (DevExpress.Designer = {}));
})(DevExpress || (DevExpress = {}));
var DevExpress;
(function (DevExpress) {
var Report;
(function (Report) {
var Preview;
(function (Preview) {
Preview.AsyncExportApproach = false;
Preview.ExportFormatID = {
PDF: { text: "PDF", textId: "ASPxReportsStringId.ExportName_pdf", format: "pdf" },
XLS: { text: "XLS", textId: "ASPxReportsStringId.ExportName_xls", format: "xls" },
XLSX: { text: "XLSX", textId: "ASPxReportsStringId.ExportName_xlsx", format: "xlsx" },
RTF: { text: "RTF", textId: "ASPxReportsStringId.ExportName_rtf", format: "rtf" },
MHT: { text: "MHT", textId: "ASPxReportsStringId.ExportName_mht", format: "mht" },
HTML: { text: "HTML", textId: "ASPxReportsStringId.ExportName_html", format: "html" },
Text: { text: "Text", textId: "ASPxReportsStringId.ExportName_txt", format: "txt" },
CSV: { text: "CSV", textId: "ASPxReportsStringId.ExportName_csv", format: "csv" },
Image: { text: "Image", textId: "ASPxReportsStringId.ExportName_png", format: "image" },
DOCX: { text: "DOCX", textId: "ASPxReportsStringId.ExportName_docx", format: "docx" }
};
var ExportOptionsModel = (function () {
function ExportOptionsModel(reportPreview) {
var _this = this;
this.actions = [];
this._reportPreview = reportPreview;
this.tabInfo = new DevExpress.Designer.TabInfo("Export Options", "dxrd-preview-export-options", reportPreview.exportOptionsModel, 'DevExpress.XtraPrinting.ExportOptions', "properties", ko.pureComputed(function () { return !!reportPreview.exportOptionsModel(); }));
this.actions.push({
id: Preview.ActionId.ExportTo,
text: "Export To",
textId: "ASPxReportsStringId.WebDocumentViewer_ExportToText",
disabled: reportPreview.exportDisabled,
visible: true,
clickAction: function (model) {
if (reportPreview.exportDisabled())
return;
_this._exportDocumentByFormat(model.itemData.format);
},
items: ko.pureComputed(function () {
var result = _this._getExportFormatItems();
return [{
text: "Export To",
textId: "ASPxReportsStringId.WebDocumentViewer_ExportToText",
imageClassName: "dxrd-image-export-to",
items: result
}];
}),
templateName: "dxrd-preview-export-to"
});
}
ExportOptionsModel.prototype._getExportFormatItems = function () {
var result = [];
var exportOptionsModel = this._reportPreview.exportOptionsModel();
if (exportOptionsModel) {
exportOptionsModel.pdf && result.push(Preview.ExportFormatID.PDF);
exportOptionsModel.xls && result.push(Preview.ExportFormatID.XLS);
exportOptionsModel.xlsx && result.push(Preview.ExportFormatID.XLSX);
exportOptionsModel.rtf && result.push(Preview.ExportFormatID.RTF);
exportOptionsModel.docx && result.push(Preview.ExportFormatID.DOCX);
exportOptionsModel.mht && result.push(Preview.ExportFormatID.MHT);
exportOptionsModel.html && result.push(Preview.ExportFormatID.HTML);
exportOptionsModel.textExportOptions && result.push(Preview.ExportFormatID.Text);
exportOptionsModel.csv && result.push(Preview.ExportFormatID.CSV);
exportOptionsModel.image && result.push(Preview.ExportFormatID.Image);
}
;
return result;
};
ExportOptionsModel.prototype._exportDocumentByFormat = function (format) {
format && this._reportPreview.exportDocumentTo(format);
};
ExportOptionsModel.prototype.getActions = function (context) {
return this.actions;
};
return ExportOptionsModel;
})();
Preview.ExportOptionsModel = ExportOptionsModel;
})(Preview = Report.Preview || (Report.Preview = {}));
})(Report = DevExpress.Report || (DevExpress.Report = {}));
})(DevExpress || (DevExpress = {}));
var DevExpress;
(function (DevExpress) {
var Designer;
(function (Designer) {
var Report;
(function (Report) {
var CsvExportOptions = (function () {
function CsvExportOptions(model, serializer) {
var _this = this;
this.defaultSeparatorValue = "";
serializer = serializer || new DevExpress.JS.Utils.ModelSerializer();
serializer.deserialize(this, model);
this.useCustomSeparator = ko.observable(this.separator && this.separator() !== this.defaultSeparatorValue);
var separatorValue = ko.observable(this.separator());
this.useCustomSeparator.subscribe(function (newValue) {
if (!newValue)
separatorValue(_this.defaultSeparatorValue);
});
this.separator = ko.computed({
read: function () { return separatorValue(); },
write: function (newValue) {
separatorValue(newValue);
if (_this.useCustomSeparator)
_this.useCustomSeparator(newValue !== _this.defaultSeparatorValue);
}
});
}
CsvExportOptions.from = function (model, serializer) {
return new CsvExportOptions(model || {}, serializer);
};
CsvExportOptions.toJson = function (value, serializer, refs) {
return serializer.serialize(value, csvExportOptionsSerializationInfo, refs);
};
CsvExportOptions.prototype.getInfo = function () {
return csvExportOptionsSerializationInfo;
};
CsvExportOptions.prototype.isPropertyDisabled = function (name) {
return (name === "separator") && !(this.useCustomSeparator && this.useCustomSeparator());
};
return CsvExportOptions;
})();
Report.CsvExportOptions = CsvExportOptions;
var csvExportOptionsSerializationInfo = [
Report.textEncodingType,
Report.textExportMode,
{ propertyName: "quoteStringsWithSeparators", modelName: "@QuoteStringsWithSeparators", displayName: "Quote Strings with Separators", localizationId: "DevExpress.XtraPrinting.TextExportOptionsBase.QuoteStringsWithSeparators", defaultVal: true, editor: DevExpress.JS.Widgets.editorTemplates.bool, from: Designer.parseBool },
Report.useCustomSeparator, Report.csvTextSeparator,
{ propertyName: "skipEmptyRows", modelName: "@SkipEmptyRows", displayName: "Skip Empty Rows", localizationId: "DevExpress.XtraPrinting.CsvExportOptions.SkipEmptyRows", defaultVal: true, editor: DevExpress.JS.Widgets.editorTemplates.bool, from: Designer.parseBool },
{ propertyName: "skipEmptyColumns", modelName: "@SkipEmptyColumns", displayName: "Skip Empty Columns", localizationId: "DevExpress.XtraPrinting.CsvExportOptions.SkipEmptyColumns", defaultVal: true, editor: DevExpress.JS.Widgets.editorTemplates.bool, from: Designer.parseBool }
];
var ImageExportOptions = (function () {
function ImageExportOptions(model, serializer) {
serializer = serializer || new DevExpress.JS.Utils.ModelSerializer();
serializer.deserialize(this, model);
}
ImageExportOptions.from = function (model, serializer) {
return new ImageExportOptions(model || {}, serializer);
};
ImageExportOptions.toJson = function (value, serializer, refs) {
return serializer.serialize(value, imageExportOptionsSerializationInfo, refs);
};
ImageExportOptions.prototype.getInfo = function () {
return imageExportOptionsSerializationInfo;
};
ImageExportOptions.prototype.isPropertyDisabled = function (name) {
return ((name === "pageRange") || (name === "pageBorderWidth")) && ((this.imageExportMode ? this.imageExportMode() : Report.imageExportMode.defaultVal) === "SingleFile");
};
return ImageExportOptions;
})();
Report.ImageExportOptions = ImageExportOptions;
var imageExportOptionsSerializationInfoBase = [
Report.pageBorderColor,
Report.pageBorderWidth,
Report.pageRange,
{ propertyName: "resolution", modelName: "@Resolution", displayName: "Resolution", localizationId: "DevExpress.XtraPrinting.ImageExportOptions.Resolution", editor: DevExpress.JS.Widgets.editorTemplates.numeric, defaultVal: 96 },
{
propertyName: "format", modelName: "@Format", displayName: "Format", localizationId: "DevExpress.XtraPrinting.ImageExportOptions.Format", editor: DevExpress.JS.Widgets.editorTemplates.combobox, defaultVal: "Png", from: Designer.fromEnum,
valuesArray: [
{ value: "Bmp", displayValue: "BMP" },
{ value: "Gif", displayValue: "GIF" },
{ value: "Jpeg", displayValue: "JPEG" },
{ value: "Png", displayValue: "PNG" },
{ value: "Emf", displayValue: "EMF" },
{ value: "Wmf", displayValue: "WMF" },
{ value: "Tiff", displayValue: "TIFF" }
]
}
];
var imageExportOptionsSerializationInfo = [Report.imageExportMode,
{ propertyName: "retainBackgroundTransparency", modelName: "@RetainBackgroundTransparency", displayName: "Retain Background Transparency", localizationId: "DevExpress.XtraPrinting.ImageExportOptions.RetainBackgroundTransparency", defaultVal: false, editor: DevExpress.JS.Widgets.editorTemplates.bool, from: Designer.parseBool },
{
propertyName: "textRenderingMode", modelName: "@TextRenderingMode", displayName: "Text Rendering Mode", localizationId: "DevExpress.XtraPrinting.ImageExportOptions.TextRenderingMode", editor: DevExpress.JS.Widgets.editorTemplates.combobox, defaultVal: "SystemDefault", from: Designer.fromEnum,
valuesArray: [
{ value: "SystemDefault", displayValue: "SystemDefault", localizationId: "DevExpress.XtraPrinting.TextRenderingMode.SystemDefault" },
{ value: "SingleBitPerPixelGridFit", displayValue: "SingleBitPerPixelGridFit", localizationId: "DevExpress.XtraPrinting.TextRenderingMode.SingleBitPerPixelGridFit" },
{ value: "SingleBitPerPixel", displayValue: "SingleBitPerPixel", localizationId: "DevExpress.XtraPrinting.TextRenderingMode.SingleBitPerPixel" },
{ value: "AntiAliasGridFit", displayValue: "AntiAliasGridFit", localizationId: "DevExpress.XtraPrinting.TextRenderingMode.AntiAliasGridFit" },
{ value: "AntiAlias", displayValue: "AntiAlias", localizationId: "DevExpress.XtraPrinting.TextRenderingMode.AntiAlias" },
{ value: "ClearTypeGridFit", displayValue: "ClearTypeGridFit", localizationId: "DevExpress.XtraPrinting.TextRenderingMode.ClearTypeGridFit" }
]
}
].concat(imageExportOptionsSerializationInfoBase);
var htmlExportOptionsSerializationInfoBase = [
Report.pageBorderColor,
Report.pageBorderWidth,
Report.pageRange,
Report.rasterizationResolution,
Report.expotOptionsTitle,
Report.htmlTableLayout,
Report.useHRefHyperlinks,
Report.allowURLsWithJSContent,
Report.removeSecondarySymbols,
Report.exportWatermarks,
Report.characterSet
];
var htmlExportOptionsSerializationInfo = [Report.htmlExportMode, Report.embedImagesInHTML, Report.inlineCss].concat(htmlExportOptionsSerializationInfoBase);
var HtmlExportOptions = (function () {
function HtmlExportOptions(model, serializer) {
serializer = serializer || new DevExpress.JS.Utils.ModelSerializer();
serializer.deserialize(this, model);
}
HtmlExportOptions.from = function (model, serializer) {
return new HtmlExportOptions(model || {}, serializer);
};
HtmlExportOptions.toJson = function (value, serializer, refs) {
return serializer.serialize(value, htmlExportOptionsSerializationInfo, refs);
};
HtmlExportOptions.prototype.getInfo = function () {
return htmlExportOptionsSerializationInfo;
};
HtmlExportOptions.prototype.isPropertyDisabled = function (name) {
return ((name === "pageRange") || (name === "pageBorderWidth") || (name === "exportWatermarks")) && ((this.htmlExportMode ? this.htmlExportMode() : Report.htmlExportMode.defaultVal) === "SingleFile");
};
return HtmlExportOptions;
})();
Report.HtmlExportOptions = HtmlExportOptions;
var mhtExportOptionsSerializationInfoBase = [
Report.pageBorderColor,
Report.pageBorderWidth,
Report.pageRange,
Report.rasterizationResolution,
Report.expotOptionsTitle,
Report.characterSet,
Report.htmlTableLayout,
Report.useHRefHyperlinks,
Report.allowURLsWithJSContent,
Report.removeSecondarySymbols,
Report.exportWatermarks
];
var mhtExportOptionsSerializationInfo = [Report.htmlExportMode, Report.inlineCss].concat(mhtExportOptionsSerializationInfoBase);
var MhtExportOptions = (function () {
function MhtExportOptions(model, serializer) {
serializer = serializer || new DevExpress.JS.Utils.ModelSerializer();
serializer.deserialize(this, model);
}
MhtExportOptions.from = function (model, serializer) {
return new MhtExportOptions(model || {}, serializer);
};
MhtExportOptions.toJson = function (value, serializer, refs) {
return serializer.serialize(value, mhtExportOptionsSerializationInfo, refs);
};
MhtExportOptions.prototype.getInfo = function () {
return mhtExportOptionsSerializationInfo;
};
MhtExportOptions.prototype.isPropertyDisabled = function (name) {
return ((name === "pageRange") || (name === "pageBorderWidth")) && ((this.htmlExportMode ? this.htmlExportMode() : Report.htmlExportMode.defaultVal) === "SingleFile");
};
return MhtExportOptions;
})();
Report.MhtExportOptions = MhtExportOptions;
var PdfExportDocumentOptions = (function () {
function PdfExportDocumentOptions(model, serializer) {
serializer = serializer || new DevExpress.JS.Utils.ModelSerializer();
serializer.deserialize(this, model);
}
PdfExportDocumentOptions.from = function (model, serializer) {
return new PdfExportDocumentOptions(model || {}, serializer);
};
PdfExportDocumentOptions.toJson = function (value, serializer, refs) {
return serializer.serialize(value, pdfExportDocumentOptionsSerializationInfo, refs);
};
PdfExportDocumentOptions.prototype.getInfo = function () {
return pdfExportDocumentOptionsSerializationInfo;
};
return PdfExportDocumentOptions;
})();
Report.PdfExportDocumentOptions = PdfExportDocumentOptions;
var author = { propertyName: "author", modelName: "@Author", displayName: "Author", localizationId: "DevExpress.XtraPrinting.PdfDocumentOptions.Author", defaultVal: "", editor: DevExpress.JS.Widgets.editorTemplates.text }, application = { propertyName: "application", modelName: "@Application", displayName: "Application", localizationId: "DevExpress.XtraPrinting.PdfDocumentOptions.Application", defaultVal: "", editor: DevExpress.JS.Widgets.editorTemplates.text }, title = { propertyName: "title", modelName: "@Title", displayName: "Title", localizationId: "DevExpress.XtraPrinting.PdfDocumentOptions.Title", defaultVal: "", editor: DevExpress.JS.Widgets.editorTemplates.text }, subject = { propertyName: "subject", modelName: "@Subject", displayName: "Subject", localizationId: "DevExpress.XtraPrinting.PdfDocumentOptions.Subject", defaultVal: "", editor: DevExpress.JS.Widgets.editorTemplates.text };
var pdfExportDocumentOptionsSerializationInfo = [
author, application, title, subject,
{ propertyName: "keywords", modelName: "@Keywords", displayName: "Keywords", localizationId: "DevExpress.XtraPrinting.PdfDocumentOptions.Keywords", defaultVal: "", editor: DevExpress.JS.Widgets.editorTemplates.text }
];
var PdfPermissionsOptions = (function () {
function PdfPermissionsOptions(model, serializer) {
serializer = serializer || new DevExpress.JS.Utils.ModelSerializer();
serializer.deserialize(this, model);
}
PdfPermissionsOptions.from = function (model, serializer) {
return new PdfPermissionsOptions(model || {}, serializer);
};
PdfPermissionsOptions.toJson = function (value, serializer, refs) {
return serializer.serialize(value, pdfExportPermissionsOptionsSerializationInfo, refs);
};
PdfPermissionsOptions.prototype.getInfo = function () {
return pdfExportPermissionsOptionsSerializationInfo;
};
return PdfPermissionsOptions;
})();
Report.PdfPermissionsOptions = PdfPermissionsOptions;
var pdfExportPermissionsOptionsSerializationInfo = [
{
propertyName: "printingPermissions", modelName: "@PrintingPermissions", displayName: "Printing Permissions", localizationId: "DevExpress.XtraPrinting.PdfPermissionsOptions.PrintingPermissions", defaultVal: "None", editor: DevExpress.JS.Widgets.editorTemplates.combobox,
valuesArray: [
{ value: "None", displayValue: "None", localizationId: "DevExpress.XtraPrinting.PrintingPermissions.None" },
{ value: "LowResolution", displayValue: "LowResolution", localizationId: "DevExpress.XtraPrinting.PrintingPermissions.LowResolution" },
{ value: "HighResolution", displayValue: "HighResolution", localizationId: "DevExpress.XtraPrinting.PrintingPermissions.HighResolution" }
]
},
{
propertyName: "changingPermissions", modelName: "@ChangingPermissions", displayName: "Changing Permissions", localizationId: "DevExpress.XtraPrinting.PdfPermissionsOptions.ChangingPermissions", defaultVal: "None", editor: DevExpress.JS.Widgets.editorTemplates.combobox,
valuesArray: [
{ value: "None", displayValue: "None", localizationId: "DevExpress.XtraPrinting.ChangingPermissions.None" },
{ value: "InsertingDeletingRotating", displayValue: "InsertingDeletingRotating", localizationId: "DevExpress.XtraPrinting.ChangingPermissions.InsertingDeletingRotating" },
{ value: "FillingSigning", displayValue: "FillingSigning", localizationId: "DevExpress.XtraPrinting.ChangingPermissions.FillingSigning" },
{ value: "CommentingFillingSigning", displayValue: "CommentingFillingSigning", localizationId: "DevExpress.XtraPrinting.ChangingPermissions.CommentingFillingSigning" },
{ value: "AnyExceptExtractingPages", displayValue: "AnyExceptExtractingPages", localizationId: "DevExpress.XtraPrinting.ChangingPermissions.AnyExceptExtractingPages" }
]
},
{ propertyName: "enableCopying", modelName: "@EnableCopying", displayName: "Enable Copying", localizationId: "DevExpress.XtraPrinting.PdfPermissionsOptions.EnableCopying", defaultVal: false, editor: DevExpress.JS.Widgets.editorTemplates.bool, from: Designer.parseBool },
{ propertyName: "enableScreenReaders", modelName: "@EnableScreenReaders", displayName: "Enable Screen Readers", localizationId: "