Use SSRS for K2 blackpearl
Make use of SQL Reporting Services (SSRS) for K2 blackpearl and include SmartObject data in your report.
Intro
There are several use cases where you should think about taking advantage of SSRS for K2 blackpearl reporting.
- One of the is of course when you want to provide statistics for your processes. You can use different kinds of charts, probably with drill-down functionalities.
- Another example could be providing a more sophisticated view on process data than it would be possible with K2 SmartForms, e.g. a list of datasets with several lines per item.
- Last but not least think about creating a print view for your K2 SmartForms, especially when the form is complex.
In each scenario you can make use of the advantages from SSRS, e.g. the page break feature from tables.
The greatest feature in my eyes is that you can make use of K2 SmartObjects (SMO) within SSRS.
There are several help articles from K2 about how to install SSRS for K2:
Prerequisites for the K2 for Reporting Services component
Install the K2 for Reporting Services component
If your SSRS environment is set up and running, you will need either Visual Studio or SQL Server Data Tools for creating the reports based on K2 data.
Depending on the data source — if it is either standard SQL access or making use of K2 SmartObjects — you need to change the Shared Data Source within the project:
- if you are using “standard SQL” queries to SQL databases, you would select the Microsoft SQL Server provider
- if you want to access K2 SmartObject as the data source for your reports, select SOURCECODE
In this example, I want to demonstrate how to create a report based on the K2 SmartObject “Process Instance” which is a default K2 SMO.
For simplicity, I will only guide you through the basic steps (as this should not reflect an SSRS tutorial).
Step-by-step guide
Create your new Report Server Project
I will use SQL Server Data Tools.
Create a new Shared Data Source
It will be based on the SOURCECODE Type.
The connection string refers to your K2 HostServer and port: Host=Localhost;port=5555
Create a new Shared Data Set
It will based on the Shared Data Source you just created.
The Query Designer proves that your query is correct:
You will need to provide the systemname of the SMO in the query. If you don’t know it, use the SmartObject Service Tester tool:
- Open the SmartObject Service Tester
- Navigate to your SMO
- Right-click and select “View XML”
- Look for “Name”
Create your report
Using the Report Wizard, you can create your own report. Within the query designer, you may use the following query
select * from process_instance
The result could be like this (very basic) report:
There is another good help article from K2 covering this topic:
Creating K2 Platform based RDL Reports in Visual Studio
If you use SSRS for K2 blackpearl, sometimes the life of a K2 developer can be easier :-)