Seal Web Interface Version

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
    token: "an authentication token" // Optional token that can be used in the Security Provider Script
})
.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
showfolders (boolean) : true if the user can view the folders
editprofile (boolean) : true if the user can edit his profile
usertag (string) : custom tag string (e.g. may be used to show a photo of the user)
onstartup (integer): action taken after the login (0=Default, 1=Do not execute report, 2=Execute the last report, 3=Execute a specific report)
startupreport (string): if onstartup=3, specific report to execute
startupreportname (string): if onstartup=3, specific report name
report (string): if set, the last report to execute after the login
reportname (string): if set, the last report name executed after the login
executionmode (integer): execution mode (0=Default thus from group, 1=New Window , 2=Same Window , 3=Always New Window)
groupexecutionmode (integer): group execution mode
sources ([MetaSource]): array of MetaSource with their connection names and identifiers
sessionId (string): the identifier of the user's session'
error (string) : if any error, the error description
securitycoderequired (boolean): true if the Two-Factor Authentication is enabled

SWICheckSecurityCode

DescriptionCheck the security code if the Two-Factor Authentication has been enabled.
Call
$.post("https://sealreport.org/demo/SWICheckSecurityCode", {
    code: "the security code", // The security code generated in the 'TwoFAGenerationScript' Script after a call to SWILogin()
})
.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
showfolders (boolean) : true if the user can view the folders
editprofile (boolean) : true if the user can edit his profile
usertag (string) : custom tag string (e.g. may be used to show a photo of the user)
onstartup (integer): action taken after the login (0=Default, 1=Do not execute report, 2=Execute the last report, 3=Execute a specific report)
startupreport (string): if onstartup=3, specific report to execute
startupreportname (string): if onstartup=3, specific report name
report (string): if set, the last report to execute after the login
reportname (string): if set, the last report name executed after the login
executionmode (integer): execution mode (0=Default thus from group, 1=New Window , 2=Same Window , 3=Always New Window)
groupexecutionmode (integer): group execution mode
sources ([MetaSource]): array of MetaSource with their connection names and identifiers
sessionId (string): the identifier of the user's session'
error (string) : if any error, the error description
login : true if the login has be re-done

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=No right, 1=Execute reports / View files, 2=Execute reports and outputs / View files, 3=Edit schedules / View files, 4=Edit reports / Manage files)
expand (boolean): true if the folder must be expanded in the tree view
manage (integer): manage flag for the folder (0=Do not manage sub-folders, 1=Manage sub-folders only as they are defined by the security (no rename or delete allowed), 2=Manage all: create, delete and rename 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
    sessionId: sessionId // The sessionId got from the SWILogin call
})
.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
    sessionId: sessionId // The sessionId got from the SWILogin call
})
.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
    sessionId: sessionId // The sessionId got from the SWILogin call
})
.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.
An optional parameter use_default_restrictions (default value is false) can be to true to force the use of the default values for custom restrictions not specified.
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, Excel, PDF, csv, text, XML, Json, etc.

    //optional restriction values if defined as prompted in the report
    f.append($('<input />').attr('name', 'use_default_restrictions').attr('value', "true")); //true -> e.g. for '"\\Search - Orders.srex', existing country values defined in the report will be used
    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
error (string): if any error, the error description

SWISetUserProfile

DescriptionSet the culture and the startup report for the logged user.
Call
$.post("https://sealreport.org/demo/SWISetUserProfile", {
            culture: "it-IT", // the new user's culture name or code
            onStartup: 3, //action taken after the login (0=Default, 1=Do not execute report, 2=Execute the last report, 3=Execute a specific report)
            startupReport: "/Overview - Sales.srex", // if onStartup=3, the report to execute
            startupReportName: "Overview - Sales", // if onStartup=3, the report name to execute
            executionMode: 0, //(0=Default, 1=Execute by default in a new Window, 2=Execute in the same Window, 3=Execute always in a new Window)
            sessionId: sessionId // The sessionId got from the SWILogin call
})
.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
    sessionId: sessionId // The sessionId got from the SWILogin call
})
.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
    sessionId: sessionId // The sessionId got from the SWILogin call
})
.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
    sessionId: sessionId // The sessionId got from the SWILogin call
})
.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
    sessionId: sessionId // The sessionId got from the SWILogin call
})
.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
    sessionId: sessionId // The sessionId got from the SWILogin call
})
.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
    sessionId: sessionId // The sessionId got from the SWILogin call
})
.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/SWIRenameFolder", {
    source: "\\Samples\\SubFolder", // The path of the folder to rename
    destination: "\\Samples\\NewSubFolder", // The path of the folder to rename
    sessionId: sessionId // The sessionId got from the SWILogin call
})
.done(function (data) {
    if (!data.error) { /* Do your job here */ }
})
Returns error (string): if any error, the error description