Team up with our RPA strategy and tech specialists for maximum automation impact

Find out more
Harness the power of UiPath in your business.

Save money and spend more time on priority work.

Book consultation

Let's choose, design and deploy a process automation solution for your business.

Find out more

Let's analyse your business to discover opportunities for innovation and automation.

Find out more

Begin your business transformation journey

Book consultation

Automate where it matters most. Scale to solve challenges in every area

Find out more

Equip people with user-friendly solutions that save time and make work easier

Find out more

Which business problem
can we solve first?

Book consultation
14 February 2016

How to register and use the Excel Control for K2 SmartForms

K2 Smartforms Export to Excel
In this article, we will learn about how to export the SmartObject data to an Excel spreadsheet using the K2 Excel custom control

The Excel control can be downloaded from here.

How to register the Excel Control

Before using the control, you need to register it to make it available in K2 SmartForm designer

K2 Automated Testing Software

BenchQA allows full test automation of K2, including fully automated K2 SmartForms and K2 Workflow testing. It promotes test driven development for K2 and ensures continued quality assurance for K2 solutions. Easily apply changes to test cases to accommodate changes to K2 apps and ensure all apps are regression tested to avoid defects and assure continuous quality.


Free K2 Five Upgrade Review

First, extract the folder and copy the Excel export DLL from bin folder

(DLL Location: 20130814 Excel Controls v1.01 for community20140305 ExcelExportv1.01 Working.zipExcelExportbinDebug)

  1. Manually copy ExcelExport.dll file to the following directories:
  • K2 Designer server: C:Program Files (x86)K2 blackpearlK2 SmartForms DesignerBin
  • K2 SmartForms Runtime server: C:Program Files (x86)K2 blackpearlK2 SmartForms RuntimeBin
  1. Register the control using controlutil.exe
  • The controlutil.exe can be found in C:Program Files (x86)K2 blackpearlBin
  • Syntax:

controlutil.exe register -assembly:”C:Program Files (x86)K2 blackpearlK2 SmartForms DesignerbinExcelExport.dll”


Deploy the ExcelFile SmartObject

From Project Folder, open the ExcelSmartObjects Solution and deploy the ExcelFile SmartObject.

This SmartObject is used to store the generated Excel file in K2 SmartBox SQL Server database

After registering the control, you should be able to see the Excel export control in the K2 SmartForm designer under Excel controls section

k2 smartforms export to excel - 1 - Excel Export Control

How to use the Excel control in K2 list view control

Drag the controls below onto a new K2 listview –

  1. Toolbar button
  2. File Attachment
  3. Excel control

k2 smartforms export to excel - 2 - Export to Excel Control - Design Time

Generating an Excel File

Under Toolbar button click event

Add an action called Execute a view control method

Select control as Excel export and it has only one method “Create Excel File”

Now, configure the Excel export control by passing the ADO query as input parameter on SmartObject data.

ADO Query

For Ex: SELECT Name,Country,Age,Email,Mobile FROM Employees Having Country=’United Kingdom’

The control will extract the data based on input query and stores the generated file into K2 SmartBox and returns the file ID as parameter.

Now, execute Excel file SmartObject load method by passing a file id as input value.  The SmartObject will subsequently return a file.  Ensure to map the return value to file attachment control in the view.

By clicking on the file attachment control, you can download the generated Excel file with extracted data from SmartForm listview

k2 smartforms export to excel - 3 - Export to Excel Control - Run Time

Need further technical advice or support?