The module
baseServerApi.js contains certain functions required for Web Designer operation related to reports, data, themes, images, and report templates. These functions are described as follows.
Note: Certain properties and functions are marked 'Reserved' since these are not relevant in ActiveReports 13 (for example report revisions) but it is still required to have them for proper working of Web Designer. Web Designer is used not only in ActiveReports 13 but also in older version in ActiveReports Server.
Reports
GET REPORTS LIST
Parameters |
Return Value |
Response Model |
getReportsList() |
Promise |
Array<ReportsListItem> |
REPORTS LIST ITEM OBJECT
|
Copy Code
|
type ReportsListItem = {
_id: string, // report id
Name: string, // report name
IsCpl: boolean, // specifies whether report is RDL or FPL
Type: 'PageReport', // RESERVED - for now only 'PageReport' is supported
$effectivePermissions: 'All', // RESERVED - for now only 'All' is supported
}
|
GET REPORT CONTENT
Parameters |
Return Value |
Response Model |
getReportContent(options: GetReportContentOptions) |
Promise |
Report JSON Model |
GET REPORT CONTENT OPTIONS OBJECT
|
Copy Code
|
type GetReportContentOptions {
id: string, // report id
version: null, // RESERVED - for now only null is supported
}
|
GET REPORT REVISIONS - RESERVED
Parameters |
Return Value |
Response Model |
getReportRevisions(options: GetReportRevisionsOptions) |
Promise |
Array<ReportRevision> |
GET REPORT REVISIONS OPTIONS OBJECT
|
Copy Code
|
type GetReportRevisionsOptions {
id: string, // report id
}
|
REPORT REVISION OBJECT
|
Copy Code
|
type ReportRevision = {
_id: string, // report id
Name: string, // report name
IsCpl: boolean, // specifies whether report is RDL or FPL
Type: 'PageReport', // RESERVED - for now only 'PageReport' is supported
$effectivePermissions: 'All', // RESERVED - for now only 'All' is supported
}
|
SAVE NEW REPORT
Parameters |
Return Value |
Response Model |
saveNewReport(options: SaveNewReportOptions) |
Promise |
SaveReportResponse |
SAVE NEW REPORT OPTIONS OBJECT
|
Copy Code
|
type SaveNewReportOptions = {
name: string, // report name
content: object, // report JSON model
}
|
SAVE REPORT RESPONSE OBJECT
|
Copy Code
|
type SaveReportResponse = {
Id: string, // saved report id
}
|
SAVE EXISTING REPORT
Parameters |
Return Value |
Response Model |
saveExistingReport(options: SaveExistingReportOptions) |
Promise |
SaveReportResponse |
SAVE EXISTING REPORT OPTIONS OBJECT
|
Copy Code
|
type SaveExistingReportOptions = {
id: string, // report id
content: object, // report JSON model
}
|
SAVE TEMPORARY REPORT
Parameters |
Return Value |
Response Model |
saveTemporaryReport(options: SaveTemporaryReportOptions) |
Promise |
SaveReportResponse |
SAVE TEMPORARY REPORT OPTIONS OBJECT
|
Copy Code
|
type SaveTemporaryReportOptions = {
name: string, // report name
content: object, // report JSON model
}
|
DELETE TEMPORARY REPORT
This is an optional service function that is used outside of Designer. It can be used for deleting temporary reports when Report Viewer is closed and view is switched back to Designer.
Parameters |
Return Value |
Response Model |
deleteTemporaryReport(options: DeleteTemporaryReportOptions) |
Promise |
DeleteReportResponse |
DELETE TEMPORARY REPORT OPTIONS OBJECT
|
Copy Code
|
type DeleteTemporaryReportOptions = {
id: string, // report id
}
|
DELETE REPORT RESPONSE OBJECT
|
Copy Code
|
type DeleteReportResponse = {
Id: string, // deleted report id
}
|
Data
GET DATA SETS LIST
Parameters |
Return Value |
Response Model |
getDataSetsList() |
Promise |
Array<DataSetsListItem> |
DATA SETS LIST ITEM OBJECT
|
Copy Code
|
type DataSetsListItem = {
id: string, // data set id
name: string, // data set name
version: null, // RESERVED - for now only null is supported
}
|
GET DATA SOURCES AND DATA SETS
Parameters |
Return Value |
Response Model |
getDataSourcesAndDataSets(options: GetDataSourcesAndDataSetsOptions) |
Promise |
GetDataSourcesAndDataSetsResponse |
GET DATA SOURCES AND DATA SETS OPTIONS OBJECT
|
Copy Code
|
type GetDataSourcesAndDataSetsOptions = {
dataSetInfo: {
id: string, // data set id
name: string, // data set name
version: null, // RESERVED - for now only null is supported
},
dataSourceInfo: object, // RESERVED
reportDataSets: Array<DataSet>, // data sets used in report
reportDataSources: Array<DataSource>, // data sources used in report
}
|
GET DATA SOURCES AND DATA SETS RESPONSE OBJECT
|
Copy Code
|
type GetDataSourcesAndDataSetsResponse = {
dataSources: Array<DataSource>,
dataSets: Array<DataSet>,
}
|
GET DATA SET CONTENT
This function is intended to be used in getDataSourcesAndDataSets(). The result dataSetContent object may store information required to create a data set and its parent data source.
Parameters |
Return Value |
Response Model |
getDataSetContent(options: GetDataSetContentOptions) |
Promise |
dataSetContent: object |
GET DATA SET CONTENT OPTIONS OBJECT
|
Copy Code
|
type GetDataSetContentOptions = {
id: string, // data set id
}
|
DATA SOURCE AND DATA SET OBJECTS
Basic properties of DataSource and DataSet types are listed. Object models of DataSource and DataSet correlate with their structure in RDLX report definition.
|
Copy Code
|
type DataSource = {
Name: string, // data source name
ConnectionProperties: {
ConnectString: string, // connection string
DataProvider: string, // data provider - see AR Documentation
},
// ... more properties - see AR Documentation
}
type DataSet = {
Name: string, // data set name
Fields: Array<Field>, // data set fields
Query: {
DataSourceName: string, // parent data source name
CommandType: 'Text' | 'StoredProcedure', // query command type
CommandText: string, // query command text
QueryParameters: Array<QueryParameter>,
}
// ... more properties - see AR Documentation
}
type Field = {
Name: string, // field name
// Either DataField or Value needs to be available.
DataField?: string, // data field name - valid for bound fields
Value?: string, // field value - valid for calculated fields
/* Extra optional properties */
// default field aggregate - see AR Documentation for more available aggregates
Aggregate?: 'Count' | 'Sum' | 'Max' | 'Min' /* etc. */,
// field data type
DataType?: 'String' | 'Integer' | 'Float' | 'Number' | 'Boolean' | 'DateTime',
}
type QueryParameter = {
Name: string, // query parameter name
Value: string, // query parameter value
}
|
Themes
GET THEMES LIST
Parameters |
Return Value |
Response Model |
getThemesList() |
Promise |
Array<ThemesListItem> |
THEMES LIST ITEM OBJECT
|
Copy Code
|
type ThemesListItem = {
_id: string, // theme id
Name: string, // theme name
IsDefault: boolean, // specifies whether theme is default or not, only a single theme can be default
Dark1: string, // Dark1 theme color
Dark2: string, // Dark2 theme color
Light1: string, // Light1 theme color
Light2: string, // Light2 theme color
Accent1: string, // Accent1 theme color
Accent2: string, // Accent2 theme color
Accent3: string, // Accent3 theme color
Accent4: string, // Accent4 theme color
Accent5: string, // Accent5 theme color
Accent6: string, // Accent6 theme color
MajorFontFamily: string, // Major text theme font family
MinorFontFamily: string, // Minor text theme font family
}
|
GET THEME CONTENT
Parameters |
Return Value |
Response Model |
getThemeContent(options: GetThemeContentOptions) |
Promise |
ThemeModel |
GET THEME CONTENT OPTIONS OBJECT
|
Copy Code
|
type GetThemeContentOptions = {
id: string, // theme id
}
|
THEME MODEL OBJECT
|
Copy Code
|
type ThemeModel = {
Colors: {
Dark1: string, // Dark1 theme color
Dark2: string, // Dark2 theme color
Light1: string, // Light1 theme color
Light2: string, // Light2 theme color
Accent1: string, // Accent1 theme color
Accent2: string, // Accent2 theme color
Accent3: string, // Accent3 theme color
Accent4: string, // Accent4 theme color
Accent5: string, // Accent5 theme color
Accent6: string, // Accent6 theme color
Hyperlink: string, // Hyperlink theme color
HyperlinkFollowed: string, // Followed hyperlink theme color
},
Fonts: {
MajorFont: ThemeFont,
MinorFont: ThemeFont,
}
Images: Array<ThemeImage>,
Constants: Array<ThemeConstant>,
}
type ThemeFont = {
Family: string, // font family
Style: string, // font style
Size: string, // font size
Weight: string, // font weight
}
type ThemeImage = {
Name: string, // image name
MIMEType: string, // image MIME type
ImageData: string, // Base64 image data
}
type ThemeConstant = {
Key: string, // constant key
Value: string, // constant value
}
|
Images
GET IMAGES LIST
Parameters |
Return Value |
Response Model |
getImagesList() |
Promise |
Array<ImagesListItem> |
IMAGES LIST ITEM OBJECT
|
Copy Code
|
type ImagesListItem = {
_id: string, // image id
Name: string, // image name
MimeType: string, // image MIME type
Thumbnail: null, // RESERVED - for now only null is supported
}
|
GET IMAGE URL
This url is used to display external image in design-time.
Parameters |
Return Value |
getImageUrl(options: GetImageUrlOptions) |
imageUrl: string |
GET IMAGE URL OPTIONS OBJECT
|
Copy Code
|
type GetImageUrlOptions = {
id: string, // image id
}
|
Report Templates
GET TEMPLATES LIST
This function can be used in some custom File View implementation.
Parameters |
Return Value |
Response Model |
getTemplatesList() |
Promise |
Array<TemplatesListItem> |
TEMPLATES LIST ITEM OBJECT
|
Copy Code
|
type TemplatesListItem = {
_id: string, // template id
Name: string, // template name
}
|
GET TEMPLATE CONTENT
Parameters |
Return Value |
Response Model |
getTemplateContent(options: GetTemplateContentOptions) |
Promise |
Report JSON Model |
GET TEMPLATE CONTENT OPTIONS OBJECT
|
Copy Code
|
type GetTemplateContentOptions = {
id: string, // template id
}
|
GET TEMPLATE THUMBNAIL
This function can be used in some custom File View implementation.
Parameters |
Return Value |
Response Model |
getTemplateThumbnail(options: GetTemplateThumbnailOptions) |
Promise |
base64ImageData: string |
GET TEMPLATE THUMBNAIL OPTIONS OBJECT
|
Copy Code
|
type GetTemplateThumbnailOptions = {
id: string, // template id
}
|
Miscellaneous
CREATE RESOURCE LINK
This function creates a resource (report/image/theme) link to be stored in RDLX report definition. The Resource links are then resolved while rendering report. These links need to be correct for successful report preview.
Parameters |
Return Value |
createResourceLink(options: ResourceLinkOptions) |
resourceLink: string |
RESOURCE LINK OPTIONS OBJECT
|
Copy Code
|
type ResourceLinkOptions = {
id: string, // resource id
type: 'report' | 'image' | 'theme' | null, // resource type
version: null, // RESERVED - for now only null is supported
}
|
PARSE RESOURCE LINK
The opposite operation to createResourceLink().
Parameters |
Return Value |
parseResourceLink(resourceLink: string) |
ResourceLinkOptions |
UPDATE ROUTE
This function can be used to update Designer url when a new or an existing report editing is started.
Parameters |
Return Value |
updateRoute(options: UpdateRouteOptions) |
void |
UPDATE ROUTE OPTIONS OBJECT
|
Copy Code
|
type UpdateRouteOptions = {
id: string, // report id
version: null, // RESERVED - for now only null is supported
}
|
See Also