Seal Report Tutorials

This page contain several useful Seal Report tutorials.

We assume that Seal Report is already installed (Check Installation).

Add your Tutorial

Do you have a new tutorial to share ?
As the site for the documentation is part of the solution, you are welcome to Pull a Request at GitHub.

Report from a SQL Select

Build a report from a simple SQL statement (2 minutes)

This guide shows how to create and execute a report from a simple SQL statement and a database connection.
  1. In the Start menu, point to Programs->Seal Report and then click Report Designer.
  2. Click on New (top-left in the toolbar)
  3. In the left tree view, right-click on the root node named "Sources" and select [Add a new SQL Data Source] in the contextual menu.
    A new source is created and the source connection is displayed.
  4. Edit the Connection String property with the OLE DB Wizard and verify the connection is working using the [Check Connection] helper or [F7].
  5. In the left tree view, right-click on the root node named "Models" and select [Add a SQL Model] in the contextual menu.
    A new SQL Model named "Model2" is created and the SQL Editor is displayed. Click [Cancel] to close the dialog.
  6. In the model definition, set the Source property to a the Data Source called "Data Source" that you have previously created.
  7. In the text box, type your SQL statement (e.g. "select * from products") and click [OK]. The Source tree view displays the columns of the Select.
  8. In the elements tree view, drag and drop the elements you want to see in the Row panel.
  9. If necessary, drag and drop elements in the restrictions panel to filter data.
  10. In the left tree view, click on the view node named "Views\View\Model" and set the Current Model property to "Model2".
  11. Click [Execute] or press [F5].
    The report is executed.
  12. Click [Close] then [Save] to save the report in the repository.

First Data Source and Report

Build a repository Data Source and Reports based on your database schema (5 minutes)

This guide shows how to create a first Data Source describing your database metadata. Based on this Data Source, reports can be easily built and executed using dynamic SQL generation.

Step 1: Create your first Data Source.

  1. In the Start menu, point to Programs->Seal Report and then click Server Manager.
  2. On the File menu, click New->Data Source.
    A new Data Source is created and the connection is selected.
  3. Edit the Connection String property with the OLE DB Wizard and check the connection configured using the [Check Connection] helper or [F7].
  4. In the left tree view, right-click on the root node called "Tables" and select [Add Tables from Catalog...] in the contextual menu.
    A dialog box appears.
  5. Select the tables in your Data Source and click [OK].
    Tables, columns and joins have been automatically added.
  6. Click [Save] to save the Data Source in the repository.

Step 2: Create, execute and store your first reports.

  1. On the Start menu, point to Programs->Seal Report and then click Report Designer.
  2. Click on [New] (top-left in the toolbar).
  3. In the left tree view, click on the Model node called "Model".
    The model is displayed.
  4. In the model definition, select the Data Source you have previously created.
  5. In the elements tree view, expand the nodes with the table names, then drag and drop the elements you want to see in the Row panel.
  6. If necessary, drag and drop elements in the restrictions panel to filter data.
  7. Click [Execute] or press [F5].
    The report is executed.
  8. Click [Close] then [Save] to save the report in the repository.

Publication on Linux Ubuntu

This guide shows how to publish the .NET Core distribution to a Linux Ubuntu System.

Step 1: Create an configure an Ubuntu Sub-System.

  1. From the Windows Store, download and create an Ubuntu Sub-System.
    Enter a user name and password for the super user.
  2. Configure the Linux System to install .NET Core: follow the procedure as described in:
    https://docs.microsoft.com/en-us/dotnet/core/install/linux-package-manager-ubuntu-1604
  3. From the Ubuntu Command Prompt, install the following packages for Excel results (EPPlus):
                                        sudo apt update
                                        sudo apt install libgdiplus
                                        
  4. From the Ubuntu Command Prompt, install the following packages for ScottPlot charts:
                                        sudo apt update
                                        sudo apt install libgdiplus
                                        sudo apt install -y libfreetype6
                                        sudo apt install -y libfontconfig1
                                        sudo apt install -y fontconfig
                                        sudo apt install -y libnss3
                                        
  5. For HTML to PDF results (Puppeteer), follow the procedure:
    Running Puppeteer on WSL (Windows subsystem for Linux)
  6. From the Ubuntu Command Prompt, create the /seal installation folder:
                                        cd /
                                        sudo mkdir seal
                                        chmod ugo+rwx /seal
                                        

Step 2: Deploy files to the Ubuntu Sub-System.

  1. From your Windows computer, run the Report Designer and edit the report System\500 Publication - Web Report Server
    Modify the task script 'Publish Web Report Server' to configure the Destination Directory to '\\wsl$\Ubuntu\seal':
                                            webServerDestination = @"\\wsl$\Ubuntu\seal";
                                        
    Execute the report, check 'Web Report Server Distribution' restriction, then re-execute the report to deploy the Web Report Server.
    Files are copied from the installation directory '\Web' Sub-Folder to '\\wsl$\Ubuntu\seal' ('/seal' on Ubuntu).
    Save the report for future publications (Note that this deployment could also be made manually using the Windows Explorer).
  2. Using the Report Designer, open and edit the report System\510 Publication - Repository
    Modify the task script 'Publish Repository Files' to configure the Destination Directory to '\\wsl$\Ubuntu\seal\Repository':
                                            repositoryDestination = @"\\wsl$\Ubuntu\seal\Repository";
                                        
    Execute the report.
    Check the restriction 'Repository Source Folder'.
    Re-execute the report.
    Repository Files are copied to '\\wsl$\Ubuntu\seal\Repository' ('/seal/Repository' on Ubuntu).
    Save the report for future publications (Note that this deployment could also be made manually using the Windows Explorer).

Step 3: Run the Web Report Server on Ubuntu.

  1. From the Ubuntu Command Prompt, run the following commands:
                                            sudo chown -R $USER:$USER /seal
                                            cd /seal
                                            dotnet /seal/SealWebServer.dll
                                        
    The Web Report Server should be listening at http://localhost:5000
  2. Browse to http://localhost:5000, execute and check the report System\100 Configuration - Security Summary.

Troubleshooting

  1. From your Windows computer, run the Report Designer and execute the report System\510 Publication - Repository to view the current remote log file content.
  2. Using Windows explorer, check the Logs files in the '\\wsl$\Ubuntu\seal\Repository\Logs' remote folder ('/seal/Repository/Logs' on Ubuntu).

Publication on Azure

This guide shows how to publish either the .Net distribution as an Azure App Service.
We assume that you have already an Azure account with a valid subscription.

Step 1: Create the Azure App Service.

  1. Login to the Azure Portal, go to to Home > App Services
  2. Click on [Create > Web App] and edit the App Service properties.
    Select a subscription, resource group.

    For .Net, Linux
    Instance name: 'sealcore' (.azurewebsites.net)
    Publish: 'Code'
    Runtime stack: '.NET Version of the Seal Distribution (e.g. .Net 8 (LTS))'
    Operating System: 'Linux'

    For .Net, Windows
    Instance name: 'sealnet' (.azurewebsites.net)
    Publish: 'Code'
    Runtime stack: '.NET Version of the Seal Distribution (e.g. .Net 8 (LTS))'
    Operating System: 'Windows'

    Change Sku and Size if necessary
    Review and create the App Service.

Step 2: Deploy files to the Azure App Service.

  1. From the Azure Portal, open the APP Service created.
    Click on Configuration, select [General Settings], set "SCM Basic Auth Publishing" and "FTP Basic Auth Publishing Credentials" to On.
    Click on Deployment Center, then select [FTP credentials].
    Copy the FTPS Endpoint string, User Name and Password.
  2. From your Windows computer, run the Report Designer and edit the report System\500 Publication - Web Report Server
    Modify the task script 'Publish Web Report Server' to configure the Destination Directory to '/site/wwwroot/':
                                            webServerDestination = @"/site/wwwroot/";
                                        
    Modify the script to configure the FTP Client (Host Name, User Name, Password) using the information got in the previous step.
                                            //e.g. for FTPS Endpoint: ftps://waws-prod-dm1-163.ftp.azurewebsites.windows.net/site/wwwroot    
                                            client = new FtpClient("waws-prod-dm1-163.ftp.azurewebsites.windows.net", @"sealcore\$sealcore", "password got from the Azure portal"); 
                                        
    Execute the report.
    Set the 'Web Report Server Distribution' restriction: Select .NET distribution.
    Re-execute the report to deploy the Web Report Server.
    Files are copied from the installation directory '\NETCore' or '\Web.Net' Sub-Folder to the remote directory '/site/wwwroot/'.
    Save the report for future publications (Note that this deployment could also be made manually using a standard FTP Client like FileZilla).
  3. Edit the report System\510 Publication - Repository
    Modify the task script 'Publish Repository Files' to configure the Destination Directory to '/site/wwwroot/':
                                            repositoryDestination = @"/site/wwwroot/";
                                        
    Modify the script to configure the FTP Client (Host Name, User Name, Password) using the information got in the previous step.
                                            //e.g. for FTPS Endpoint: ftps://waws-prod-dm1-163.ftp.azurewebsites.windows.net/site/wwwroot    
                                            client = new FtpClient("waws-prod-dm1-163.ftp.azurewebsites.windows.net", @"sealcore\$sealcore", "password got from the Azure portal"); 
                                        
    Execute the report.
    Set the restriction 'Repository Source Folder' to 'Repository: Copy All Folders'.
    Re-execute the report.
    Repository Files are copied to the remote directory '/site/wwwroot/Repository/'.
    Save the report for future publications (Note that this deployment could also be made manually using a standard FTP Client like FileZilla).

Step 3: Configure the App Service.

  1. From the Azure Portal, open the APP Service created.
    Click on Configuration, then select the General Settings tab.
  2. For .Net, Linux:
    Set Startup Command to 'apt-get update && apt-get install -y apt-utils libgdiplus libfreetype6 libfontconfig1 fontconfig libnss3 && dotnet /home/site/wwwroot/SealWebServer.dll'
    For .Net, Windows:
    Set the Platform '64bit' (This may require a minimum App Service Plan B1)
  3. Go back to Overview and click [Browse] to test the site.
    Check a report execution: 'System/100 Configuration - Security Summary'

Troubleshooting

  1. From your Windows computer, run the Report Designer and execute the report System\510 Publication - Repository to view the current remote log file content.
  2. Using a standard FTP Client like FileZilla, check the Logs files in the '/site/wwwroot/Repository/Logs' remote folder.
  3. HTML and JavaScript for PDF support: As PuppeteerSharp requires a chrome install on the server, to host in azure you need to use azure docker support. Rebuild your app as a docker image and host as a web app or azure function as required.

Audit database in Azure

After the publication of the Web Report Server on Azure, this guide shows how to create an Audit MS SQLServer database in Azure to store the Seal Report audit events.
We assume that you have already an Azure account with a valid subscription and that the previous tutorial has been achieved successfully.

Step 1: Create the Azure Database.

  1. Login to the Azure Portal, go to to Home > SQL databases
  2. Click on [Add] and edit the Database properties.
    Database name: 'sealdb'
    Server name: 'sealsqlserver'
    Plus an Administrator Username and Password.
    Change the database size if necessary.
    Review and create the SQL Database.

Step 2: Edit the Audit Data Source connection.

  1. From the Azure Portal, open the SQL Database created.
    Click on Properties, then select Show database connection strings.
    Copy the connection string.
  2. From your Windows computer, run the Server Manager and open the Audit Data Source.
    Select the main connection.
    Set Database type to 'MS SQLServer' and Connection Type to 'MS SQLServer'.
    Edit the MS SQLServer Connection String and copy the connection string got in the previous step.
    Remove the 'User Id' and 'Password' and set them in the related connection properties. The final connection string should be:
                                        Server=tcp:sealsqlserver.database.windows.net,1433;Initial Catalog=sealdb;Persist Security Info=False;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;'
                                        
    Click F7 Check Connection to test the connection.
    If it fails because of the Azure Firewall:
    Go to the SQL Database created in the Azure Portal, click on the top button [Set server firewall]
    Add a rule to accept the Client IP address proposed. Save the configuration.
    From the Server Manager, check again the connection and save the Data Source.
  3. Click on the menu Configuration->Server Configuration....
    Set Audit Enabled to 'true' and click [OK] to save the configuration.

Step 3: Deploy and test the Audit Data Source on a previous Azure deployment.

  1. From your Windows computer, run the report System\510 Publication - Repository
    Warning: We assume that the FTP Configuration has already be made in the previous tutorial.
    Set the restriction 'Repository Source Folder' to 'Repository Folder: Settings' and 'Repository Folder: Sources'.
    Re-execute the report.
    The files '\Settings\Configuration.xml' and '\Sources\Audit.scfx' are copied to the Azure remote repository '/site/wwwroot/Repository/'
  2. From the Azure Portal, open the SQL Database created.
    Click on the top button [Set server firewall]
    Set Allow Azure services and resources to access this server to 'true'.
    Save the configuration.

Step 4: Test Audit reports.

  1. Browse to the the Web Report Server site previously published on Azure.
    Disconnect and reconnect to reload the Data Sources.
  2. Run the report System\400 Sources - Check Sources and check the Audit Data Source.
    The first time the report is executed, an error 'Table sr_audit does not exist' is raised.
    Re-execute the check.
    The second execution, the checks should be ok as the sr_audit table has been created by the default audit script.
  3. Run the report System\200 Audit - Search and check that the sr_audit table has new records.

Run the Seal Report Scheduler

This topics shows the different ways to install and run the Seal Report Scheduler instead of using the standard Windows Task Scheduler.

Server Configuration

Run the Server Manager, menu Configuration->Configure Server....
Set the property Scheduler Mode to either Service or Worker or Web Server.

Remarks

  • Only one instance of scheduler can be executed for one repository.
  • Check the Seal Report Scheduler messages in the Event Viewer (Windows OS) or in the \Logs Repository Sub-Folder.
  • By default, schedules are executed in a new process (configuration Outer Process is true), however you may run the schedule in the same process to speed up the start.

System Reports for Schedules

Use dedicated schedule reports from the \Reports\System Repository sub-folder:
  • 320 Reports - Web Server Schedule Definitions
  • 360 Reports - Last Schedules Executions (only valid if the Audit database is enabled)

As a Windows Service (Windows OS)

  1. The property Scheduler Mode has been set to Service or Worker.
  2. Edit the Power Shell file SealSchedulerServiceInstall.ps1 file located in your installation directory (e.g. C:\Program Files\Seal Report). Check that the file paths are correct.
  3. Right click on SealSchedulerServiceInstall.ps1 and execute it as Administrator.
    The Seal Report Scheduler is installed as a Windows Service.
  4. Run the MMC Service Manager to edit the service properties (Startup mode, Identity, etc.).
    Start the service.

As a Worker Service (Linux OS)

  1. The property Scheduler Mode has been set to Service or Worker.
  2. We assume that the .NET distribution has been already deployed on the Linux OS.
    Deploy also the \Settings\Configuration.xml in the remote repository.
  3. From a Linux command prompt, run the Seal Scheduler Worker with the command:
                                        dotnet /seal/SealSchedulerWorker.dll
                                        

As a Worker thread in the Web Report Server

  1. The property Scheduler Mode has been set to Web Server.
  2. Restart the Web Report Server.

Contribute to Seal Report

Enhance the documentation and samples

Want to share your experience or to add a new topic ? Something is not clear in the documentation ? Do you have an interesting recipe ?
As the site for the documentation is part of the solution, you are welcome to Pull a Request at GitHub.

Add translation files

Do you have a translation file not yet supported by Seal Report ?
Check first the recipe Adding translation files.
As the translations are part of the project, feel free to Pull a Request at GitHub.

Sponsor the project

If you are using Seal Report in a business application, please consider to sponsor the product to ensure its maintenance, quality and independence.
Please check Support and Sponsor.

And more...

You are also welcome to help us in several different areas:
  • Beta testing.
  • Libraries of Data Sources and Reports on standard databases.
  • Additional View templates.
  • New features development.
Please feel free to contact us at Ariacom or use GitHub if you are interested in contributing to Seal Report.