K2 blackpoint ships with an ADO.net provider for interacting with SmartObjects. This includes any SmartObjects that you create against SharePoint content, Workflow SmartObjects that you can configure when designing your process, as well as some pre-configured reporting SmartObjects which are used by the out of the box reports in the process portal.
The ADO.net provider allows you to build ASP.net forms as well as SQL Reporting Services reports in much the same way as you would use any other ADO.net provider.
Today I will show you the ASP.net example. The recording attached to this post also discusses using the ADO.net Provider in a SQL Reporting Services report. The configuration of the data source is similar for ASP.net and SQLRS.
For this example I have created a basic web page project. There are 2 things that you will need to configure to ensure that your ASP.net page works properly with the data provider:
- Turn on Integrated Authentication for the web application in IIS and turn off anonymous access. This can be done in the Authentication and Access control section of the Directory Security tab in the Web Application properties.
- Add the following line to your web.config file:
<identity impersonate="true"/>
In Visual Studio the ADO.net controls are in the standard toolbox under the Data section
Drag the SQLDataSource object on to your page.
In the configuration of the SQLDataSource click new connection.
On the Add Connection Dialog click Change to select a different data source. Choose the K2 Smartobjects data source and click OK.
Select your Server Name and Port and then click the ellipses next to selected SmartObjects.
This will bring up a browser that allows you to select the SmartObject(s) that you would like to use. Once you have made your selection click OK.
The next section asks you how you would like to retrieve the data. The SmartObject data source exposes the methods as stored procedures so select the stored procedures option and click next.
For each tab (Select, Update, Insert, and Delete) select the corresponding stored procedure from the drop down list. For select you can either use the get list method or the load method. In this example I want to retrieve all the records so I am selecting the get list method.
Once you finish the rest of the wizard you will now be able to use the other ADO.net controls, such as the Grid View, to view and manipulate the data coming from the SmartObject.
If you used the Get List option for the Select statement make sure to turn CancelSelectOnNullParameter to False in the properties for the data source otherwise you will not get any results back.
Here is an example page for viewing an announcements list from SharePoint in an ASP.net page using the ADO.net provider. I also added a details view that allows me to add items to the list as well.
If you would like to see this example and a SQL Reporting Services example in action please refer to the recording attached to this post.
Posted
Fri, Apr 17 2009 3:24 PM
by
k2eric