report/types/designer-app
Wyn Enterprise provides a rich API for integrating reporting components into your web application. To embed the Report Designer component in your project, use the Report Designer API. It lets you create, design, and save reports with added capabilities that include defining the locale for the designer, customizing the default settings of the report items, managing the Data and Properties tab, modifying the application info, and much more.
The following sections describe the module: report/types/designer-app.
Type Aliases
AddDataSetOptions
Ƭ AddDataSetOptions: Object
Type of options
passed to the GrapeCity.WynReports.Designer.api.addDataSet()
function.
Type declaration
Name | Type |
---|---|
|
|
|
|
dataSetName: string
Name of the data set to be sourced from the cached report (or template).
reportCacheKey: string
Cache key of the report (or template) to be used as the source for the specified data set.
AddDataSetResult
Ƭ AddDataSetResult: AddDataSetSuccessResult
| ReportOperationErrorResult
Type of result returned by the GrapeCity.WynReports.Designer.api.addDataSet()
function.
AddDataSetSuccessResult
Ƭ AddDataSetSuccessResult: Object
Type of success result returned by the GrapeCity.WynReports.Designer.api.addDataSet()
function.
Type declaration
Name | Type |
---|---|
|
|
|
|
dataSetName: string
Result name of the added data set.
type: "success"
Result type
AddEmbeddedImageOptions
Ƭ AddEmbeddedImageOptions: Object
Type of options
passed to the GrapeCity.WynReports.Designer.api.addEmbeddedImage()
function.
Type declaration
Name | Type |
---|---|
|
|
|
|
embeddedImageName: string
Name of the embedded image to be sourced from the cached report (or template).
reportCacheKey: string
Cache key of the report (or template) to be used as the source for the specified embedded image.
AddEmbeddedImageResult
Ƭ AddEmbeddedImageResult: AddEmbeddedImageSuccessResult
| ReportOperationErrorResult
Type of result returned by the GrapeCity.WynReports.Designer.api.addEmbeddedImage()
function.
AddEmbeddedImageSuccessResult
Ƭ AddEmbeddedImageSuccessResult: Object
Type of success result returned by the GrapeCity.WynReports.Designer.api.addEmbeddedImage()
function.
Type declaration
Name | Type |
---|---|
|
|
|
|
embeddedImageName: string
Result name of the added embedded image.
type: "success"
Result type
AddLayerOptions
Ƭ AddLayerOptions: Object
Type of options
passed to the GrapeCity.WynReports.Designer.api.addLayer()
function.
Type declaration
Name | Type |
---|---|
|
|
|
|
layerName: string
Name of the layer to be sourced from the cached report (or template).
reportCacheKey: string
Cache key of the report (or template) to be used as the source for the specified layer.
AddLayerResult
Ƭ AddLayerResult: AddLayerSuccessResult
| ReportOperationErrorResult
Type of result returned by the GrapeCity.WynReports.Designer.api.addLayer()
function.
AddLayerSuccessResult
Ƭ AddLayerSuccessResult: Object
Type of success result returned by the GrapeCity.WynReports.Designer.api.addLayer()
function.
Type declaration
Name | Type |
---|---|
|
|
|
|
layerName: string
Result name of the added layer.
type: "success"
Result type
AddLocalizationErrorResult
Ƭ AddLocalizationErrorResult: Object
Type of error result returned by the GrapeCity.WynReports.Designer.addLocalization()
function.
Type declaration
Name | Type |
---|---|
|
|
|
|
|
|
errorCaption: string
Error caption
errorDetails: string
[]
Error details
type: "error"
Error result type
AddLocalizationResult
Ƭ AddLocalizationResult: AddLocalizationSuccessResult
| AddLocalizationErrorResult
Type of result returned by the GrapeCity.WynReports.Designer.addLocalization()
function.
AddLocalizationSuccessResult
Ƭ AddLocalizationSuccessResult: Object
Type of success result returned by the GrapeCity.WynReports.Designer.addLocalization()
function.
Type declaration
Name | Type |
---|---|
|
|
type: "success"
Success result type
AddReportItemOptions
Ƭ AddReportItemOptions: Object
Type of options
passed to the GrapeCity.WynReports.Designer.api.addReportItem()
function.
Type declaration
Name | Type |
---|---|
|
|
|
|
|
|
reportCacheKey: string
Cache key of the report (or template) to be used as the source for the specified report item.
reportItemName: string
Name of the report item to be sourced from the cached report (or template).
targetContainer?: string
Specifies the target container within the currently edited report where to add the report item:
CPL (RDL) reports - Can be only 'Body'
FPL (Page) reports - Can be only page - 'Page 1', 'Page 2', etc.
If not specified, target will be set to 'Body' for CPL reports or to 'Page 1' for FPL reports.
AddReportItemResult
Ƭ AddReportItemResult: AddReportItemSuccessResult
| ReportOperationErrorResult
Type of result returned by the GrapeCity.WynReports.Designer.api.addReportItem()
function.
AddReportItemSuccessResult
Ƭ AddReportItemSuccessResult: Object
Type of success result returned by the GrapeCity.WynReports.Designer.api.addReportItem()
function.
Type declaration
Name | Type |
---|---|
|
|
|
|
|
|
reportItemName: string
Result name of the added report item.
targetContainer: string
Result target container where the report item is added.
type: "success"
Result type
AddReportParameterOptions
Ƭ AddReportParameterOptions: Object
Type of options
passed to the GrapeCity.WynReports.Designer.api.addReportParameter()
function.
Type declaration
Name | Type |
---|---|
|
|
|
|
reportCacheKey: string
Cache key of the report (or template) to be used as the source for the specified report parameter.
reportParameterName: string
Name of the report parameter to be sourced from the cached report (or template).
AddReportParameterResult
Ƭ AddReportParameterResult: AddReportParameterSuccessResult
| ReportOperationErrorResult
Type of result returned by the GrapeCity.WynReports.Designer.api.addReportParameter()
function.
AddReportParameterSuccessResult
Ƭ AddReportParameterSuccessResult: Object
Type of success result returned by the GrapeCity.WynReports.Designer.api.addReportParameter()
function.
Type declaration
Name | Type |
---|---|
|
|
|
|
reportParameterName: string
Result name of the added report parameter.
type: "success"
Result type
ApplicationInfo
Ƭ ApplicationInfo: Object
Partial type of the DesignerOptions.aboutInfo
object.
Type declaration
Name | Type |
---|---|
|
|
|
|
applicationTitle?: string
Specifies the application title to be used in Designer.
Example
applicationTitle: 'Report Designer'
applicationTitleCompact?: string
Specifies the compact application title to be used in Designer in places where there is not enough space for a full title.
Example
applicationTitleCompact: 'Designer'
BarcodeSymbology
Ƭ BarcodeSymbology: "Ansi39"
| "Ansi39x"
| "Aztec"
| "BC412"
| "Codabar"
| "Code_11"
| "Code_128_A"
| "Code_128_B"
| "Code_128_C"
| "Code_128auto"
| "Code_2_of_5"
| "Code_93"
| "Code25intlv"
| "Code39"
| "Code39x"
| "Code49"
| "Code93x"
| "DataMatrix"
| "EAN_13"
| "EAN_8"
| "EAN128FNC1"
| "GS1DataMatrix"
| "GS1QRCode"
| "HIBCCode128"
| "HIBCCode39"
| "IATA_2_of_5"
| "IntelligentMail"
| "IntelligentMailPackage"
| "ISBN"
| "ISMN"
| "ISSN"
| "ITF14"
| "JapanesePostal"
| "Matrix_2_of_5"
| "MaxiCode"
| "MicroPDF417"
| "MicroQRCode"
| "MSI"
| "Pdf417"
| "Pharmacode"
| "Plessey"
| "PostNet"
| "PZN"
| "QRCode"
| "RM4SCC"
| "RSS14"
| "RSS14Stacked"
| "RSS14StackedOmnidirectional"
| "RSS14Truncated"
| "RSSExpanded"
| "RSSExpandedStacked"
| "RSSLimited"
| "SSCC_18"
| "Telepen"
| "UCCEAN128"
| "UPC_A"
| "UPC_E0"
| "UPC_E1"
Barcode symbologies supported by Designer.
CacheReportOptions
Ƭ CacheReportOptions: Object
Type of options
passed to the GrapeCity.WynReports.Designer.api.cacheReport()
function.
Type declaration
Name | Type |
---|---|
|
|
|
reportCacheKey: string
Report cache key.
reportInfo: CachedReportInfo
Report info - information about the cached report (or template).
CacheReportResult
Ƭ CacheReportResult: CacheReportSuccessResult
| ReportOperationErrorResult
Type of result returned by the GrapeCity.WynReports.Designer.api.cacheReport()
function.
CacheReportSuccessResult
Ƭ CacheReportSuccessResult: Object
Type of success result returned by the GrapeCity.WynReports.Designer.api.cacheReport()
function.
Type declaration
Name | Type |
---|---|
|
|
|
|
reportCacheKey: string
Report cache key
type: "success"
Result type
CachedReportInfo
Ƭ CachedReportInfo: Object
Information about the cached report (or template).
Type declaration
Name | Type |
---|---|
|
|
|
|
|
|
|
|
|
|
content: any
Report (or template) content
id?: string
Report (or template) id
isTemplate?: boolean
Is cached document a report or a template?
name?: string
Report (or template) name.
version?: number
| null
Report (or template) version.
CreateReportOptions
Ƭ CreateReportOptions: Object
Type of options
passed to the GrapeCity.WynReports.Designer.api.createReport()
function.
Type declaration
Name | Type |
---|---|
| |
| () => |
| () => |
|
|
| { |
|
|
|
|
|
|
dataSets?: DataSetInfo
[]
Data sets - id/name/version array
If the dataSets option is specified, a new report is created with these data sets added.
Example
dataSets: [{ id: '1f183c3f-64f9-4b4c-ac92-cd37580bde21', name: 'MyDataSet', version: 3 }]
onFinish?: () => void
Callback on finishing to create a report.
Example
onFinish: () => {
console.log('Finished creating a new report.');
}
onStart?: () => void
Callback on starting to create a report.
Example
onStart: () => {
console.log('Started creating a new report.');
}
reportType?: "CPL"
| "FPL"
Specifies the type of a new report - CPL (RDL) or FPL (Page).
By default, a CPL (RDL) report is created.
Example
reportType: 'FPL'
templateInfo?: { content?
: any
; id?
: string
; name?
: string
}
Template info
If templateInfo is specified for report creation, either id or content needs to be defined.
Example
templateInfo: { id: 'b294d31c-81d2-48f1-9555-753023d62632', name: 'MyTemplate' }
templateInfo.content?: any
Template content
If content is defined, a new report is created based on this content.
templateInfo.id?: string
Template ID
If an ID is defined, template content is loaded from the server.
Example
id: 'b294d31c-81d2-48f1-9555-753023d62632'
templateInfo.name?: string
Template name.
Example
name: 'MyTemplate'
CreateReportResult
Ƭ CreateReportResult: CreateReportSuccessResult
| ReportOperationErrorResult
Type of result returned by the GrapeCity.WynReports.Designer.api.createReport()
function.
CreateReportSuccessResult
Ƭ CreateReportSuccessResult: Object
Type of success result returned by the GrapeCity.WynReports.Designer.api.createReport()
function.
Type declaration
Name | Type |
---|---|
| { |
|
|
|
|
|
|
|
|
|
|
reportInfo: { id
: null
; isTemplate
: false
; name
: string
; version
: null
}
Report info - Information about the created report.
reportInfo.id: null
Report ID - It is always null
for a new report.
reportInfo.isTemplate: false
Is the document created a report or a template - It is always false
for a new report.
reportInfo.name: string
Report name
reportInfo.version: null
Report version - it is always null
for a new report.
type: "success"
Result type
DataSetInfo
Ƭ DataSetInfo: Object
Type of an array element of the CreateReportOptions.dataSets
array.
Type declaration
Name | Type |
---|---|
|
|
|
|
|
|
id: string
Data set ID
Example
id: '1f183c3f-64f9-4b4c-ac92-cd37580bde21'
name: string
Data set name
Example
name: 'MyDataSet'
version: string
| number
Data set version
Example
version: 3
DesignerApi
Ƭ DesignerApi: Object
Type of the GrapeCity.WynReports.Designer
object.
Type declaration
Name | Type |
---|---|
| ( |
| |
| () => |
| ( |
| () => |
| () => |
| ( |
| ( |
addLocalization: (lng
: string
, resourceBundles
: LocalizationResourceBundle
[]) => AddLocalizationResult
Adds custom localization resources for the Report Designer. Then it is required to pass lng
to designerOptions.locale
to apply the added resources.
Example
const result = GrapeCity.WynReports.Designer.addLocalization('zh-CN', resourceBundles);
if (result.type === 'success') designerOptions.locale = 'zh-CN';
else console.error([result.errorCaption, ...result.errorDetails].join('\n'));
api: ReportingApi
This object includes functions allowing you to create, open, or save report, etc.
closeViewer: () => void
Closes the Viewer that is plugged-in to Designer via designerOptions.openViewer().
Example
GrapeCity.WynReports.Designer.closeViewer();
createDesignerOptions: (portalUrl
: string
, referenceToken?
: string
) => DesignerOptions
Creates the default DesignerOptions
object to be passed to the GrapeCity.WynReports.Designer.renderApplication()
function.
Example
const designerOptions = GrapeCity.WynReports.Designer.createDesignerOptions('<portalUrl>', '<referenceToken>');
destroy: () => void
Destroys Designer.
If it is needed to continue working with Designer after destroying it, it is mandatory to call GrapeCity.WynReports.Designer.renderApplication()
again.
Example
GrapeCity.WynReports.Designer.destroy();
focus: () => void
Returns focus to the Designer. Focus may be lost when plugged-in or external components are opened/closed.Returning focus is essential to continue using Designer hotkeys like Ctrl+Z (undo), Ctrl+Y (redo), etc.
Example
GrapeCity.WynReports.Designer.focus();
getLocalizationResources: (lng
: string
, portalUrl
: string
, referenceToken?
: string
) => Promise
<GetLocalizationResourcesResult
>
Gets custom localization resources provided by the Wyn API.Obtained resources are intended for GrapeCity.WynReports.Designer.addLocalization()
.
Example
const result = GrapeCity.WynReports.Designer.getLocalizationResources('zh-CN', '<portalUrl>', '<referenceToken>');
if (result.type === 'success') GrapeCity.WynReports.Designer.addLocalization('zh-CN', result.resourceBundles);
else console.error([result.errorCaption, ...result.errorDetails].join('\n'));
renderApplication: (designerElementId
: string
, designerOptions
: DesignerOptions
) => Promise
<void
>
Renders Designer to the div element with id designerElementId using the specified designerOptions.
Example
GrapeCity.WynReports.Designer.renderApplication('report-designer-app', designerOptions);
DesignerOptions
Ƭ DesignerOptions: DesignerOptionsBase
& DesignerOptionsOther
Type of the return value of the GrapeCity.WynReports.Designer.createDesignerOptions()
function.
DesignerOptionsBase
Ƭ DesignerOptionsBase: Object
The base primary options of the DesignerOptions type.
Type declaration
Name | Type |
---|---|
| |
| |
| ( |
|
|
|
|
|
|
| { |
|
|
|
|
|
|
|
|
aboutInfo: ApplicationInfo
& ProductInfo
Overrides the default About info.
Example
designerOptions.aboutInfo.applicationTitle = 'Report Designer';
designerOptions.aboutInfo.applicationTitleCompact = 'Designer';
designerOptions.aboutInfo.productTitle = '<productTitle>';
designerOptions.aboutInfo.productVersion = '1.2.3';
locale?: Locale
Specifies the locale used for displaying Designer. If locale is not specified explicitly here, the locale corresponding to the browser preferences is used.
Example
designerOptions.locale = 'zh';
openViewer?: (options
: ViewerOptions
) => void
You can plug-in Report Viewer component by providing openViewer function to designerOptions. When openViewer is passed to designerOptions, Preview button appears in Designer.
Example
designerOptions.openViewer = function(options) {
// ... create viewer and open report
};
portalUrl: string
Wyn Portal URL.
Example
designerOptions.portalUrl = 'https://wyn-portal.com/';
referenceToken?: string
The reference key needed to access the Wyn API.
Example
designerOptions.referenceToken = '<referenceToken>';
referenceTokenKey?: string
The reference key name used in query parameters, configured in the Wyn Config file.
If referenceTokenKey is not specified, default value is 'token'.
Example
designerOptions.referenceTokenKey = '<referenceTokenKey>';
reportInfo: { id?
: string
| null
; isTemplate?
: boolean
; readOnly?
: boolean
; version?
: number
| null
}
If reportInfo.id is specified, the corresponding document (report or template) will be opened in Designer when Designer application is rendered.
reportInfo.id?: string
| null
Specify the report (or template) ID to open it in Designer when Designer application is rendered.
Example
designerOptions.reportInfo.id = '6e975775-38e3-4ac5-b92c-0ff7dab091a6';
reportInfo.isTemplate?: boolean
Specify whether a report or a template is opened.
Example
designerOptions.isTemplate = true;
reportInfo.readOnly?: boolean
Specify whether a report or a template is opened in the read-only mode so that saving any changes is prohibited.
By default, this option is disabled so saving report or template changes is allowed.
Example
designerOptions.readOnly = true;
reportInfo.version?: number
| null
Specify the exact report (or template) version if not the latest version needs to be opened.
Example
designerOptions.reportInfo.version = 5;
DesignerOptionsOther
Ƭ DesignerOptionsOther: Object
The other secondary options of the DesignerOptions type.
Type declaration
Name | Type |
---|---|
| { |
|
|
| { |
| { |
|
|
| { |
|
|
|
|
|
|
|
|
|
|
| { |
|
|
|
|
| { |
|
|
|
|
|
|
| { |
|
|
|
|
|
|
|
|
|
|
| ( |
|
|
| { |
|
|
|
|
| { |
|
|
|
|
| { |
| { |
|
|
|
|
| { |
|
|
|
|
| { |
|
|
| { |
|
|
| { |
|
|
|
|
|
|
| { |
|
|
| { |
|
|
|
|
| ( |
| ( |
| () => |
| ( |
| ( |
| { |
|
|
| { |
|
|
|
|
|
|
| { |
|
|
|
|
| { |
| { |
| |
| |
| { |
|
|
| { |
|
|
|
|
|
|
| { |
|
|
|
|
|
|
| { |
|
|
| { |
|
|
|
|
|
|
| { |
|
|
| { |
|
|
|
|
| { |
|
|
| { |
|
|
| { |
|
|
| |
| ( |
| { |
|
|
aboutButton: { visible
: boolean
}
About button settings
aboutButton.visible: boolean
Specifies whether About button needs to be shown. About button is visible by default.
Example
designerOptions.aboutButton.visible = false;
dataTab: { commonValues
: { visible
: boolean
} ; dataSets
: { autoGenerateCalculatedFieldsWithUserTimeZone
: boolean
; canEditServerDataSets
: boolean
; canModify
: boolean
; canReplace
: boolean
; canUpdate
: boolean
; picker
: { dataResources?
: string
} ; visible
: boolean
} ; dataSources
: { canModify
: boolean
; canReplace
: boolean
; visible
: boolean
} ; parameters
: { canModify
: boolean
; visible
: boolean
} ; visible
: boolean
}
Data tab settings
dataTab.commonValues: { visible
: boolean
}
Common Values section settings
dataTab.commonValues.visible: boolean
Specifies whether Common Values section needs to be shown. Common Values section is visible by default.
Example
designerOptions.dataTab.commonValues.visible = false;
dataTab.dataSets: { autoGenerateCalculatedFieldsWithUserTimeZone
: boolean
; canEditServerDataSets
: boolean
; canModify
: boolean
; canReplace
: boolean
; canUpdate
: boolean
; picker
: { dataResources?
: string
} ; visible
: boolean
}
Data Sets section settings
dataTab.dataSets.autoGenerateCalculatedFieldsWithUserTimeZone: boolean
Specifies whether it is allowed to auto-generate calculated fields transformed to user time zone for bound Date/DateTime fields.By default this feature is enabled.
Example
designerOptions.dataTab.dataSets.autoGenerateCalculatedFieldsWithUserTimeZone = false;
dataTab.dataSets.canEditServerDataSets: boolean
Specifies whether it is possible to open the external Dataset Designer to edit server data sets. The corresponding data set dropdown menu option appears when this feature is enabled. This feature is applied when canModify
is enabled, otherwise canEditServerDataSets
is always disabled.
By default this feature is enabled.
Example
designerOptions.dataTab.dataSets.canEditServerDataSets = false;
dataTab.dataSets.canModify: boolean
Specifies whether it is possible to modify (including add, edit, or remove) data sets. By default, this feature is enabled.
Example
designerOptions.dataTab.dataSets.canModify = false;
dataTab.dataSets.canReplace: boolean
Specifies whether it is possible to replace data sets. The corresponding data set dropdown menu option appears when this feature is enabled. This feature is applied when canModify
is enabled; otherwise, canReplace
is always disabled.
By default, this feature is enabled.
Example
designerOptions.dataTab.dataSets.canReplace = false;
dataTab.dataSets.canUpdate: boolean
Specifies whether it is possible to update server data sets to their latest versions. The corresponding data set dropdown menu option appears when this feature is enabled.
This feature is applied when canModify
is enabled, otherwise canUpdate
is always disabled.
By default this feature is enabled.
Example
designerOptions.dataTab.dataSets.canUpdate = false;
dataTab.dataSets.picker: { dataResources?
: string
}
Data Set Picker settings
dataTab.dataSets.picker.dataResources?: string
It is possible to limit and/or reorder the list of data resources used for data set creation. Specify comma-separated data resource keys from this list:
DataSets, DataSources, SemanticModels
The default values are DataSets, SemanticModels, and DataSources.
Example
designerOptions.dataTab.dataSets.picker.dataResources = 'SemanticModels,DataSets';
dataTab.dataSets.visible: boolean
Specifies whether Data Sets section needs to be shown. Data Sets section is visible by default.
Example
designerOptions.dataTab.dataSets.visible = false;
dataTab.dataSources: { canModify
: boolean
; canReplace
: boolean
; visible
: boolean
}
Data Sources section settings
dataTab.dataSources.canModify: boolean
Specifies whether it is possible to remove data sources. By default, this feature is enabled.
Example
designerOptions.dataTab.dataSources.canModify = false;
dataTab.dataSources.canReplace: boolean
Specifies whether it is possible to replace data sources and semantic models. This feature is applied when canModify
is enabled; otherwise, canReplace
is always disabled.
By default, this feature is enabled.
Example
designerOptions.dataTab.dataSources.canReplace = false;
dataTab.dataSources.visible: boolean
Specifies whether Data Sources section needs to be shown. Data Sources section is visible by default.
Example
designerOptions.dataTab.dataSources.visible = false;
dataTab.parameters: { canModify
: boolean
; visible
: boolean
}
Parameters section settings
dataTab.parameters.canModify: boolean
Specifies whether it is possible to modify (including add, edit, or remove) report parameters. By default, this feature is enabled.
Example
designerOptions.dataTab.parameters.canModify = false;
dataTab.parameters.visible: boolean
Specifies whether Parameters section needs to be shown. Parameters section is visible by default.
Example
designerOptions.dataTab.parameters.visible = false;
dataTab.visible: boolean
Specifies whether Data tab needs to be shown. Data tab is visible by default.
Example
designerOptions.dataTab.visible = false;
disableFocusTimer?: boolean
Disables focus highlighting timer for better accessibility. The default value is false.
Example
designerOptions.disableFocusTimer = true;
expressionSyntax: "i11n"
| "rdl"
Specifies the expression syntax used in Designer:
i11n - Interpolation syntax
rdl - "old" rdl expression syntax
By default, the interpolation syntax is used for expressions.
Example
designerOptions.expressionSyntax = 'rdl';
filterProperties?: (descriptors
: PropertyDescriptor
[], reportItem
: Record
<string
, any
>) => PropertyDescriptor
[]
It is possible to implement custom logic to filter and reorder descriptors
of reportItem
properties.
Example
designerOptions.filterProperties = function(descriptors, reportItem) {
if (reportItem.Type !== 'textbox') return descriptors;
return descriptors.filter(desc => desc.valuePath !== 'Value');
};
fonts?: string
[]
Specifies the list of fonts displayed in Font Family drop-downs all over Designer. If fonts are not specified explicitly here, the default list of fonts is used.
Example
designerOptions.fonts = ['Arial', 'Courier New', 'Times New Roman'];
gridSize: { value?
: string
; visible
: boolean
}
Grid Size editor settings
gridSize.value?: string
If Grid Size editor is not visible, it is possible to specify Grid Size value in in/cm (i.e., inches or centimeters).
Example
designerOptions.gridSize.value = '0.5in';
gridSize.visible: boolean
Specifies whether Grid Size editor in Status Bar needs to be shown. Grid Size editor is visible by default.
Example
designerOptions.gridSize.visible = false;
groupEditor: { visible
: boolean
}
Group Editor settings
groupEditor.visible: boolean
Specifies whether Group Editor button needs to be shown. Group Editor button is visible by default.
Example
designerOptions.groupEditor.visible = false;
helpInfos?: HelpInfo
[]
Allows specifying user-defined Help links to be shown in Designer About dialog.
Example
designerOptions.helpInfos = [
{ title: 'My Documentation', link: 'https://main-documentation.com/' },
{ link: 'https://other-documentation.com/' },
];
infoTab: { caching
: { canModify
: boolean
; visible
: boolean
} ; commands
: { canModify
: boolean
; visible
: boolean
} ; jumpToReport
: { visible
: boolean
} ; jumpToURL
: { visible
: boolean
} ; permissions
: { canModify
: boolean
; visible
: boolean
} ; visible
: boolean
}
Info tab settings
infoTab.caching: { canModify
: boolean
; visible
: boolean
}
Caching editor settings
infoTab.caching.canModify: boolean
Specifies whether it is possible to modify caching settings. By default, this feature is enabled.
Example
designerOptions.infoTab.caching.canModify = false;
infoTab.caching.visible: boolean
Specifies whether Caching editor needs to be shown. Caching editor is visible by default.
Example
designerOptions.infoTab.caching.visible = false;
infoTab.commands: { canModify
: boolean
; visible
: boolean
}
Commands editor settings
infoTab.commands.canModify: boolean
Specifies whether it is possible to modify (including add/remove) commands. By default, this feature is enabled.
Example
designerOptions.infoTab.commands.canModify = false;
infoTab.commands.visible: boolean
Specifies whether Commands editor needs to be shown. Commands editor is visible by default.
Example
designerOptions.infoTab.commands.visible = false;
infoTab.jumpToReport: { visible
: boolean
}
Jump To Report editor settings
infoTab.jumpToReport.visible: boolean
Specifies whether Jump To Report editor needs to be shown. Jump To Report editor is visible by default.
Example
designerOptions.infoTab.jumpToReport.visible = false;
infoTab.jumpToURL: { visible
: boolean
}
Jump To URL editor settings
infoTab.jumpToURL.visible: boolean
Specifies whether Jump To URL editor needs to be shown. Jump To URL editor is visible by default.
Example
designerOptions.infoTab.jumpToURL.visible = false;
infoTab.permissions: { canModify
: boolean
; visible
: boolean
}
Permissions editor settings
infoTab.permissions.canModify: boolean
Specifies whether it is possible to modify (including add, edit, or remove) permissions. By default, this feature is enabled.
Example
designerOptions.infoTab.permissions.canModify = false;
infoTab.permissions.visible: boolean
Specifies whether Permissions editor needs to be shown. Permissions editor is visible by default.
Example
designerOptions.infoTab.permissions.visible = false;
infoTab.visible: boolean
Specifies whether Info tab needs to be shown. Info tab is visible by default.
Example
designerOptions.infoTab.visible = false;
insertTab: { visible
: boolean
}
Insert tab settings
insertTab.visible: boolean
Specifies whether Insert tab needs to be shown in Designer application bar. Tool Box and Insert tab are interchangeable. Insert tab is not visible by default.
Example
designerOptions.insertTab.visible = true;
layersEditor: { visible
: boolean
}
Layers Editor settings
layersEditor.visible: boolean
Specifies whether Layers Editor button needs to be shown. Layers Editor button is visible by default.
Example
designerOptions.layersEditor.visible = false;
lockLayout: boolean
When lockLayout is enabled, it is only possible to modify the properties of existing report items. I.e., adding a new report item or deleting an existing one is not possible, as well as other operations that modify report layout structure. By default, this feature is disabled.
Example
designerOptions.lockLayout = true;
makeTitle?: (reportName
: string
, options
: MakeTitleOptions
) => string
It is possible to implement custom logic for making a title for a browser tab containing Designer. By default, makeTitle is undefined, so the title remains unchanged.
Example
designerOptions.makeTitle = function(reportName, options) {
// ... custom logic for making a title
};
onClose?: () => (options?
: OnCloseOptions
) => void
It is possible to implement custom logic when closing Designer. If onClose
is specified, ✕ button appears in the top-right corner.
Example
designerOptions.onClose = function(options) {
GrapeCity.WynReports.Designer.destroy();
};
onCloseViewer?: () => void
It is possible to implement custom logic on closing the Viewer.
Example
designerOptions.onCloseViewer = function() {
// ... custom logic to be executed on closing Viewer
};
onError?: (operation
: ReportOperation
, options
: OnErrorOptions
) => void
It is possible to implement custom logic on failed report (or template) operation.
Example
designerOptions.onError = function(operation, options) {
console.log([${operation}] ${options.errorCaption});
console.log(options.errorDetails.join('\n\n'));
};
onSaved?: (options
: OnSavedOptions
) => void
It is possible to implement custom logic to be executed after a report is saved.
Example
designerOptions.onSaved = function(options) {
// ... custom logic to be executed after a report is saved
};
parametersView: { visible
: boolean
}
Parameters View settings
parametersView.visible: boolean
Specifies whether Parameters View button needs to be shown. Parameters View button is visible by default.
Example
designerOptions.parametersView.visible = false;
propertiesTab: { defaultMode?
: "Basic"
| "Advanced"
; mode
: "Basic"
| "Advanced"
| "Both"
; visible
: boolean
}
Properties tab settings
propertiesTab.defaultMode?: "Basic"
| "Advanced"
Relevant only when mode is Both. If undefined, the last-used property mode is set.
Example
designerOptions.propertiesTab.defaultMode = 'Advanced';
propertiesTab.mode: "Basic"
| "Advanced"
| "Both"
Specifies available property modes. The default value is Both.
Example
designerOptions.propertiesTab.mode = 'Basic';
propertiesTab.visible: boolean
Specifies whether Properties tab needs to be shown. Properties tab is visible by default.
Example
designerOptions.propertiesTab.visible = false;
reportExplorer: { visible
: boolean
}
Report Explorer settings
reportExplorer.visible: boolean
Specifies whether Report Explorer button needs to be shown. Report Explorer button is visible by default.
Example
designerOptions.reportExplorer.visible = false;
reportItems?: string
It is possible to limit and/or reorder the list of available report items. Specify comma-separated report item keys from this list:
BandedList, Barcode, Bullet, Chart, CheckBox, Container, FormattedText, Image, InputField, Line, List,
OverflowPlaceholder, Shape, Sparkline, Subreport, Table, TableOfContents, Tablix, TextBox
Example
designerOptions.reportItems = 'TextBox,CheckBox,Table,Chart,Image';
reportItemsFeatures: { barcode
: { defaultSymbology?
: BarcodeSymbology
; symbologies?
: BarcodeSymbology
[] } ; chart
: { canUseWizard
: boolean
} ; table
: { autoFillFooter
: boolean
; autoFillHeader
: boolean
; canMergeCellsVertically
: boolean
} ; tablix
: { autoFillCorner
: boolean
; canUseWizard
: boolean
} }
Customizable report item features are specified here.
reportItemsFeatures.barcode: { defaultSymbology?
: BarcodeSymbology
; symbologies?
: BarcodeSymbology
[] }
Barcode features
reportItemsFeatures.barcode.defaultSymbology?: BarcodeSymbology
Overrides the default symbology used for newly-created barcodes. By default, new barcodes are created with QRCode symbology.
Example
designerOptions.reportItemsFeatures.barcode.defaultSymbology = 'Code_128_A';
reportItemsFeatures.barcode.symbologies?: BarcodeSymbology
[]
Limits the list of barcode symbologies available for creation. By default, all barcode symbologies supported by Designer are available.
Example
designerOptions.reportItemsFeatures.barcode.symbologies = ['Code_128_A', 'Code_128_B', 'Code_128_C'];
reportItemsFeatures.chart: { canUseWizard
: boolean
}
Chart features
reportItemsFeatures.chart.canUseWizard: boolean
Specifies whether Chart Wizard is available for creating Chart. By default, this feature is enabled.
Example
designerOptions.reportItemsFeatures.chart.canUseWizard = false;
reportItemsFeatures.table: { autoFillFooter
: boolean
; autoFillHeader
: boolean
; canMergeCellsVertically
: boolean
}
Table features
reportItemsFeatures.table.autoFillFooter: boolean
Specifies whether Table Footer needs to be auto-filled when a field is dropped to Table Details. For example, if ProductName field is dropped to Details, {Count(ProductName)} value is set to Footer. By default, this feature is disabled.
Example
designerOptions.reportItemsFeatures.table.autoFillFooter = true;
reportItemsFeatures.table.autoFillHeader: boolean
Specifies whether Table Header needs to be auto-filled when a field is dropped to Table Details. For example, if ProductName field is dropped to Details, Product Name value is set to Header. By default, this feature is enabled.
Example
designerOptions.reportItemsFeatures.table.autoFillHeader = false;
reportItemsFeatures.table.canMergeCellsVertically: boolean
Specifies whether vertical merging of cells is enabled within Table Header, Details, and Footer. By default, this feature is enabled.
Example
designerOptions.reportItemsFeatures.table.canMergeCellsVertically = false;
reportItemsFeatures.tablix: { autoFillCorner
: boolean
; canUseWizard
: boolean
}
Tablix features
reportItemsFeatures.tablix.autoFillCorner: boolean
Specifies whether Tablix Corner Cell needs to be auto-filled when a field is dropped into Tablix Row Group Cell. For example, if ProductName field is dropped to Row Group Cell, Product Name value is set to Corner Cell. By default, this feature is enabled.
Example
designerOptions.reportItemsFeatures.tablix.autoFillCorner = false;
reportItemsFeatures.tablix.canUseWizard: boolean
Specifies whether Tablix Wizard is available for creating or editing Tablix. By default, this feature is enabled.
Example
designerOptions.reportItemsFeatures.tablix.canUseWizard = false;
restoreUnsavedReport: boolean
When restoreUnsavedReport is enabled, the last unsaved report can be restored if browser tab or browser itself gets accidentally closed. In case restoreUnsavedReport is disabled, the aforementioned functionality is not available. By default, this feature is enabled.
Example
designerOptions.restoreUnsavedReport = false;
saveAsButton: { visible
: boolean
}
Save As button settings
saveAsButton.visible: boolean
Specifies whether Save As button needs to be shown. If Save button is not visible, then Save As button will be not visible as well. Save As button is visible by default.
Example
designerOptions.saveAsButton.visible = false;
saveAsDialog: { canSaveReportAsTemplate
: boolean
; canSaveTemplateAsReport
: boolean
; canSetCategories
: boolean
}
Save As dialog settings
saveAsDialog.canSaveReportAsTemplate: boolean
Specifies whether report can be saved as a template. By default, this feature is enabled.
Example
designerOptions.saveAsDialog.canSaveReportAsTemplate = false;
saveAsDialog.canSaveTemplateAsReport: boolean
Specifies whether template can be saved as a report. By default, this feature is enabled.
Example
designerOptions.saveAsDialog.canSaveTemplateAsReport = false;
saveAsDialog.canSetCategories: boolean
Specifies whether it is possible to set categories. By default, this feature is enabled.
Example
designerOptions.saveAsDialog.canSetCategories = false;
saveButton: { visible
: boolean
}
Save button settings
saveButton.visible: boolean
Specifies whether Save button needs to be shown. If Save button is not visible, then Save As button will be not visible as well. Save button is visible by default.
Example
designerOptions.saveButton.visible = false;
showGrid: { value?
: boolean
; visible
: boolean
}
Show Grid toggle settings
showGrid.value?: boolean
If Show Grid toggle is not visible, it is possible to specify Show Grid value as true or false.
Example
designerOptions.showGrid.value = false;
showGrid.visible: boolean
Specifies whether Show Grid toggle in Status Bar needs to be shown. Show Grid toggle is visible by default.
Example
designerOptions.showGrid.visible = false;
showRulers: { visible
: boolean
}
Show Rulers toggle settings
showRulers.visible: boolean
Specifies whether Show Rulers toggle in Status Bar needs to be shown. Show Rulers toggle is visible by default.
Example
designerOptions.showRulers.visible = false;
snapEditor: { visible
: boolean
}
Snap Editor settings
snapEditor.visible: boolean
Specifies whether Snap Editor button in Status Bar needs to be shown. Snap Editor button is visible by default.
Example
designerOptions.snapEditor.visible = false;
toolBox: { visible
: boolean
}
Tool Box settings
toolBox.visible: boolean
Specifies whether left-side menu Tool Box needs to be shown. Tool Box is visible by default.
Example
designerOptions.toolBox.visible = false;
units?: Units
Specifies the default measurement units used in Designer. If units are not specified explicitly here, they are identified depending on locale.
Example
designerOptions.units = 'cm';
updateRoute?: (options
: UpdateRouteOptions
) => void
It is possible to implement custom logic for updating routes when edited report info gets updated in Designer. Report info - id / version / isTemplate - is updated on creating, opening, or saving a report - after that updateRoute is called. By default, updateRoute is undefined, so route remains unchanged.
Example
designerOptions.updateRoute = function(options) {
// ... custom logic for updating route
};
zoomEditor: { visible
: boolean
}
Zoom Editor settings
zoomEditor.visible: boolean
Specifies whether Zoom Editor button in Status Bar needs to be shown. Zoom Editor button is visible by default.
Example
designerOptions.zoomEditor.visible = false;
GetLocalizationResourcesErrorResult
Ƭ GetLocalizationResourcesErrorResult: Object
Type of error result returned by the GrapeCity.WynReports.Designer.getLocalizationResources()
function.
Type declaration
Name | Type |
---|---|
|
|
|
|
|
|
errorCaption: string
Error caption.
errorDetails: string
[]
Error details
type: "error"
Error result type.
GetLocalizationResourcesResult
Ƭ GetLocalizationResourcesResult: GetLocalizationResourcesSuccessResult
| GetLocalizationResourcesErrorResult
Type of result returned by the GrapeCity.WynReports.Designer.getLocalizationResources()
function.
GetLocalizationResourcesSuccessResult
Ƭ GetLocalizationResourcesSuccessResult: Object
Type of success result returned by the GrapeCity.WynReports.Designer.getLocalizationResources()
function.
Type declaration
Name | Type |
---|---|
|
|
|
|
resourceBundles: LocalizationResourceBundle
[] | undefined
Localization resource bundles.
type: "success"
Success result type.
HelpInfo
Ƭ HelpInfo: Object
Type of an array element of the DesignerOptions.helpInfos
array.
Type declaration
Name | Type |
---|---|
|
|
|
|
link: string
Specifies the Help page URL.
Example
link: 'https://main-documentation.com/'
title?: string
Specifies the Help page title.
Example
title: 'My Documentation'
LoadReportOptions
Ƭ LoadReportOptions: Object
Type of options
passed to the GrapeCity.WynReports.Designer.api.loadReport()
function.
Type declaration
Name | Type |
---|---|
| { |
|
|
|
|
reportInfo: { id
: string
; version?
: number
| null
}
Report info - Information about the report (or template) to be loaded.
Example
reportInfo: { id: '6e975775-38e3-4ac5-b92c-0ff7dab091a6', version: 5 }
reportInfo.id: string
Report (or template) id.
Example
id: '6e975775-38e3-4ac5-b92c-0ff7dab091a6'
reportInfo.version?: number
| null
Report (or template) version.
Example
version: 5
LoadReportResult
Ƭ LoadReportResult: LoadReportSuccessResult
| ReportOperationErrorResult
Type of result returned by the GrapeCity.WynReports.Designer.api.loadReport()
function.
LoadReportSuccessResult
Ƭ LoadReportSuccessResult: Object
Type of success result returned by the GrapeCity.WynReports.Designer.api.loadReport()
function.
Type declaration
Name | Type |
---|---|
| { |
|
|
|
|
|
|
|
|
|
|
|
|
reportInfo: { content
: any
; id
: string
; isTemplate
: boolean
; name
: string
; version
: number
}
Report info - Information about the loaded report (or template).
reportInfo.content: any
Report (or template) content.
reportInfo.id: string
Report (or template) ID.
reportInfo.isTemplate: boolean
Is loaded document a report or a template?
reportInfo.name: string
Report (or template) name.
reportInfo.version: number
Report (or template) version.
type: "success"
Result type
Locale
Ƭ Locale: PredefinedLocale
| string
Type of DesignerOptions.locale
and ViewerOptions.locale
.
LocalizationResourceBundle
Ƭ LocalizationResourceBundle: Object
Type of the GetLocalizationResourcesSuccessResult.resourceBundles
array element.
Type declaration
Name | Type |
---|---|
|
|
|
|
ns: string
Bundle namespace.
resources: Record
<string
, any
>
Localization resources
MakeTitleOptions
Ƭ MakeTitleOptions: Object
Type of options
passed to the DesignerOptions.makeTitle()
function.
Type declaration
Name | Type |
---|---|
|
|
|
|
|
|
|
|
dirty: boolean
Specifies whether the report (or template) has unsaved changes.
id: string
| null
Report (or template) ID
isTemplate: boolean
Is document a report or a template?
version: string
| number
| null
Report (or template) version.
OnCloseOptions
Ƭ OnCloseOptions: Object
Type of options
passed to the DesignerOptions.onClose()
function.
Type declaration
Name | Type |
---|---|
|
|
|
|
|
|
id: string
| null
Closed report's (or template's) id.
isTemplate: boolean
Boolean value, if the closed document is a report or a template.
name: string
Closed report's (or template's) name.
OnCloseOptions
Ƭ OnCloseOptions: Object
Type of options
passed to the DesignerOptions.onClose()
function.
Type declaration
Name | Type |
---|---|
|
|
|
|
|
|
|
|
id: string
| null
Closed report (or template) id.
isMaster: boolean
Is closed document a master report or not.
isTemplate: boolean
Is closed document a report or a template.
name: string
Closed report (or template) name.
OnErrorOptions
Ƭ OnErrorOptions: Object
Type of options
passed to the DesignerOptions.onError()
function.
Type declaration
Name | Type |
---|---|
|
|
|
|
|
|
|
|
|
|
|
|
errorCaption: string
Error caption.
errorDetails: string
[]
Error details.
id: string
| null
Report (or template) ID.
If operation on an existing report (or template) failed, ID is defined. Otherwise, ID is null.
isTemplate: boolean
Is document a report or a template?
name: string
Report (or template) name
version?: number
| null
Report (or template) version - Relevant for errors on open
operation only.
OnSavedOptions
Ƭ OnSavedOptions: Object
Type of options
passed to the DesignerOptions.onSaved()
function.
Type declaration
Name | Type |
---|---|
|
|
|
|
|
|
id: string
Saved report (or template) ID
isTemplate: boolean
Is saved document a report or a template?
name: string
Saved report (or template) name
OpenReportOptions
Ƭ OpenReportOptions: Object
Type of options
passed to the GrapeCity.WynReports.Designer.api.openReport()
function.
Type declaration
Name | Type |
---|---|
| () => |
| () => |
| { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
onFinish?: () => void
Callback on finishing to open a report (or a template).
Example
onFinish: () => {
console.log('Finished opening a report.');
}
onStart?: () => void
Callback on starting to open a report (or a template).
Example
onStart: () => {
console.log('Started opening a report.');
}
reportInfo: { content?
: any
; id
: string
; isTemplate?
: boolean
; name?
: string
; permissions?
: string
[] ; readOnly?
: boolean
; version?
: string
| number
| null
}
Report info - Information about the report (or template) to be opened.
Example
reportInfo: { id: '6e975775-38e3-4ac5-b92c-0ff7dab091a6', name: 'MyReport' }
reportInfo.content?: any
Report (or template) content
If content is defined, opened report (or template) content is overridden with this content.
reportInfo.id: string
Report (or template) ID
Example
id: '6e975775-38e3-4ac5-b92c-0ff7dab091a6'
reportInfo.isTemplate?: boolean
Is opened document a report or a template?
Example
isTemplate: false
reportInfo.name?: string
Report (or template) name
The correct name needs to be always specified explicitly.
Deprecated
This property won't have any effect.
reportInfo.permissions?: string
[]
Report (or template) permissions
Deprecated
This property won't have any effect.
reportInfo.readOnly?: boolean
is opened in the read-only mode
Example
readOnly: true
reportInfo.version?: string
| number
| null
Report (or template) version
Example
version: 5
OpenReportResult
Ƭ OpenReportResult: OpenReportSuccessResult
| ReportOperationErrorResult
Type of result returned by the GrapeCity.WynReports.Designer.api.openReport()
function.
OpenReportSuccessResult
Ƭ OpenReportSuccessResult: Object
Type of success result returned by the GrapeCity.WynReports.Designer.api.openReport()
function.
Type declaration
Name | Type |
---|---|
| { |
|
|
|
|
|
|
|
|
|
|
reportInfo: { id
: string
; isTemplate
: boolean
; name
: string
; version
: number
| null
}
Report info - Information about the opened report (or template).
reportInfo.id: string
Report (or template) ID
reportInfo.isTemplate: boolean
Is opened document a report or a template?
reportInfo.name: string
Report (or template) name
reportInfo.version: number
| null
Report (or template) version
type: "success"
Result type
PartialDeep
Ƭ PartialDeep<K
>: { [attr in keyof K]?: K[attr] extends object ? PartialDeep<K[attr]> : K[attr] }
Generic to create a type from another type with all keys and nested keys set to optional.
Type parameters
Name |
---|
|
PartialDeepDesignerOptionsOther
Ƭ PartialDeepDesignerOptionsOther: PartialDeep
<DesignerOptionsOther
>
This type is derived from DesignerOptionsOther but all its properties are recursively optional.
PredefinedLocale
Ƭ PredefinedLocale: "en"
| "en-GB"
| "pl"
| "zh"
| "zh-TW"
Predefined locales supported by Designer.
ProductInfo
Ƭ ProductInfo: Object
Partial type of the DesignerOptions.aboutInfo
object.
Type declaration
Name | Type |
---|---|
|
|
|
|
productTitle?: string
Specifies the product title to be shown in Designer About dialog.
Example
productTitle: '<productTitle>'
productVersion?: string
Specifies the product version to be shown in Designer About dialog.
Example
productVersion: '1.2.3'
PropertyDescriptor
Ƭ PropertyDescriptor: Object
Report item property descriptor.
Type declaration
Name | Type |
---|---|
|
|
|
|
|
|
|
|
|
|
|
|
category: string
Property category
label: string
Property label
meta?: Record
<string
, any
>
property metadata
mode: "simple"
| "advanced"
| "both"
Property mode
type: string
Property type
valuePath: string
Property value path
ReportInfo
Ƭ ReportInfo: Object
Type of the return value of the GrapeCity.WynReports.Designer.api.getReportInfo()
function.
Type declaration
Name | Type |
---|---|
|
|
|
|
|
|
|
|
|
|
id: string
| null
Report (or template) ID
If an existing report (or template) is edited, ID is defined. Otherwise, if a new report is edited, ID is null.
isMaster: boolean
is document a master report or not.
isTemplate: boolean
Is document a report or a template?
name: string
Report (or template) name
permissions: string
[]
Report (or template) permissions
ReportOperation
Ƭ ReportOperation: "create"
| "open"
| "save"
| "preview"
| "restore"
Type of report (or template) operation
passed to the DesignerOptions.onError()
function.
ReportOperationErrorResult
Ƭ ReportOperationErrorResult: Object
Type of error result returned by the createReport()
/ openReport()
/ saveReport()
functions from GrapeCity.WynReports.Designer.api
.
Type declaration
Name | Type |
---|---|
|
|
|
|
|
|
errorCaption: string
Error caption
errorDetails: string
[]
Error details
type: "error"
Result type
ReportingApi
Ƭ ReportingApi: Object
Type of the GrapeCity.WynReports.Designer.api
object.
Type declaration
Name | Type |
---|---|
| ( |
| ( |
| ( |
| ( |
| ( |
| ( |
| ( |
| ( |
| () => |
| () => |
| ( |
| () => |
| ( |
| ( |
| ( |
addDataSet: (options
: AddDataSetOptions
) => AddDataSetResult
Adds the data set from the cached report (or template) content to the currently edited report.
Example
const result = GrapeCity.WynReports.Designer.api.addDataSet({
reportCacheKey: 'ChartsAndTables',
dataSetName: 'DataSet1',
});
if (result.type === 'error') {
console.log(result.errorCaption);
console.log(result.errorDetails.join('\n'));
return;
}
const { dataSetName } = result;
console.log(`Data set is added to report under the name '${dataSetName}'.`);
addEmbeddedImage: (options
: AddEmbeddedImageOptions
) => AddEmbeddedImageResult
Adds the embedded image from the cached report (or template) content to the currently edited report.
Example
const result = GrapeCity.WynReports.Designer.api.addEmbeddedImage({
reportCacheKey: 'ChartsAndTables',
embeddedImageName: 'Image1',
});
if (result.type === 'error') {
console.log(result.errorCaption);
console.log(result.errorDetails.join('\n'));
return;
}
const { embeddedImageName } = result;
console.log(`Embedded image is added to report under the name '${embeddedImageName}'.`);
addLayer: (options
: AddLayerOptions
) => AddLayerResult
Adds the layer from the cached report (or template) content to the currently edited report.
Example
const result = GrapeCity.WynReports.Designer.api.addLayer({
reportCacheKey: 'ChartsAndTables',
layerName: 'Layer1',
});
if (result.type === 'error') {
console.log(result.errorCaption);
console.log(result.errorDetails.join('\n'));
return;
}
const { layerName } = result;
console.log(`Layer is added to report under the name '${layerName}'.`);
addReportItem: (options
: AddReportItemOptions
) => AddReportItemResult
Adds the report item from the cached report (or template) content to the currently edited report.
Example
const result = GrapeCity.WynReports.Designer.api.addReportItem({
reportCacheKey: 'ChartsAndTables',
reportItemName: 'Chart1',
});
if (result.type === 'error') {
console.log(result.errorCaption);
console.log(result.errorDetails.join('\n'));
return;
}
const { reportItemName, targetContainer } = result;
console.log(`Report item is added to '${targetContainer}' under the name '${reportItemName}'.`);
addReportParameter: (options
: AddReportParameterOptions
) => AddReportParameterResult
Adds the report parameter from the cached report (or template) content to the currently edited report.
Example
const result = GrapeCity.WynReports.Designer.api.addReportParameter({
reportCacheKey: 'ChartsAndTables',
reportParameterName: 'Parameter1',
});
if (result.type === 'error') {
console.log(result.errorCaption);
console.log(result.errorDetails.join('\n'));
return;
}
const { reportParameterName } = result;
console.log(`Report parameter is added to report under the name '${reportParameterName}'.`);
cacheReport: (options
: CacheReportOptions
) => Promise
<CacheReportResult
>
Caches the report (or template) content using the specified options. Caching reports is required to use the API for adding report items, data sets, report parameters, etc. from such reports.
Example
GrapeCity.WynReports.Designer.api.cacheReport({
reportCacheKey: 'ChartsAndTables',
reportInfo: {
id: '6e975775-38e3-4ac5-b92c-0ff7dab091a6',
name: 'MyReport',
version: 5,
isTemplate: false,
content: loadedReportContent,
},
}).then(function(result) {
if (result.type === 'error') {
console.log(result.errorCaption);
console.log(result.errorDetails.join('\n'));
return;
}
const { reportCacheKey } = result;
console.log('Report is cached: ', reportCacheKey);
const addReportItemResult = GrapeCity.WynReports.Designer.api.addReportItem({
reportCacheKey,
reportItemName: 'Chart1',
});
});
createReport: (options?
: CreateReportOptions
) => Promise
<CreateReportResult
>
Creates a new report to be edited in Designer using the specified options.
Example
GrapeCity.WynReports.Designer.api.createReport({
onFinish: () => {
console.log('Finished creating a new report.');
},
}).then(function(result) {
if (result.type === 'error') {
console.log(result.errorCaption);
console.log(result.errorDetails.join('\n'));
return;
}
console.log(`Report "${result.reportInfo.name}" is created successfully.`);
});
getCachedReport: (reportCacheKey
: string
) => CachedReportInfo
| null
Returns the report (or template) content cached using the specified key. If there is no report (or template) cached using this key, null
is returned.
Example
const reportInfo = GrapeCity.WynReports.Designer.api.getCachedReport('ChartsAndTables');
if (!reportInfo) return;
const { content } = reportInfo;
console.log('Report: ', content);
getReportContent: () => any
Returns the currently edited report (or template) content. This content can be passed to the corresponding createReport()
/openReport()
sub-options.
Example
const content = GrapeCity.WynReports.Designer.api.getReportContent();
console.log('Content: ', content);
getReportInfo: () => ReportInfo
Returns information about the currently edited report (or template).
Example
const info = GrapeCity.WynReports.Designer.api.getReportInfo();
console.log("${info.name}" is currently edited.);
hasCachedReport: (reportCacheKey
: string
) => boolean
Returns whether any report (or template) content is cached using the specified key.
Example
const isCached = GrapeCity.WynReports.Designer.api.hasCachedReport('ChartsAndTables');
console.log(isCached ? 'Report is cached.' : 'Report is not cached.');
isReportDirty: () => boolean
Indicates whether report (or template) has unsaved changes.
Example
const hasUnsavedChanges = GrapeCity.WynReports.Designer.api.isReportDirty();
if (hasUnsavedChanges) console.log('There are unsaved changes.');
loadReport: (options
: LoadReportOptions
) => Promise
<LoadReportResult
>
Loads the report (or template) content using the specified options.
Example
GrapeCity.WynReports.Designer.api.loadReport({
reportInfo: {
id: '6e975775-38e3-4ac5-b92c-0ff7dab091a6',
version: 5 },
}).then(function(result) {
if (result.type === 'error') {
console.log(result.errorCaption);
console.log(result.errorDetails.join('\n'));
return;
}
const { name, content } = result.reportInfo;
console.log(`Report "${name}": `, content);
});
openReport: (options
: OpenReportOptions
) => Promise
<OpenReportResult
>
Opens an existing report (or template) to be edited in Designer using the specified options.
Example
GrapeCity.WynReports.Designer.api.openReport({
reportInfo: {
id: '6e975775-38e3-4ac5-b92c-0ff7dab091a6',
name: 'MyReport',
},
onFinish: () => {
console.log('Finished opening an existing report "MyReport".');
},
}).then(function(result) {
if (result.type === 'error') {
console.log(result.errorCaption);
console.log(result.errorDetails.join('\n'));
return;
}
console.log(`Report "${result.reportInfo.name}" is opened successfully.`);});
saveReport: (options
: SaveReportOptions
) => Promise
<SaveReportResult
>
Saves the report (or template) currently edited in Designer using the specified options.
Example
GrapeCity.WynReports.Designer.api.saveReport({
reportInfo: {
name: 'MyReport',
},
onFinish: () => {
console.log('Finished saving a new report "MyReport".');
},
}).then(function(result) {
if (result.type === 'error') {
console.log(result.errorCaption);
console.log(result.errorDetails.join('\n'));
return;
}
console.log(`Report "${result.reportInfo.name}" is saved successfully.`);
});
SaveReportOptions
Ƭ SaveReportOptions: Object
Type of options
passed to the GrapeCity.WynReports.Designer.api.saveReport()
function.
Type declaration
Name | Type |
---|---|
|
|
| () => |
| () => |
|
|
| { |
|
|
|
|
|
|
|
|
comment?: string
Saved report (or template) revision comment
Example
comment: 'Changed report theme'
onFinish?: () => void
Callback on finishing to save a report (or a template).
Example
onFinish: () => {
console.log('Finished saving a report.');
}
onStart?: () => void
Callback on starting to save a report (or a template).
Example
onStart: () => {
console.log('Started saving a report.');
}
publish?: boolean
specifies whether publishing needs to be done after saving.
This property is effective only for reports in case server supports drafts and when user is an administrator or an organization administrator.
Example
publish: true
reportInfo: { id?
: string
; isTemplate?
: boolean
; name
: string
}
Report info - Information about the report (or template) to be saved.
Example
reportInfo: { id: '6e975775-38e3-4ac5-b92c-0ff7dab091a6' }
reportInfo.id?: string
Report (or template) ID
If an existing report is to be overwritten on saving, the correct ID should be specified explicitly.
Example
id: '6e975775-38e3-4ac5-b92c-0ff7dab091a6'
reportInfo.isTemplate?: boolean
Is saved document a report or a template?
Example
isTemplate: false
reportInfo.name: string
Report (or template) name
The correct name needs to be always specified explicitly.
Example
name: 'MyReport'
updateReferences?: boolean
specifies whether updating references to this document in dependent documents to the latest revision needs to be done after saving
This property is effective only for master reports.
Example
updateReferences: true
SaveReportResult
Ƭ SaveReportResult: SaveReportSuccessResult
| ReportOperationErrorResult
Type of result returned by the GrapeCity.WynReports.Designer.api.saveReport()
function.
SaveReportSuccessResult
Ƭ SaveReportSuccessResult: Object
Type of success result returned by the GrapeCity.WynReports.Designer.api.saveReport()
function.
Type declaration
Name | Type |
---|---|
| { |
|
|
|
|
|
|
|
|
|
|
reportInfo: { id
: string
; isTemplate
: boolean
; name
: string
; version
: null
}
Report info - Information about the saved report (or template).
reportInfo.id: string
Report (or template) ID
reportInfo.isTemplate: boolean
Is saved document a report or a template?
reportInfo.name: string
Report (or template) name
reportInfo.version: null
Report (or template) version - It is always null
after saving.
type: "success"
Result type
Units
Ƭ Units: "in"
| "cm"
Measurement units supported by Designer.
UpdateRouteOptions
Ƭ UpdateRouteOptions: Object
Type of options
passed to the DesignerOptions.updateRoute()
function.
Type declaration
Name | Type |
---|---|
|
|
|
|
|
|
id: string
| null
Report (or template) ID
isTemplate: boolean
Is document a report or a template?
version: string
| number
| null
Report (or template) version
ViewerOptions
Ƭ ViewerOptions: Object
Type of options
passed to the DesignerOptions.openViewer()
function.
Type declaration
Name | Type |
---|---|
|
|
|
|
| |
| { |
|
|
|
|
|
|
|
|
applicationTitle: string
Application title passed by Designer.
element: string
Element ID where to render viewer.
locale: Locale
Locale passed by Designer.
reportInfo: { id
: string
; isTemplate
: boolean
; isTemporary?
: boolean
; name
: string
}
Information on the report (or template) to-be-previewed.
reportInfo.id: string
Report (or template) ID
reportInfo.isTemplate: boolean
Is to-be-previewed document a report or a template?
reportInfo.isTemporary?: boolean
Specifies whether the report (or template) to-be-previewed is an existing one saved on server side.
reportInfo.name: string
Report (or template) name