Seal Web Interface Version 5.0

SWIGetVersions

DescriptionReturns the version of the Seal Web Interface and the version of the Seal Library.
Call
$.post("https://sealreport.org/demo/SWIGetVersions")
.done(function (data) {
    if (!data.error) { /* Do your job here */ }
})
Returns SWIVersion (string) : Seal Web Interface version
SRVersion (string) : Seal library version

SWILogin

DescriptionStart a session with the Web Report Server using the user name and password (may be optional according to the authentication configured on the server) and returns information of the logged user.
Call
$.post("https://sealreport.org/demo/SWILogin", {
    user: "the user name", // The user name
    password: "the password" // The password
})
.done(function (data) {
        if (!data.error) { /* Do your job here */ }
})
Returns name (string) : the user name
group (string) : the user's group names
culture (string) : the user's culture name
folder (string) : the last folder viewed by the user
dashboard (string) : the last dashboard GUID viewed by the user
viewType (int): 0 reports only, 1 dashboards only, 2 reports and dashboards
lastview (string): last user's view (reports or dashboards)
dashboardFolders ([string]): array of string of the dashboard folders with the edit right
manageDashboards (bool): manage dashboards view right of the user
error (string) : if any error, the error description

SWILogout

DescriptionClear the current user session.
Call
$.post("https://sealreport.org/demo/SWILogout")
.done(function (data) {
        if (!data.error) { /* Do your job here */ }
})
Returns error (string): if any error, the error description

SWIGetRootFolders

DescriptionReturns all the folders of the user (including Personal folders).
Call
$.post("https://sealreport.org/demo/SWIGetRootFolders", {
})
.done(function (data) {
    if (!data.error) { /* Do your job here */ }
})
Returns path (string) : the folder path
name (string) : the translated folder name
fullname (string): the full path translated of the folder
right (integer): folder right (0 = Execute reports, 1 = Execute reports, 2 = Schedule reports, 3 = Edit reports)
expand (boolean): true is the folder must be expanded in the tree view
manage (integer): manage flag for the folder. (0 = Do not manage, 1 = manage sub-folders only, 2 = manage folder itself and sub-folders)
folders ([folder]): array of children folders
error (string): if any error, the error description

SWIGetFolders

DescriptionReturns the list of the published folders for the current user from a root folder.
Call
$.post("https://sealreport.org/demo/SWIGetFolders", {
    path: "\\" // The path of the root folder
})
.done(function (data) {
    if (!data.error) { /* Do your job here */ }
})
Returns path (string) : the folder path
name (string) : the translated folder name
fullname (string): the full path translated of the folder
right (integer): folder right (0 = Execute reports, 1 = Execute reports, 2 = Schedule reports, 3 = Edit reports)
expand (boolean): true is the folder must be expanded in the tree view
manage (integer): manage flag for the folder. (0 = Do not manage, 1 = manage sub-folders only, 2 = manage folder itself and sub-folders)
folders ([folder]): array of children folders
error (string): if any error, the error description

SWIGetFolderDetail

DescriptionReturns the list of file names and details contained in a folder.
Call
$.post("https://sealreport.org/demo/SWIGetFolderDetail", {
    path: "\\" // The path of the folder
})
.done(function (data) {
    if (!data.error) { /* Do your job here */ }
})
Returns folder (folder): the current folder description
files ([file]): array of files
error (string): if any error, the error description

file path (string): the file path
name (string): the translated file name
last (string): the last modification date and time
isReport (boolean): true if the file is a report
right (int): right applied to the folder (0 = Execute reports, 1 = Execute reports, 2 = Schedule reports, 3 = Edit reports)

SWISearch

DescriptionReturns the list of file names and details matching a search in the repository.
Call
$.post("https://sealreport.org/demo/SWISearch", {
    path: "\\" // The path of the folder to start the search
    pattern: "re" // Pattern contained in the file name of the files returned
})
.done(function (data) {
    if (!data.error) { /* Do your job here */ }
})
Returns files ([file]): array of files
error (string): if any error, the error description

file path (string): the file path
name (string): the translated file name
last (string): the last modification date and time
isReport (boolean): true if the file is a report
right (int): right applied to the folder (0 = Execute reports, 1 = Execute reports, 2 = Schedule reports, 3 = Edit reports)

SWIGetReportDetail

DescriptionReturns the views and outputs of a report.
Call
$.post("https://sealreport.org/demo/SWIGetReportDetail", {
    path: "\\", // The path of the report
})
.done(function (data) {
    if (!data.error) { /* Do your job here */ }
})
Returns views ([view]): array of views
outputs ([output]): array of outputs
error (string): if any error, the error description
view guid (string): the unique identifier of the output
name (string): the output name
displayName (string): the output name translated
output guid (string): the unique identifier of the view
name (string): the view name
displayName (string): the view name translated

SWExecuteReportToResult

Description Execute a report into a report result and returns the result.

Custom restriction values can be set for the execution if they are prompted in the report.
In this case the parameters must be prefixed with r0_ (for the restriction 0) with the following suffixes:
name for the name of the restriction.
operator for the operator applied:
Equal, NotEqual, Greater, GreaterEqual, Smaller, SmallerEqual, Between, NotBetween, Contains, NotContains, StartsWith, EndsWith, IsEmpty, IsNotEmpty, IsNull, IsNotNull.
value_1 to value_4 if the restriction is not an enumerated list (date format is YYYYMMDD hh:mm:ss).
enum_values containing the list of enumerated identifiers separated by commas if the restriction is an enumerated list.

Several restrictions can be defined by changing the prefix index.
Call
    var f = $('<form method="post" target="_blank" />').appendTo('body');
    f.attr('action', sealServer + "SWExecuteReportToResult");
    f.append($('<input/>').attr('name', 'path').attr('value', path));  //the report path, if empty the report definition must be specified
    f.append($('<input />').attr('name', 'render').attr('value', JSON.stringify(render))); //true if the report can be rendered (this option is used only if report definition is specified)
    f.append($('<input />').attr('name', 'viewGUID').attr('value', viewGUID)); //optional, the view GUID to execute in the report
    f.append($('<input />').attr('name', 'outputGUID').attr('value', outputGUID)); //optional, the output GUID to execute in the report
    f.append($('<input />').attr('name', 'format').attr('value', "html"));  // optional, html by default, print, csv, pdf or excel with the converter 

    //optional restriction values if defined as prompted in the report
    f.append($('<input />').attr('name', 'r0_name').attr('value', "Quantity"));
    f.append($('<input />').attr('name', 'r0_operator').attr('value', "Between"));
    f.append($('<input />').attr('name', 'r0_value_1').attr('value', "34"));
    f.append($('<input />').attr('name', 'r0_value_2').attr('value', "123"));
    f.append($('<input />').attr('name', 'r1_name').attr('value', "Category"));
    f.append($('<input />').attr('name', 'r1_operator').attr('value', "Equal"));
    f.append($('<input />').attr('name', 'r1_enum_values').attr('value', "2,3,4,7"));
    f.append($('<input />').attr('name', 'r2_name').attr('value', "Order Date"));
    f.append($('<input />').attr('name', 'r2_operator').attr('value', "Equal"));
    f.append($('<input />').attr('name', 'r2_value_1').attr('value', "19940809 00:00:00"));
    f.append($('<input />').attr('name', 'r2_value_2').attr('value', "19940810 00:00:00"));
    f.append($('<input />').attr('name', 'r2_value_3').attr('value', "19940811 00:00:00"));
    f.append($('<input />').attr('name', 'r2_value_4').attr('value', "19940812 00:00:00"));
    f.append($('<input />').attr('name', 'r3_name').attr('value', "Customer Contact"));
    f.append($('<input />').attr('name', 'r3_operator').attr('value', "Contains"));
    f.append($('<input />').attr('name', 'r3_value_1').attr('value', "ar"));
    f.children('input').attr('type', 'hidden');
    f.submit();

SWExecuteReport

Description Execute a report and returns the report html display result content (e.g. html with prompted restrictions).
Custom restriction values can be set for the execution if they are prompted in the report as described for SWExecuteReportToResult.
Call
    var f = $('<form method="post" target="_blank" />').appendTo('body');
    f.attr('action', sealServer + "SWExecuteReport");
    f.append($('<input />').attr('name', 'path').attr('value', path));  //the report path, if empty the report definition must be specified
    f.append($('<input />').attr('name', 'render').attr('value', JSON.stringify(render))); //true if the report can be rendered (this option is used only if report definition is specified)
    f.append($('<input />').attr('name', 'viewGUID').attr('value', viewGUID)); //optional, the view GUID to execute in the report
    f.append($('<input />').attr('name', 'outputGUID').attr('value', outputGUID)); //optional, the output GUID to execute in the report
    f.children('input').attr('type', 'hidden');
    f.submit();

SWIGetUserProfile

DescriptionReturns the profile information of the logged user.
Call
$.post("https://sealreport.org/demo/SWIGetUserProfile")
.done(function (data) {
        if (!data.error) { /* Do your job here */ }
})
Returns authenticated (bool): true if the user is authenticated, if false the other properties are not set. name (string): the user name
group (string): the user's group names
culture (string): the user's culture name
viewtype (string): 0 for reports or 1 for dashboards
error (string): if any error, the error description

SWISetUserProfile

DescriptionSet the culture for the logged user.
Call
$.post("https://sealreport.org/demo/SWISetUserProfile", {
            culture: "it-IT" // the new user's culture name or code
})
.done(function (data) {
        if (!data.error) { /* Do your job here */ }
})
Returns error (string): if any error, the error description

SWITranslate

DescriptionTranslate a text either from the public translations or the repository translations. If the optional parameter instance is not empty, the repository translations are used.
Call
$.post("https://sealreport.org/demo/SWITranslate", {
    context: "Element", // translation context as defined in Translations.csv or RepositoryTranslations.csv
    instance: "Customers.City",  //optional, translation instance as defined in RepositoryTranslations.csv
    reference: "City" // reference text to translate
})
.done(function (data) {
        if (!data.error) { /* Do your job here */ }
})
Returns text (string): the text translate

SWIDeleteFiles

DescriptionDelete files or reports from the repository.
Call
$.post("https://sealreport.org/demo/SWIDeleteFiles", {
    paths: "\\report1.srex\n\\report2.srex", // The paths of the files to delete separated by \n
})
.done(function (data) {
    if (!data.error) { /* Do your job here */ }
})
Returns error (string): if any error, the error description

SWIMoveFile

DescriptionMove a file or a report in the repository.
Call
$.post("https://sealreport.org/demo/SWIMoveFile", {
    source: "\\report.srex", // The path of the report to copy or move
    destination: "\\newname.srex", // The destination path 
    copy: true //true to copy, false to move
})
.done(function (data) {
    if (!data.error) { /* Do your job here */ }
})
Returns error (string): if any error, the error description

SWIViewFile

DescriptionView a file published in the repository.
Call
$.post("https://sealreport.org/demo/SWIViewFile", {
    path: "\\report.htm", // The path of the file to view
})
.done(function (data) {
    if (!data.error) { /* Do your job here */ }
})
Returns url (string): the url of the result file
error (string): if any error, the error description

SWICreateFolder

DescriptionCreate a sub-folder in the repository.
Call
$.post("https://sealreport.org/demo/SWICreateFolder", {
    path: "\\Samples\\SubFolder", // The path of the folder to create
})
.done(function (data) {
    if (!data.error) { /* Do your job here */ }
})
Returns error (string): if any error, the error description

SWIDeleteFolder

DescriptionDelete a sub-folder in the repository. The folder must be empty.
Call
$.post("https://sealreport.org/demo/SWIDeleteFolder", {
    path: "\\Samples\\SubFolder", // The path of the folder to delete
})
.done(function (data) {
    if (!data.error) { /* Do your job here */ }
})
Returns error (string): if any error, the error description

SWIRenameFolder

DescriptionRename a sub-folder in the repository.
Call
$.post("https://sealreport.org/demo/SWIDeleteFolder", {
    source: "\\Samples\\SubFolder", // The path of the folder to rename
    destination: "\\Samples\\NewSubFolder", // The path of the folder to rename
})
.done(function (data) {
    if (!data.error) { /* Do your job here */ }
})
Returns error (string): if any error, the error description

SWINewReportDefinition

(Web Report Designer only)
DescriptionInit a returns the definition of a new report in a repository.
Call
$.post("https://sealreport.org/demo/SWIGetReportDefinition", {
    path: "\\New Report.srex" // The path of the report
})
.done(function (data) {
    if (!data.error) { /* Do your job here */ }
})
Returns report (SWIReport): the definition of the new report (refer to SWIReport class in the source code SWIReportModels.cs)
error (string): if any error, the error description

SWIGetReportDefinition

(Web Report Designer only)
DescriptionReturns the definition of an existing report.
Call
$.post("https://sealreport.org/demo/SWIGetReportDefinition", {
    path: "\\New Report.srex" // The path of the report
})
.done(function (data) {
    if (!data.error) { /* Do your job here */ }
})
Returns report (SWIReport): the report definition (refer to SWIReport class in the source code SWIReportModels.cs)
error (string): if any error, the error description

SWISaveReportDefinition

(Web Report Designer only)
DescriptionSave a report.
Call
$.post("https://sealreport.org/demo/SWISaveReportDefinition", {
    path: "\\a report.srex", // The path of the report
    check: true, //If true, the save check that the report does not exists
    report: report //the report definition (refer to SWIReport class in the source code SWIReportModels.cs)
})
.done(function (data) {
    if (!data.error) { /* Do your job here */ }
})
Returns error (string): if any error, the error description

SWExecuteReportDefinition

(Web Report Designer only)
Description Execute a report from its definition and returns the report html display result content (e.g. html with prompted restrictions).
Custom restriction values can be set for the execution if they are prompted in the report as described for SWExecuteReportToResult.
Call
    var f = $('<form method="post" target="_blank" />').appendTo('body');
    f.attr('action', sealServer + "SWIExecuteReportDefinition");
    f.append($('<input />').attr('name', 'path').attr('value', path));  //the report path, if empty the report definition must be specified
    f.append($('<input />').attr('name', 'render').attr('value', JSON.stringify(render))); //true if the report can be rendered (this option is used only if report definition is specified)
    f.append($('<input />').attr('name', 'viewGUID').attr('value', viewGUID)); //optional, the view GUID to execute in the report
    f.append($('<input />').attr('name', 'outputGUID').attr('value', outputGUID)); //optional, the output GUID to execute in the report
    f.children('input').attr('type', 'hidden');
    f.submit();