Technical manual
Supported platforms and database systems
Microsoft SQL
During the first installation of the K2 system, the DRIVER parameter in the K2.ini file is set depending on the selected database, namely DRIVER=MSSQL for an MS SQL installation.
MSSQL – default driver set during a clean installation
For IS K2 to work correctly on any supported database system, a functional TCP/IP protocol with working address resolution is required, i.e. ping server_name must succeed from the workstation. There are two ways to achieve this:
• DHCP and DNS servers operate in the network, which assign and resolve IP addresses, respectively.
• If these servers are not in the network, the workstations must be configured with fixed IP addresses and the IP address of the server must be added to the HOSTS file.
If everything is set correctly, the command ping server_name must succeed.
A terminal connection can only be operated on the Windows platform (Windows Server 2016 and later). Appropriate licences for terminal services must be ensured.
IS K2 must be installed by a user who has sufficient rights on the server or workstation to write files and who must also have the right to use MS SQL according to the installation type. For an installation on a server, this should be an administrator. It is desirable that installations always take place from one machine or workstation, on which the installation records are saved in the Windows registry.
IS K2 requires a third-party database engine for its operation. This is MS SQL for the Windows platform, for Windows or Linux. The installation of MS SQL Server is described in the manuals of the manufacturers of these programs, which must be installed before IS K2. During the installation of MS SQL Server, the user who will install K2 or create new clients in the future must be set as the server administrator. MS SQL Server can be supplied on the installation medium at the customer's request. It is supplied complete and, depending on which licence the user has purchased, it can be installed with this licence or with the freely distributable Express Edition licence. The installation is performed using the K2Installer.exe program, which installs all K2 products and supporting applications. The help for K2Installer is in the k2installer.chm file, which describes all installations of K2 products, and is invoked by pressing F1 in the running K2Installer program.
Drivers for individual DB systems
During the first installation of the K2 system, the DRIVER parameter in the K2.ini file is set depending on the selected database, namely DRIVER=MSSQL for an MS SQL installation.
List of K2 drivers
MSSQL |
– default driver set during a clean installation |
Older driver names
All drivers using stored procedures have been cancelled. If the DRIVER value in K2.ini is other than MSSQL (MS2000, MS2000_P, MS2000GEN, MS2000GEN_P, OLEDB_MS2000, MS_SQLa) and it is a driver for MS SQL, it is internally replaced with this value.
Network protocols
For IS K2 to work correctly on any supported database system, a functional TCP/IP protocol with working address resolution is required, i.e. ping server_name must succeed from the workstation. There are two ways to achieve this:
- DHCP and DNS servers operate in the network, which assign and resolve IP addresses, respectively.
- If these servers are not in the network, the workstations must be configured with fixed IP addresses and the IP address of the server must be added to the HOSTS file.
If everything is set correctly, the command ping server_name must succeed.
Terminal connection
A terminal connection can only be operated on the Windows platform (Windows Server 2016 and later). Appropriate licences for terminal services must be ensured.
Installation of the K2 program
IS K2 must be installed by a user who has sufficient rights on the server or workstation to write files and who must also have the right to use MS SQL according to the installation type. For an installation on a server, this should be an administrator. It is desirable that installations always take place from one machine or workstation, on which the installation records are saved in the Windows registry.
Installation of database engines
IS K2 requires a third-party database engine for its operation. This is MS SQL for the Windows platform, for Windows or Linux. The installation of MS SQL Server is described in the manuals of the manufacturers of these programs, which must be installed before IS K2. During the installation of MS SQL Server, the user who will install K2 or create new clients in the future must be set as the server administrator. MS SQL Server can be supplied on the installation medium at the customer's request. It is supplied complete and, depending on which licence the user has purchased, it can be installed with this licence or with the freely distributable Express Edition licence. The installation is performed using the K2Installer.exe program, which installs all K2 products and supporting applications. The help for K2Installer is in the k2installer.chm file, which describes all installations of K2 products, and is invoked by pressing F1 in the running K2Installer program.
MSSQL settings
Database settings
To use OLAP, Microsoft SQL Server 2014 or later with the current service pack must be installed (the correct edition is either Personal edition for a local computer or Standard for a server; the Enterprise edition is unnecessary for standard K2 clients) with MS SQL authentication. Microsoft Analysis Services must also be installed in the same version as SQL Server.
Microsoft Excel or K2 can be used as the viewer.
In some cases, problems may occur when exporting views to Excel. More information can be found in the Expert discussion forum here: https://infoservis.k2.cz/ForumEdit.aspx?ThreadID=131108 https://infoservis.k2.cz/ForumEdit.aspx?ThreadID=131108.
Configuration for OLAP
To use OLAP, Microsoft SQL Server 2014 or later with the current service pack must be installed (the correct edition is either Personal edition for a local computer or Standard for a server; the Enterprise edition is unnecessary for standard K2 clients) with MS SQL authentication. Microsoft Analysis Services must also be installed in the same version as SQL Server.
Microsoft Excel or K2 can be used as the viewer. To use the K2 viewer, the OWC components must be installed (for editing, due to licensing reasons, also MS Excel).
In some cases, problems may occur when exporting views to Excel. More information can be found in the Expert discussion forum here: https://infoservis.k2.cz/ForumEdit.aspx?ThreadID=131108.
K2 installation
K2 is installed using the K2Installer tool, which is available on Infoservis in the Versions section.
Licence installation
The licence installation is described in the help for K2Installer.
Reinstallation of the K2 program
IS K2 must be reinstalled by a user who has sufficient rights on the server or workstation to write files and who must also have the right to use MS SQL according to the installation type. For an installation on a server, this should be an administrator. If you do not understand everything written in this chapter, DO NOT PERFORM THE REINSTALLATION! Before reinstalling to a higher version (first number) or release (second number), inform your consultant, who must check and, if necessary, adjust special reports and scripts. You must have these special items prepared in advance, otherwise it may happen that after the reinstallation they will not work or will not work quite correctly.
Obtaining a new version
Updated versions are available at www.k2.cz. To download a version from the web, you need to know the download password, which you will receive by e-mail. If the version is downloaded from the web as a *.zip file, the downloaded file must first be extracted into the K2 directory in this location.
Reinstallation conditions
A necessary condition for reinstallation is that no user may be working in IS K2. Files are physically overwritten in all directories and table structures may change. The list of logged-in users is in the licence management on the "Logged-in users" tab. Before reinstalling, all users must be logged out, which can be ensured either by a direct instruction to the users or by the log-out button after clicking the item in the logged-in users. This log-out does not log the user out immediately, but writes a flag for logging out the user, which K2 checks while running. The user disappears from the list only after the running K2 processes this request and logs out. The average time is around 2 min. Before logging out users, it is advisable to run the Reinstall manager and set a ban on logging in there. After that, only the user who set this flag will be able to log in, and they will have 6 seconds to do so. When K2 is ready for reinstallation, Reinstallation allowed must be set. This flag can be set only if only one user is logged in. The K2 installation checks whether the flag is set. Without it, K2 cannot be reinstalled. The Reinstall manager can also be used just to disable logging in to K2.
Back-up
Before each reinstallation, it is necessary to back up not only the data but also the entire IS K2 directory, in case of any unexpected event during the reinstallation. The backup is performed in two steps. First, we back up the K2 directory by copying it to a backup directory. Then we must back up the data.
Data backup
On database servers, the database names begin with the CATALOG value from K2.ini, e.g.: K2 – K2 configuration, K2_DEMO – demonstration data, K2_INIT - initialization data, K2_???? – data of other clients. In the DB server administration tool, we find the respective server and all databases beginning with the value from the CATALOG variable and back them up.
MS SQL backup
Database backup is described in chapter 11 MS SQL service procedures.
Reinstallation
The reinstallation itself is performed by running K2Installer.exe (see the chapter Obtaining a new version). During the reinstallation, the Initialization of versions of all clients is performed.
Reinstallation process
The K2 reinstallation itself takes place in several steps.
- Uninstalling the previous version. To ensure the correct operation of K2 including other tools, the original version of K2 is first uninstalled. During this action, only the previously installed files are removed. All files unknown to the installer remain on the disk, i.e. user files, special scripts and reports, files created during K2 operation, etc.
- Installing the new version. During this step, new files are copied from the installation package.
- Database conversion. If fundamental changes to table structures are required, SQL conversion queries are run using the K2_sqlrs tool. Typically, this happens when the K2 version or release changes.
- Initialization of versions phase 1. During this version initialization, minor database changes resulting from minor requirements are made.
- Licence import. If necessary and the correct licence file is selected, it is imported.
- Data Import. Data is imported into the DEMO and INIT clients, and system records are also imported into the configuration database and all clients.
- Initialization of versions phase 2. During this initialization, various adjustments of settings or data required by the operation of the system are made.
- Unblocking of logging in. If the flag "cancel reinstallation mode only by user" is not set in the Reinstall manager, logging in to K2 is unblocked. This flag can be used when we also need to install other products connected with the K2 installation.
Problems during reinstallation
Non-functional reports and scripts
After a reinstallation, it may happen that some special reports or scripts do not work. In most cases, this is caused by a database change and these special items must be adjusted.
Reinstallation ends with an error
It may happen that the reinstallation ends with an error. Errors can occur in two stages.
- When copying files. If the installer detects a problem during the installation of new files, it either does not copy the new files or reports an error and rolls back the changes. Rolling back the changes, however, consists in removing the newly copied files. But since the reinstallation takes place in two independent steps (see chap. 5.5), there will be almost no files in the target directory and the K2 installation record will disappear from the list in K2. After IS K2 has been removed, it is absolutely necessary to check the state of the k2.ini and sysk2.ini files so that their content is the same as before the reinstallation, or copy them from the backups k2.ini.old and sysk2.ini.old, which are created before new files are copied.
- During database conversion or data import. If these errors occur, it is advisable to call a consultant and seek advice. In these cases, it is always necessary to perform a complete restore of the backup of both the K2 directory and all databases. After that, a new installation of K2 is run, taking over K2 in the selected directory.
Creating a test installation of K2 for reinstallation
If we want to create a test installation of K2 to test the K2 reinstallation, it should take place in two steps:
- We install a new K2 and restore the live data into the test catalogs.
- We reinstall K2.
If we decide to perform the test reinstallation only on a copied K2, the result may not be the same as with the reinstallation of the live K2. For example, not all files that no longer make sense in the higher version are removed, and unnecessary bpl files may cause errors at startup.
K2 directories
Directory structure
The base directory contains:
- program files *.BPL, *.EXE, *.MSG, *.OCX, etc.
- parameter files *.INI
Under this directory, there is the CONF directory. It contains:
- the Lang directory with language note forms, bitmaps and help files
- *.BMP directories with bitmaps for running K2
- parameter files *.INI
- the ATTACH directory contains the user directories U*, in which information needed for notifications of new events is saved
In the base directory, there are company directories (for example DEMO). They contain:
- the DATA directory, to which the backup files generated by K2 (des, hes) are exported or from which they are imported
- user directories U* with user files, which contain:
- the RF_UZV.PAS file, the user registration script
- the K2SCRIPT.INI file, script editor configuration
- *.DSK files, configuration for the edited script (the file always has the same name as the script being edited)
- the CTEMPS.DCI file, contains templates for the Ctrl+J function in the script editor
- the HOMEBAN directory for homebanking input and output files (usually with the ARCH_HB subdirectory)
- parameter files *.INI
- the RF_FIRM.PAS file, the client registration script (it runs when logging in to the client)
- the ATTACH directory contains the user directories U* and several system directories (RECYCLED, MAILSRVR, PUBLIC, WORKER), in which the mail saves attachments. Not directly, however – the name of each attachment is converted using a hash function into a pair of directories nnn\nnn and the attachment is saved only in them.
- FORM_X directories, where X is the number of the language to which the form modifications relate. The directory contains files YYYYYYYY.FRM, where YYYYYYYY is the number of the modified form. It may also contain directories 0..N for the forms of individual user groups.
In the base directory, there is the DOC directory with descriptions.
In the base directory, there is the OLAP directory with the definition of standard OLAP views.
In the base directory, there is the SQL directory with *.sql scripts for generating tables (SQL version only).
In the base directory, there is the SERVISW directory for the K2 installation.
In the base directory, there is the SupportFiles directory, where the standard files needed to run standard reports are saved. Its subdirectories are the LangX directories, which correspond to the individual languages.
In the base directory, there is the SESTAVYW directory for the definition of scripts and reports. It contains:
- the SPECIAL directory, which contains:
- the BK2 directory contains packages
- the FORM directory contains script forms
- the K2R directory contains special scripts
- *.K2R directories contain scripts divided into groups by directory
- the STANDARD directory, which contains removed scripts and reports that could still be used but are no longer supported and mostly have their replacements
Files in the main K2 directory
as_developer.exe |
Script editor for creating scripts without UI that can run under ScriptEx or the application server. |
ed_app.exe |
|
execxmla.exe |
Program for creating OLAP cubes. |
fbclient.dll |
Firebird SQL Server client. |
icudt.dll |
|
isdsutils.dll |
Support for the data box. |
itextsharp.dll |
Support for signing PDFs. |
k2.exe |
The K2 program. |
k2.ini |
Parameters with which K2 is run. |
k2_sqlrs.exe |
Runs SQL scripts for creating tables and stored procedures. |
k2activexLib.dll |
ActiveX library for using K2 in programs supporting OLE Automation Server (e.g. Excel). |
k2base.bpl |
Basic K2 library (contains only Delphi libraries and one Dialog.RES for scripts), used by K2.exe and other programs |
k2biutils.dll |
Support for execxmla.exe. |
k2core.bpl |
K2 core library, used by K2.exe and other programs. |
k2dms.bpl |
K2 data module library, used by K2.exe and other programs. |
k2forms.bpl |
Library of basic K2 forms, used by K2.exe. |
k2isapi.dll |
Extension of Internet Information Server for access to K2 using the ScriptEx.exe program; used in e-shops. |
k2mailcfg.cpl |
Configuration of the K2Mail.exe mail service. |
k2p_odbc.bpl |
K2 extension module (plugin) for working with ODBC components. |
k2p_pcs.bpl |
K2 extension module (plugin) for working with identification cards; optional, but the card system does not work without this file |
K2p_rbutt.bpl |
K2 extension module (plugin) for working with buttons. |
K2p_zeos.bpl |
K2 extension module (plugin) for working with the ZEOS library. |
k2rep.bpl |
K2 library for working with reports and scripts, used by K2.exe. |
k2signutils.dll |
Extension needed for digital signing of documents. |
k2wexport.exe |
External application for exporting data from K2 to des/hes files. |
k2wimport.exe |
External application for importing data into K2 from des/hes files. |
libcef.dll |
|
libeay32.dll |
|
Microsoft.AnalysisServices.dll |
Support for OLAP. |
Microsoft.AnalysisServices. |
Support for OLAP. |
pdfcp2.dll |
Component for creating PDF files, used in K2 reports (PDF export for AM - K2). The file is copied to the system directory and registers the component 'PDFCreatorPilot2.piPDFDocument' in the system. K2 can do without this file; only the PDF export will not be offered as a valid export format for AM reports. |
pdfcp4.dll |
Component for creating PDF files, used in K2 reports (PDF export for AM - K2). The file is copied to the system directory and registers the component 'PDFCreatorPilot.piPDFDocument4' in the system. K2 can do without this file; only the PDF export will not be offered as a valid export format for AM reports. |
pdfregistertool.exe |
Auxiliary application for registering pdfcp?.dll to allow the creation of PDF files. |
scriptex.exe |
Launcher of non-visual K2 scripts. |
security.cryptography.dll |
Supporting extension for |
setk2password.exe |
Program for setting the password of a K2 user. |
setup.log |
Installer log of the commands performed. |
ssleay32.dll |
|
sysK2.ini |
Storage of system information of the K2 program. |
tbarcode10.dll |
Extension with barcodes. |
Rights in the file system
K2 service user (administrator):
<K2 main directory> - folder, subfolders, files – full control
Regular K2 user:
<K2 main directory> - folder, subfolders, files – read, list
<K2 main directory>\CONF\ATTACH - folder, subfolders, files - write, create folders, delete
<K2 main directory>\OLAP - files - write
<K2 main directory>\<client> - folder, subfolders, files - write, create folders, delete
<K2 main directory>\<client>\TABLEMOD.XML – disable inheritance, keep read
<K2 main directory>\<client>\EXTFIELDS.XML – disable inheritance, keep read
<K2 main directory>\<client>\RF_FIRM.PAS – disable inheritance, keep read
<K2 main directory>\<client>\FORM* – disable inheritance, keep read
<K2 main directory>\SupportFiles - read and execute
After a new client is created, the file rights in its folder must be updated according to the rules above.
List of all K2.ini parameters
K2 parameters
Parameter name |
Description |
ACCCURRENCYALLOWED |
Note: Cancelled from 2026.01. The value 1 allows creating document items with different foreign currencies in the accounting journal (only for the General document type). If it is not specified, an attempt to enter accounting document items with multiple currencies displays the standard message "There are different foreign currencies on the accounting document items". |
ADDHEADERTOEXCELEXPORT |
Adds a header with the names of the columns exported to Excel. The parameter value is set to 1 by default. The header is not printed if the parameter value equals 0. |
ARCHITECTURE |
Specifies the setting for running IS K2 in the required architecture. The value is x86 (IS K2 32-bit) or x64 (default setting, IS K2 64-bit). |
ALARMDELAYTIME |
Specifies the time in seconds after which the list of events is reloaded. |
AMSINGLEPREVIEW |
1 - reports are displayed separately in individual windows |
AMCLEARTYPE |
Specifies the quality of the font used. 0 - Default, used in previous versions of K2. If you need to use the font quality as before, put this value in the ini. 1 .. 6 The default value of the parameter, if it is not used, is 6 - that is fqClearTypeNatural, and this rendering quality gives results closer to the display in PDF and Word. The numbers are mapped to the System.UITypes.TFontQuality type. |
BEZZMEN |
see NOLOGCHANGES |
BITMAP |
Path to the bitmaps under CONF. |
CATALOG |
Name of the main catalog for the installation on the server. |
CHECKAMFILE |
If the AM file changes its date or time, the cache is refreshed when the report is run.
|
CHECKPARAMSINFORMATIONEXECUTE |
Parameter that determines whether or not reports are to be run and, if applicable, reports inconsistencies in parameters. 0 - default state, AM/PAS is run as before 1 - the existence of the parameter in the AM/PAS is checked at run time. If the parameter is not in the AM/PAS, it is not run and an error is reported. |
CHECKUNITS |
Check of changes of script files, i.e. if a script file changes, this change is ignored until the cache is emptied or K2 is restarted. 0 - check switched off (default) 1 - check switched on |
CHROMIUMENABLED |
0 - switches off the Chromium component, as a result of which the calendar component and the web content editor will not be available in K2. |
CLIENT |
company name for the user for logging in |
CLIENTS |
list of companies separated by semicolons that will be offered in the combo box of the login window - the default value is DEMO |
COLOR |
Allows changing the colours of the K2 palette to the given values. A semicolon separates the palette indexes; the ">" character is written between the palette index and its value. The value can be entered numerically ($0000FF) or by name (clLime). List of usable indexes: baT_Back book background baT_Text book text baT_Capt_Back book header background baT_Capt_Text book header text baT_Sele_Back background of the selected book record, current column baT_Sele_Text text of the selected book record, current column baT_ISel_Back background of an inactive selected book record baT_ISel_Text text of an inactive selected book record baP_Back view background baP_Text view text baP_Capt_Back view header background baP_Capt_Text view header text baP_Sele_Back background of the selected view record baP_Sele_Text text of the selected view record baP_ISel_Back background of an inactive selected view record baP_ISel_Text text of an inactive selected view record baZ_Back change background baZ_Text change text baZ_Capt_Back change header background baZ_Capt_Text change header text baZ_Sele_Back background of the selected change record baZ_Sele_Text text of the selected change record baZ_ISel_Back background of an inactive selected change record baZ_ISel_Text text of an inactive selected change record baE_Back edit background baE_BackDi background of a disabled edit baE_Text edit text baE_TextZm edit text for a changed field baS_Text status bar text colour baT_Capt_Ed mark for an editable book column baT_Capt_Def mark for a default editable book column baP_Capt_Ed mark for an editable view column baP_Capt_Def mark for a default editable view column baZ_Capt_Ed mark for an editable change column baZ_Capt_Def mark for a default editable change column baT_Back2 book background 2 baP_Back2 view background colour 2 baZ_Back2 change background 2 baT_Sele_Back2 background of the selected book record outside the current column baT_Sele_Text2 text of the selected book record outside the current column baT_Head_Back group header background baT_Head_Text group header text baT_Foot_Back group footer background baT_Foot_Text group header text baStromMenu tree menu background baButtonky button background baDefault default colour baU_1 user colour baU_2 user colour baU_3 user colour baU_4 user colour baU_5 user colour baU_6 user colour baU_7 user colour baU_8 user colour baU_9 user colour baU_10 user colour baU_11 user colour baU_12 user colour baU_13 user colour baU_14 user colour baU_15 user colour baU_16 user colour baU_17 user colour baU_18 user colour baU_19 user colour baU_20 user colour baU_21 user colour baU_22 user colour baU_23 user colour baU_24 user colour baU_25 user colour baU_26 user colour baU_27 user colour baU_28 user colour baU_29 user colour baU_30 user colour baU_31 user colour baU_32 user colour baU_33 user colour baU_34 user colour baU_35 user colour baU_36 user colour baU_37 user colour baU_38 user colour baU_39 user colour |
COMPANYCURRENCY |
If we have Own companies defined in different currencies, the COMPANYCURRENCY parameter must be set to 1. The currency of the own company is then not taken from the Client parameters but from the settings of each own company. By default, the parameter is set to 1. |
COMPANYMENUITEMS |
The number of menu items for switching multi company can be set. The value 1 displays all companies, 0 no company, and positive numbers mean the number of items in the menu. |
COMPILEFORAS |
Affects the default compilation setting in the Script editor, specifically the "Compile for K2_AS" option in the Project menu. 0 (default value): the "Compile for K2_AS" option is switched off after the script editor is opened 1: the "Compile for K2_AS" option is switched on after the script editor is opened |
DISABLECOMMANDCACHE |
For better profiling on the MS2000Gen and MS2000Gen_P drivers in the standard MS SQL Server Profiler, the SQL command cache can be switched off using the K2 parameter "DISABLECOMMANDCACHE=1". Switching off the cache results in slower query processing. |
DISABLELAYOUTMENU |
DISABLELAYOUTMENU=1 hides the layout menu Settings \ Desktops - desktops can be neither switched nor manipulated. |
DISABLEMAINTABS |
DISABLEMAINTABS=1 generally switches off docking of forms and reports into tabs. |
DISABLEMEMPAR |
Running K2 on a company database that is in read-only mode. A typical use is a snapshot. K2 starts and allows reading records. Any attempt to write ends with a database error. It can be used as a reporting K2. The Conf database must still allow writing. DISABLEMEMPAR=1 |
DISABLESEMIPERMANENT |
DISABLESEMIPERMANENT=1 disables loading pinned tabs into the desktop. The user loses them and the tabs will no longer be pinned next time. |
DISABLEUIMENU |
DISABLEUIMENU=1 hides the menu Settings \ Interface settings - it is not possible to switch visual styles, the display size or set the preferences of universal forms. |
DISABLEVCXMENU |
DISABLEVCXMENU=1 hides the menu Settings \ Interface settings \ Visual styles - visual styles cannot be switched. |
DIVIDECONTAINERBUTTON |
DIVIDECONTAINERBUTTON=1 displays a "split" Container button in the grid with access to container actions. |
DLVPUSERAPPLY |
The parameter setting affects the use of the filter and sorting when working with saved views and column masks. The DLVPUSERAPPLY parameter determines the behaviour of the application when a saved view or column mask is selected from the ribbon or when a module is run using a shortcut with a saved view. The DLVPUSERAPPLY parameter therefore applies when the user:
In such a case, it is assumed that the user wants to use the saved filter, sorting and other view settings.
Parameter values: 0 - the filter/sorting is applied ALWAYS ... the "old" behaviour (before the parameter was introduced) and the default value 1 - the filter/sorting is NEVER applied 2 - the filter/sorting from the view/column mask will be run:
3 - the system always asks whether the filter/sorting should also be applied Recommended value: DLVPUSERAPPLY=2 |
DLVPAUTOAPPLY |
The parameter setting affects the use of the filter and sorting from saved views and column masks. The parameter applies in situations where the user does not deliberately select a saved view or column mask. In these cases, automatic use of a saved filter or sorting could affect the expected behaviour of the module. The DLVPAUTOAPPLY parameter determines the behaviour of the application when:
If the saved filter or sorting is not used, the information "Sorting/filtering not applied". is displayed in the Views or Column masks menu.
Parameter values: 0 - the filter/sorting is applied ALWAYS ... the "old" behaviour (before the parameter was introduced) and the default value 1 - the filter/sorting is NEVER applied 2 - the filter/sorting from the view/column mask will be run:
3 - the system always asks whether the filter/sorting should also be applied Recommended value: DLVPAUTOAPPLY=1 |
DMCATALOG |
Name of the catalog for OLAP evaluation. If it is not specified, the value from the CATALOG parameter is used. K2 adds the client name and the suffix _DM to the value. |
DMDATABASE |
Name of the database for OLAP evaluation. If it is not specified, the value from the DMCATALOG parameter is used. DMDATABASE must contain the full name of the database. |
DMSERVER |
Name of the server where the OLAP engine is located. If it is not specified, the SERVER value is used. |
DOCKMEMLIMIT |
Memory allocation limit in MB; once it is exceeded, reports and books are not docked into tabs. After the limit is exceeded, books are run modally, so it is not possible to run more of them and increase memory consumption. Note: A forced run in a tab (right mouse button on the shortcut and the "Run in new tab" option) does not take this limit into account. |
DRIVER |
database driver supported by K2, see chap. 2.4. |
FILTERBYUF |
The parameter is set with the default value 1 - the blue UI for filters is switched on by default. |
FIRMA |
see CLIENT |
FUNC |
number of the function to run (by default, actions are run in the foreground) |
FUNCINTPARAM |
Integer parameter passed to the FUNC function. |
FUNCSTRPARAM |
String parameter passed to the FUNC function. |
FUNKCE |
see FUNC |
GLMAXRECORDS |
Increases the number of accounting records displayed in the General ledger in the Movements part. The maximum is set to 50,000 records by default. |
HESLO |
see PASSWORD |
HEADERTOCSVEXPORT |
if the parameter equals 1, a header with column names is added to the exported CSV. |
FORMDESTROYSLEEP |
Waiting when closing a form due to synchronization of window states between the server and the client. Testing showed values between 80 and 200 to be suitable. It is used for correct display of dialogs on a terminal – so that they do not overlap. |
HIDDENDIALOGS |
Detection of a change in the Z-order of dialogs and its subsequent correction (swap). K2 performs the detection every second; if it detects a swap, it corrects the Z-order. It is used for correct display of dialogs – so that they do not overlap. 0 - check switched off (default) 1- check switched on 2- check switched on, different detection, better results |
ISINMAINTHREAD |
When set to 1, it causes the Infoservis data to be loaded from the web service in the main thread and eliminates crashes due to access violation in the Microsoft DLL. This concerns mainly running K2 on servers. |
JMENO |
see NAME |
LABS_DISABLEPREVIEWBYLIBREOFFICE |
If the parameter has the value =1, document previews will not be created via LibreOffice. We recommend setting the parameter if LibreOffice is installed on the AS and the process is overloaded. |
LABS_OPTIMALIZATION_NOTPOSTEDDOC |
If the parameter has the value =1, data loading in the Not posted book is optimized. Suitable for companies with a large amount of data. |
LABS_OPTIMALIZATION_OPENITEMLIST |
If the parameter has the value =1, data loading in the Open items book is optimized. Suitable for companies with a large amount of data. |
LABS_QFILTERRECORDPERMISSION |
If the parameter has the value = 1, the "Check the record access group" option is set to True when the column filter is run (xFilter.recordPermission := True). The user will thus no longer see records in the filter to which they have no right. The setting applies only when the column filter is run from the Book state. When a column filter condition is entered in the Filter state, the setting of the "Check the record access group" option remains as it was set when the previous filter was run. |
LABS_QRVATTAXES |
Parameter that allows filling the elements for VAT rates in QR Invoice if K2 uses an abbreviation other than ZS for the standard rate, other than SS for the reduced rate and other than SS 10 for the second reduced rate. The parameter has the format X;Y;Z, where X is the abbreviation used for the standard rate, Y is the abbreviation used for the reduced rate and Z is the abbreviation used for the second reduced rate. Example of use: LABS_QRVATTAXES = ZS21;SS12; or LABS_QRVATTAXES=21;12; |
LABS_SIMPLELOOKUPLOCATOR |
Allows switching the sorting (Alt+Z) or activating search (Ctrl+Shift+F) in simple lookups. If the parameter has the value = 1, it will be possible to switch the sorting (Alt+Z) and switch on search (Ctrl+Shift+F) in lookups. If the parameter has the value = 2, it will be possible to switch the sorting (Alt+Z) and switch on search (Ctrl+Shift+F) in lookups; in addition, when search is active, compact information about the filter is displayed. |
LAYOUT |
Parameter that can be used to force the use of a specific desktop. When the parameter LAYOUT=desktop name is set, K2 starts with this desktop. The parameter value LAYOUT=emergency ensures that K2 starts with a simple emergency desktop. If, for some reason, the desktop does not load for a user, they log in with the emergency parameter. They then select the required desktop in K2, and the next time they log in, they will log in with it. |
LNGRESOURCEPATH |
It is used in the case of incorrect loading of BPL, DLL, LNG and EXE files in a network environment, typically terminal servers. Language bitmaps, help files and notes are also loaded. If the K2 binary files are copied to the local disk of the terminal server, e.g. to C:\ISK2, then CONF must also be copied and the parameter "LNGRESOURCEPATH=C:\ISK2\CONF" must be used. It ensures that the K2.LNG resources are loaded from a local source. |
LOG |
The LOG parameter is used to specify the path and name of the file to which the application will write log information. For correct operation, the LOGLEVEL parameter, which defines the level of logging detail, must also be used. If the directory specified in the LOG parameter does not exist, the system creates it automatically at startup. Example: LOG=C:\K2\Logs\K2.Log
The current date of the application start can be inserted into the log file name using the {Date} placeholder. Example: LOG=C:\K2\Logs\{Date}-K2.Log Resulting files:
When an application thread ends, a check is made whether anything has been written to the log. If something has been written and at the same time the thread has not performed a user login operation, the file name is extended with the thread identifier (TID) placed before the file extension. Resulting file: 2025-07-10-K2.TID1234.Log |
LOGAPPEND |
|
LOGENABLEDTILL |
The value is the date until which K2 logging is performed. After this date, logging is not performed. |
LOGINLANGNO |
language of the login window (0, 1, parameter not specified – English, 2 – German, 3 – Slovak, 5 – Czech) |
LOGLEVEL |
Specifies the level of logging of operations. See LOGLEVEL parameter. |
LOGMAXFILESIZE |
The maximum size of the log file in MB can be specified. An integer is expected. |
LOGMEMUSED |
Specifies the interval in milliseconds for refreshing the value of the used memory in the statistics intended for recording the load using eK2g. With frequent logging, the memory value is not calculated for each query but only once per the specified interval, which significantly reduces the monitoring overhead. Examples: LOGMEMUSED=10000 refreshes the value once every 10 s LOGMEMUSED=0 switches off the cache and calculates the memory for each logged block |
LOGOPDURATION |
E.g. LOGOPDURATION=5000 logs all database operations taking longer than 5 s. |
LOGUSER |
|
LOWERLIMITFORDATA |
Allows suppressing the display of documents from historical periods. We enter the number of the period from which documents are to be displayed. The condition on the period is automatically added to the filtering as a system condition. Example: 119. K2 will display documents issued in the period 2019 and later. During filtering, the system condition "Business year =>2019" is added. Using the "SUPRESSLOWERLIMITFORDATA" parameter, we can further specify for which data modules the period restriction is not to apply. |
MAIN |
main K2 directory, e.g. X:\K2 |
MAINONTASKBAR |
Switches off the Application.MainFormOnTaskBar option. It causes problems with displaying hints in K2 as a published application. If MAINONTASKBAR=0 is specified, the option is switched off. The difference can be seen in the application title, which shows only the logged-in user. 0 - switched off 1 - switched on (default) |
MANDANT |
name of the client for the user for redirection, older parameter FIRMA |
MEMORYPROFILER |
Switches on memory profiling in scripts.
|
NAME |
name of the user who is logging in |
NOLOGCHANGES |
Switches off writing to the ZMĚNY (changes) file, used e.g. as NOLOGCHANGES=1 (anything). |
NOLOGINMSG |
Switches off the display of messages when logging in if there is:
|
NOTRANWND |
Display of the transaction window 0 - switched on 1 - switched off |
OBR |
see PICTURES |
OWNCOMPANY |
Setting of the own company on the AS. OWNCOMPANY=OwnCompanyNumber |
PASSWORD |
password for automatic login |
PICTURES |
specifies the display of pictures in K2; the values can be combined 0 – does not display pictures in the login window 1 – displays them (default state) 4 – reduced login window for readers |
PREFERREDCELLAPP |
Preferred access to spreadsheet files. It takes the values:
If the parameter is not set, K2 accesses Excel files using LIBXL_XML. Access to OpenOffice or LibreOffice remains unchanged. If the file is to be created using a script of the TCellData class, we recommend not specifying the extension in the file name. Saving the file adds it automatically according to the required provider. When loading a file, the spreadsheet processor is also selected according to the extension. |
PREFERREDPDFLIB |
allows selecting the DLL version for export to PDF
|
PREFERREDUNIFORMUI |
allows setting Universal forms for all K2 users at once 0 - K2 prefers Universal forms according to the setting in the user parameters 1 - K2 forcibly prefers Universal forms |
PDFCOMPRESS |
switching production of compressed (smaller) PDF on/off 0 - switched off 1 - switched on (default) |
PDFIMAGEBYREF |
export of pictures to PDF as references - multiple identical pictures will be stored only once in the resulting PDF => smaller PDF 0 - switched off 1 - switched on (default) |
PRODUCEPDFA |
the exported PDF complies with the PDF/A standard. The parameter is valid only for PDFcp4.DLL, see the PREFERREDPDFLIB parameter 0 - switched off (default) 1 - switched on - i.e. PDF/A - |
PRINTERSENUM |
Method of detecting the existence of printers vcl - according to Borland (default) level2 - according to Microsoft (will become the default after testing) |
PTLEV1 |
number of repetitions of individual operations for parallel transactions (isolation level 1) – currently not used (10 by default) |
PTLEV2 |
number of repetitions of entire transactions for parallel transactions (isolation level 2) (10 by default) |
PTWAIT |
number of milliseconds to wait between individual attempts for parallel transactions (100 by default) |
REFRESHPRINTERS |
Causes the list of printers to be refreshed whenever the system tries to find a printer by a string or when the PrintDialog is displayed. switched off (default) switched on |
REGOFF |
setting of the default value of the RDSEnable and RFSEnable script variables 1 - sets the default value of the RDSEnable and RFSEnable variables to False (preserving the state before version 127.92) if the parameter is not specified, the default value is set to True, unless it is a registered script |
REPARCHIVEPATH |
Path to archived reports in the format FILE:K2FIRM:REPARCHIVE\ or FILE:C:\TEMP. |
REQUIREDMODULES |
Specifies a list of mandatory modules separated by semicolons, e.g.: REQUIREDMODULES=k2p_zeos.bpl;k2p_firma.bpl
|
RSOFF |
setting RSOFF=anything switches off the registration of registered functions; used mainly in the case of an error in the registration script |
SCRIPT |
name of the script when run by ScriptEx. |
SCRIPTEXRDSON |
Switching on data registered functions under ScriptEx. By default, ScriptEx has support for registered functions switched off; it can be switched on by adding the parameter SCRIPTEXRDSON=1. |
SCRIPTRSDEBUG |
Switching it on causes gauges to run in a mode without creating a thread. |
SCRIPTTIMEOUT |
maximum duration in seconds for which a script run by ScriptEx is to run |
SERVER |
name of the server (with MS SQL 2000 installed) with the database for the MS_SQL driver or for OLAP; for the ADOPSQLEXT driver, this parameter can be used as the server name similarly to MS SQL |
SESSIONMES |
'NO' does not display a message on multiple login |
SESSIONNO |
number for ensuring that K2 starts under a forced session number (0…999) |
SUPRESSLOWERLIMITFORDATA |
Parameter following up on the "LOWERLIMITFORDATA" parameter. With this parameter, we specify for which data modules the period restriction condition defined in the "LOWERLIMITFORDATA" parameter is not to apply. We enter the number of the data module.
|
SYMBOLTABLEFIX |
value 0 - script compilation mechanism from version 137 |
TESTFRONTY |
interval between individual readings of the transaction queue – serial transactions (by default, the transaction queue is read at intervals of 100 ms); shortening the interval can improve transaction throughput on powerful servers and networks where a large number of short transactions is processed |
TIMESERVER |
Used to set the server for time synchronization so that all K2 instances have the same time and do not take it from the local PC time. |
TIMESERVERB1 |
Backup TIMESERVER 1. |
TIMESERVERB2 |
Backup TIMESERVER 2. |
TRANSABUNDLE |
max. number of records that can be included in one transaction – so far used only for deleting transfer logs (5000 by default) |
USEBADDATEFORMAT |
value 1 - restores the original date format 'DD.MM.YYYY' for classic forms Note: The parameter is available from K2 version mia.04 and is intended only for K2 version mia. |
USEDLANGS |
The default list of languages in K2 is limited to the most common languages. If this list needs to be extended with another language or languages, or conversely restricted, all languages that are to be available must be listed in this parameter. The parameter defines the list of languages both for setting the user's working environment (i.e. the list of languages in the User parameters) and the list of languages for data translations (article translations, texts of language supplements, etc.). We enter the language numbers separated by semicolons into the parameter. A table with an overview of languages can be found in the chapter Language localizations. The LANGUAGES parameter, which is entered in the SysK2.ini file, has a different meaning. It defines only the list of languages for setting the user's working environment (i.e. the list of languages in the User parameters), and the list must be a subset of the default languages used in the program or of the languages listed in the "USEDLANGS" parameter.
|
USEWHEELFORSCROLLING |
In the new UI, allows scrolling with the mouse wheel over a component of the Scroll type. Note: Default value of the parameter Version 2025 ...USEWHEELFORSCROLLING=0 (switched off) Version 2026 ...USEWHEELFORSCROLLING=1 (switched on) |
WEEKNUMBERS |
Displays the week number in calendars. Possible numbering problems are described here. |
FORMPOSITIONCORRECTION |
If the parameter is set, the system checks the position of the window on the screen at startup. If it detects a position outside the screen, it centres the window. By default, this function is switched off; it can be switched on by setting the parameter to FORMPOSITIONCORRECTION=1. |
DRILLTHROUGHROWLIMIT |
Limit of records returned by the Show detail function in a pivot table. Without the parameter, a maximum of 1000 records is returned. |
DSOTABULARSERVER |
Name of the server with the analytical database in tabular mode for analytical evaluation of data using Analytical models (new BI solution). |
DSOTABULARDATABASE |
Name of the database on the server with the analytical database in tabular mode for analytical evaluation of data using Analytical models (new BI solution). |
RELOADGROUPFRAGMENTS |
1 - switches on reloading of fragments for the group after a company change |
MSEXCELADDRESSING |
The parameter is relevant if the MsExcel library is used for export to Excel. 0 - the native MsExcel function is used to calculate the position of cells 1 (default value) - custom K2 code is used to calculate the position of cells |
Entering parameters for a local K2 installation
For a local K2 installation, K2 parameters can be loaded from the local file K2local.ini. The parameters must be written in the [K2] section.
Priority of parameters when running k2.exe as a local installation:
- Command line
- k2local.ini
- k2.ini in the main K2 folder
Recommendation: Use only one parameter name throughout K2. E.g. FIRMA is the same as MAND.
AS parameters
Parameter name |
Description |
AS3LOGLEVEL |
The parameter allows setting the level of detail of K2_AS logging. 0 - logging of errors only 1 - logging of errors and warnings 2 - logging of information, warnings and errors 3 - logging of extended information, information, warnings and errors 4 - logging of debug information and everything from level 3 5 - K2_AS logging switched off (only standard K2 events are logged) The default value is 3. |
ASCPUALERT |
Sets the CPU load threshold. |
ASMEMALERT |
Sets the RAM threshold. It is entered in MB. E.g. ASMEMALERT=400 means that the alert is triggered when 400 MB is reached. |
AS3SERVERPIPE |
Name of the communication pipe between the clients and K2_AS. |
AS3ASYNCPIPE |
The parameter is used to set asynchronous communication using communication pipes on K2_AS. It improves the behaviour of K2_AS in the case of faulty client communication. It is used primarily for the web client. 0 – switched off 1 - switched on |
AS3USERS |
Number of users for anonymous queries from the K2 API. |
AS3USER |
Prefix of users for anonymous queries from the K2 API. They are numbered from 1. |
AS3PASSWORD |
Password of users for anonymous queries from the K2 API. |
AS3IO |
Internet shop number in K2 against which users will be verified (the Web, e-shop tab in contact persons). |
AS3CONTACTPERSON |
Number of the default contact person for a user of the e-shop who is not logged in. |
AS3AFFINITYMASK |
The parameter sets the affinity between the K2_AS process and the system CPU. |
AS3MEMORYPROFILER |
Command line parameter; switches on the K2_AS memory profiler. |
AS3TRYTORESTARTAFTER |
Parameter that sets the time in hours after which K2_AS attempts a so-called "preventive" restart. This is to release incorrectly allocated memory. After the specified time has elapsed, K2_AS starts monitoring the established connections, both real and anonymous. If there is no active connection, a restart is performed. This parameter is functional only if the scheduler service is not switched on on K2_AS. |
DIVIDECONTAINERBUTTON |
The parameter is used to display the split Container button in the grid with access to container actions in the web K2. To display it, its value is set to 1. |
DISABLEDEFAULTCELLCLICK |
Allows disabling default click-throughs in a table. When the parameter is set to 1, click-through using Ctrl + mouse click will not work in the table. This significantly increases the speed of the web K2. If a click-through in the table is set explicitly, this click-through will work even when this parameter is used. |
LIMITMEMORYTO |
Used to set the memory size of applications so that the memory of the computer on which the AS runs is not overloaded. The memory size is given in MB. 32-bit applications are technologically limited to a maximum size of 4 GB per application, which computers can usually handle. Its use is therefore expected mainly with the 64-bit AS, where the maximum size is limited to 8 TB per application, which means that the AS is able to exhaust all free memory. |
INTERNALNETWORK |
This parameter marks the application server for internal use. |
NCLDURATIONTOLOG |
Sets the time in ms above which messages are logged during communication of the web client with the application server. By default, this parameter is set to 750 ms. |
SCRIPTFUNCDURATION |
Allows logging script functions whose run takes longer than the time specified in the parameter. The time is given in milliseconds. |
UNCOVERDOCTYPES |
When the parameter is set to 1, the Apply original menu for document types is displayed in the web K2. By default, the parameter is set to 0. |
RELOADGROUPFRAGMENTS |
1 - switches on reloading of fragments for the group after a company change |
Parameters that have no meaning in the ini file
INIFILENAME |
Alternate name for k2.ini. E.g. when K2 is run as follows: k2.exe INIFILENAME=moje.ini, the file moje.ini located in the directory of k2.exe (or in the directory specified by the MAIN parameter, also on the command line) is used instead of the k2.ini file |
LOGLEVEL parameter
The LOGLEVEL parameter is a number given by the sum of individual bit values, each of which represents a different log level.
The individual bit values therefore mean:
Hex |
Dec |
Description |
0001 |
1 |
basic log |
0004 |
4 |
logging of database operations |
0008 |
8 |
load logging |
0010 |
16 |
transaction identification |
0020 |
32 |
rejected logins |
0040 |
64 |
run scripts excluding registered ones |
0080 |
128 |
logging of monitoring activity |
0100 |
254 |
logging of K2 termination due to inactivity |
0200 |
512 |
run AM reports |
0800 |
2048 |
logging of exceptions on which K2 or a script terminates. |
1000 |
4096 |
run registered scripts |
2000 |
8192 |
logging of all exceptions created |
4000 |
16384 |
logging of external K2 utilities |
1 Basic logging – information about opened files is written; this logging has no adverse effect on performance
8 Load logging – generates output for the eK2g utility (related to the LOGPBS parameter).
16 Transaction identification – information about the transactions performed is written to the log; a record of the start of a transaction with the given name and time and a record of the end of the transaction at the given time and with the given number of operations are always made. It is used for monitoring K2 operation on parallel transactions. It is possible to evaluate the system throughput and the numbers and durations of transactions, to trace transactions demanding in terms of the number of operations and time, and to trace the dependencies between transactions (serialization); it is used to detect bottlenecks when working in K2. This logging has no adverse effect on performance
32 Rejected logins – writes rejected logins, the time and the reason
64 Run scripts – writes records of the start and end of a script run; used to determine the time and memory demands of K2 scripts.
512 Run AM reports – writes records of the start, end of formatting and end of the AM report.
2048 Monitoring of exceptions on which K2 or a script terminates.
4096 Run registered scripts – writes records of the start, end of formatting and end of the AM report. Writes records of the start and end of a script run; used to determine the time and memory demands of K2 scripts. This logging may have an adverse effect on performance if registered scripts are used extensively.
8192 Monitoring of all exceptions created by K2 or a script.
Instead of the sum of the individual numbers, a text identifier of the logging level can be written:
- normal - basic log (1) + transaction identification (16) + run scripts (64) + reports (512) + registered scripts (4096) = 4689
- exceptions - normal + logging of exceptions (2048) + logging of all exceptions (8192) = 14929
- debug - exceptions + logging of database operations (2+4) + everything needed for debugging without eK2g... = 32759
- ek2g - load logging (8) = 8
For example: LOGLEVEL=normal
For debugging crashes, LOGLEVEL=exceptions is best.
LOGLEVEL numbers higher than 32767 are reserved for special purposes.
Logging of exceptions
If the goal is to monitor exceptions only in scripts, the standard K2 distribution is sufficient. If the goal is to monitor exceptions outside scripts (K2 standard), the so-called debug version of K2 (an EXE of about 70MB) must be run; it is not part of the distribution and is distributed here. Logging is switched on in the LOGLEVEL parameter, which is described in the chapter LOGLEVEL parameter.
Functions using parameters
Number |
Name |
FuncIntParam |
FuncStrParam |
712 |
Compilation test of file scripts |
|
Directory in which the compilation is to be run |
AS developer
AS_Developer.exe is an application built on the application server core that contains the script and report editor, so that scripts and reports intended to be run on the application server can be debugged and developed. It can also be used for a non-visual compilability test of scripts, or for running scripts in non-visual mode if the Task scheduler is not available in K2.
AS_Developer.exe must always be run with the MAIN parameter: as_developer.exe MAIN=path to the main K2 folder. Other parameters can also be used, e.g. SERVER, CATALOG, NAME, PASSWORD, FUNC, SCRIPT.
Examples of running:
- For developing a script or report: as_developer.exe MAIN=path to the main K2 folder.
- For running a non-visual script: as_developer.exe MAIN=path to the main K2 folder FUNC=661 SCRIPT=MujSkript.pas
After AS developer starts, a window for entering the name and password is displayed, in which we fill in the same data as for logging in to K2.

Picture: Logging in to AS Developer
After logging in, another window appears with buttons that run the script or report editor.

Picture: Form of the AS Developer application
Other K2 parameters can also be used if AS developer uses them, e.g. logging. The parameters in the following table are only for AS developer.
Parameter name |
Description |
TESTCOMPILE |
List of scripts or reports from the database, separated by semicolons, on which the compilability test is to be run. If an error occurs during compilation, *.ERR files with a description of the error are created in the SESTAVYW directory. |
SysK2.ini parameters
Parameter name |
Description |
VERSION |
K2 version |
RELEASE |
K2 release |
BUILD |
K2 build |
DATABASE |
database on which K2 runs |
TYPE |
installation type |
MSSORTLCID |
MS SQL database collation - character order |
MSCOLLATION |
MS SQL character comparison |
MSLASTCHAR |
last MS SQL collation character |
LANGUAGES |
The parameter defines the list of languages for setting the user's working environment (i.e. the list of languages in the User parameters), and the list must be a subset of the default languages used in the program or of the languages listed in the "USEDLANGS" parameter. |
LICENSEFILE |
path to the file from which the installer last imported the licence. During a build or release type reinstallation, the installer thus does not ask for the licence file. During a version type reinstallation, the licence is always required during the installation. |
SCRIPTDEFINES |
allows setting global variables for conditional compilation of scripts. Individual variables are separated by semicolons. |
Service procedures
Using the SetK2Password program
After installing IS K2, for security reasons it is necessary to change the default password of the SQL user K2 on the SQL server. After this change, the new password must be set for IS K2. The SetK2Password program is also used to register passwords for SQL users of other servers with which IS K2 is to communicate.
The program also runs automatically during a new installation of IS K2 if the SQL user K2 has a password other than the default one set.
Procedure:
1. On the SQL server, we change the password of the SQL user K2, or create a user on another server.
2. We run the SetK2Password.exe program. The file is located in the directory of the installed K2 in the Bin\x86 or Bin\x64 subdirectory.
3. The login form for the SetK2Password program is displayed. We leave the Server field empty and enter the factory password for logging in. You can obtain the password on request from your K2 consulting team.

Picture: Logging in to the SetK2Password program with the factory password
4. After a successful login, the program is ready to register the new password of the SQL user K2. In the Server field, we enter the name of the server on which IS K2 runs (it matches the value of the SERVER parameter in the K2.ini file), or the name of the server with which IS K2 is to communicate. In the Name field, we enter the SQL user under which IS K2 logs in to the server, or under which we want to log in to another server. By default, this is the user K2. In the Password field, we enter the changed / new password from step 1. We confirm the entered data with the Add password button.

Picture: Entering data for registering the changed password in IS K2
5. The SetK2Password program writes the encrypted values under which IS K2 will log in to the server to the SysK2.ini file.
6. If registered values already exist for the Server - User combination when adding the password, the following message appears. We can overwrite the original values.

Picture: Query about overwriting already existing values for the Server - User combination
7. We can close the SetK2Password program. IS K2 will now log in with the new login credentials.
File module extensions
This functionality is available only when using the MSSQL driver according to the database platform.
K2 allows users to extend any tables in K2. A column that can be filled with any data can be added to each table. A new table index can also be added at the same time. However, keep in mind that ill-considered extension of tables or adding indexes may slow down K2 in modules that use the extended tables. New columns or indexes can be added to or removed from tables. The function is located in the tree in the Administrator section.
After the function is started, a form is displayed with a list of all Client tables used in K2.

File module extension form, page 0
After pressing F5, the system checks whether a file can be created in the Client or Conf folder, depending on the extension type. If the user does not have the right or there is not enough space, the form does not switch to change mode and a message appears.

Picture: Message about the prohibition of making changes
If the message above does not appear, we get into editing the record on page 1. The form contains two grids here. The upper one contains a list of newly defined fields and the lower one a list of newly defined indexes.

Entering new fields
To enter new fields in the table, press the Ins key. A form appears in which the following data must be filled in:
- Field No. - an integer from 2000 upwards
- Description - description of the field
- ProgName - name of the field in the database, must begin with "EX_"
- Picture - how the value is to be displayed
- FieldName - what the field will be called in K2
- Type - data type of the field (Time, Integer number, Date, Date and time, Decimal number, Real number, String)
- Length - number of characters for a string field or a decimal number
- Dec: - number of decimal places of a decimal number
- Default - entering the default value. The user is responsible for entering it. It must be written as required by the SQL server (with the correct decimal separator, in a recognizable date format, text must be in ´´ and must not be longer than the defined field length). The default value can also be given by a function. A syntax check of the entry is not possible.
- Right to field - number of the right that allows the user to see the value of the given field.
- Optional index - the field will be available in the administration of optional indexes.

Picture: Entering a new field of the WideString type
Entering new indexes
New indexes are entered after pressing the Ins key in the lower grid. It is possible to create an index consisting of up to ten fields. New indexes can have properties supported by DB servers and the fields can be sorted in ascending or descending order.
Index properties:
- ixUnique - the index is unique
- ixCaseInsensitive - letter case does not matter in text fields
- ixOptFil - index with optimal filling
- ixClustered - clustered index

Picture: Creating a new key
Saving changes
When saving changes, a message is displayed about the need to convert the changed table.

If we are sure that we want to make the change, we press Yes.

It is also advisable to back up the sales table. In K2, in the database administration, we select the export of the relevant table. After the conversion, a log is displayed.
In order to work with the new field, K2 must be restarted, because the old table data remain in memory.

The changes are saved in the company directory in the TableMod.xml file. The file created from the examples above looks as follows:
<?xml version="1.0" encoding="Windows-1250"?>
<TableMod><field><FileNo>123</FileNo><FieldNo>2000</FieldNo><Description>New field in the sales table </Description><ProgName>EX_PNove </ProgName><FieldName>EX_FNove </FieldName><FieldPicture>S25 </FieldPicture><FieldType>1</FieldType><FieldLen>25</FieldLen><FieldDecLen>0</FieldDecLen></field><index><FileNo>123</FileNo><Description>New key </Description><IndexName>By_EX_PNove </IndexName><Attributes>0</Attributes><Segment1>2000</Segment1><Segment1C>1</Segment1C><Segment2>8060929</Segment2><Segment2C>0</Segment2C><Segment3>8060930</Segment3><Segment3C>0</Segment3C><Segment4>8060931</Segment4><Segment4C>0</Segment4C><Segment5>0</Segment5><Segment5C>0</Segment5C><Segment6>0</Segment6><Segment6C>0</Segment6C><Segment7>0</Segment7><Segment7C>0</Segment7C><Segment8>0</Segment8><Segment8C>0</Segment8C><Segment9>0</Segment9><Segment9C>0</Segment9C><Segment10>0</Segment10><Segment10C>0</Segment10C></index></TableMod>
Removing changes
If we find that we no longer need a field we have defined, e.g. because the K2 standard has created a similar or identical field, it is possible to remove the fields or indexes we have created. Then the same conversions as in point 12.4.3 take place and a log of the changes made is displayed.

Transferring extensions between Clients
Procedure:
- In the Client to which we want to transfer the extension, we select the option Form – Action – Take extension from the menu
- A form appears for selecting the Client from which we want to take the extension.
- After the Client is selected, the fields and keys are checked for duplicates and a log is written about the result.
- If everything is OK, proceed in the same way as in chapter 10.3.3 Saving changes.
- The TableMod.xml file is copied to the new Client.
- After the fields are created, K2 must be restarted for the changes to take effect.
Risks of using extensions
Data transfers
For tables that are transferred between branches, the extension must be transferred first and only then the data transfer itself. This always applies after an extension is created or the table structure is changed.
Wages and VPB
In these modules, the entire record is saved during backup, and therefore inconsistencies occur if the table structure changes. Therefore, after changing any wage or VPB table, the relevant backup must be deleted.
Database backup
- In Enterprise Manager, we connect to the relevant server.
- We click on the database with the right mouse button, select the Tasks option and choose Backup ….
- On the General tab, we press the Add button and write the path and file name, or select the drive where the data are to be backed up.
- On the Options tab, we can choose whether we want to add the backup to an already existing one, Append to the existing backup set, or overwrite the existing file, Overwrite all existing backup sets.
- We press the OK button.
- This backs up the SQL database.
Transferring K2_client data from one server to another (copy)
These operations are performed by an administrator who has administrator rights on the MS SQL server.
- First, a Backup of the database we want to copy must be made, see the previous chapter.
- A database must be prepared on the target server, either an existing one from a previous copy, or it must be created.
- Then a Restore of the database into this newly created database must be performed.
- We click on the database with the right mouse button, select the option Tasks and choose Restore, Database ….
- On the General tab, we select From device and then, using the button next to the edit field, we select the backup file created according to the previous chapter.
- In the lower part of the window, we select the backup we want to restore. If Append is used, see the previous chapter, as many rows appear in the lower window as there are backups in the given file.
- On the Options tab, Overwrite file with existing database (WITH REPLACE) must be checked, which overwrites the data in the target database.
- It is also necessary to check whether the paths to the mdf and ldf files are set correctly. These files must exist and will be overwritten with the data from the backup.
- We press the OK button.
Setting K2 user rights
This setting is made after transferring or restoring a backup if a database connection error appears when K2 is started.

Picture: Error when the K2 user is not correctly assigned on the MS SQL server
- In the newly created database, in the database - Security – Users section, we delete the K2 user and, if necessary, also the schema.
- In the users of the DB engine, in the server - Security – Logins section, we click on the K2 user and select Properties.
- On the User Mappings tab, we find the newly created database, mark it in the map column and in the lower part of the window we also mark db_owner.
- We press the OK button and the database is ready for use in K2.
Editing databases using SQL Server Enterprise Manager
Using SQL Management Studio, records in database tables can be edited. In the Tables section, we select a table and choose Edit Top 200 Rows in the context menu.
Back-up of data
What is to be backed up:
- IS K2 (SQL) – to a file using SQL tools and then to tape using NTBACKUP
- Server "SERVERK2" – to tape using NTBACKUP
Server SERVERK2
SQL databases
Only SQL databases are backed up on this server. SQL JOBs are created on the SERVERK2 server that ensure the backup to files (see List of databases and Backup Devices).
List of databases:
Name |
Recovery Model |
When and how |
K2 |
Full |
every Fri Database – Complete (20:15), Sat to Thu Trans. Log (20:15) |
K2_FIRMAxy |
Full |
every Fri Database – Complete (20:25), Sat to Thu Trans. Log (20:25) |
K2_FIRMAxy |
Simple |
every Fri Database – Complete (20:30) |
Master |
Simple |
daily Database – Complete (20:00) |
Model |
Full |
every Fri Database – Complete (20:05), Sat to Thu Trans. Log (20:05) |
Msdb |
Simple |
daily Database – Complete (20:10) |
Note: When creating JOBs, pay attention to whether the Backup Device will be overwritten or appended to.
Example of JOB settings for the K2 database:
K2 backup Full |
every Fri |
20:15:00 h |
overwrite |
K2 backup Log NeazCT |
from Sun to Thu |
20:15:00 h |
append |
K2 backup Log SO |
every Sat |
20:15:00 h |
overwrite |
Backup Devices:
Name |
Device Type |
K2 Full |
Disk Backup |
K2 Log |
Disk Backup |
K2_FIRMAxy Full |
Disk Backup |
K2_FIRMAxy Log |
Disk Backup |
K2_FIRMAxy_DM Full |
Disk Backup |
master Full |
Disk Backup |
model Full |
Disk Backup |
model Log |
Disk Backup |
msdb Full |
Disk Backup |
NTBACKUP
Every day at 21:30, the scheduled task SERVERK2_TAPE.CMD is started in the user context SERVERK2\ZALOHA. This task starts NTBACKUP.EXE.
NTBACKUP settings – saving to tape:
Source – what will be backed up (SERVERK2.BKS): |
C:\ D:\ SystemState |
Tape: |
tape with any name |
K2BugReporter
The program is used to obtain the call stack and convert the call stack into a readable form.
- It is called by K2 projects in the background to obtain the call stack of all application threads.
- It can print the call stack from a running application that is not responding, so that the cause can be determined.
- It converts memory profiling files into a readable form.
- It also resolves symbols outside the Delphi application space, i.e. also of system DLLs.
K2BugReporter can be run with these parameters:
- HELP - prints help on how to use the tool
- SNAPSHOT - prints the current snapshot of the application threads to the output. Usage example: K2BugReporter.exe SNAPSHOT {PID}
- PERFORMANCE - prints 11 snapshots per second of all application threads to the output. Usage example: K2BugReporter.exe PERFORMANCE {PID}
- WATCHMEMORY - waits for the memory address {ADDRESS} in the process {PID} to be overwritten. If it is overwritten, the call stack of all application threads is printed and the thread that caused the memory overwrite is identified. Usage example: K2BugReporter.exe WATCHMEMORY {PID} {ADDRESS}
{PID} = ProcessId, it can be obtained in the Task Manager, PID column.
{ADDRESS} = the address to be watched for overwriting
Procedure for creating a K2_AS memory profiling file and converting it into a readable form:
- The parameter AS3MEMORYPROFILER=1 is set in K2.ini
- K2_AS is started for a short time interval (a few hours for the initial determination of the amount of memory leaks)
- K2_AS is terminated, whereupon the files (ddddd)-K2.LOG and (ddddd)-SCRIPT.LOG are created
- The file (ddddd)-SCRIPT.LOG contains unreleased memory blocks that arose while scripts were running
- The file (ddddd)-K2.LOG must be converted into a readable form by calling K2BugReporter.exe RepairCallstack (ddddd)-K2.LOG
- The previous step creates the file (ddddd)-K2.STK, which is passed to development to remove memory leaks in the K2_AS core
For a better evaluation of the cause of the application freezing, it is advisable to run the tool 3 - 5 times.
In order to obtain information from applications running under different users, K2BugReporter must be run as administrator.
Starting MS Excel and MS Word via an OLE action
When starting MS Excel and MS Word via an OLE action, these directories must exist:
- C:\Windows\System32\config\systemprofile\Desktop ... (with rights: Read & execute, List folder contents, Read)
- C:\Windows\System32\config\systemprofile\AppData\Roaming\Microsoft ... (with rights: Modify, Read & execute, List folder contents, Read, Write)
- C:\Windows\System32\config\systemprofile\AppData\Local\Microsoft ... (with rights: Modify, Read & execute, List folder contents, Read, Write)
- C:\Windows\System32\config\systemprofile\AppData\Local\Microsoft\Windows ... (with rights: Modify, Read & execute, List folder contents, Read, Write)
If the SysWOW64 directory exists, these folders must also be created:
- C:\Windows\SysWOW64\config\systemprofile\Desktop ... (with rights: Read & execute, List folder contents, Read)
- C:\Windows\SysWOW64\config\systemprofile\AppData\Roaming\Microsoft ... (with rights: Modify, Read & execute, List folder contents, Read, Write)
- C:\Windows\SysWOW64\config\systemprofile\AppData\Local\Microsoft ... (with rights: Modify, Read & execute, List folder contents, Read, Write)
- C:\Windows\SysWOW64\config\systemprofile\AppData\Local\Microsoft\Windows ... (with rights: Modify, Read & execute, List folder contents, Read, Write)
After adding the required directories, it is necessary to test whether the program can be started via the OLE action.
Otherwise, it is necessary to run the program dcomcnfg.exe (C:\Windows\System32\).
In the configuration of Microsoft Excel/Word Application - (path in the tree Component Services/Computers/My Computer/DCOM Config), it is necessary to verify in the properties that:
on the General tab, the authentication level is set to Default
on the Security tab, for the option Launch and activation permissions, Use Default is selected
on the Security tab, for the option Access Permissions, Use Default is selected
In the configuration of My Computer - (path in the tree Component Services/Computers/), it is necessary to verify in the properties that:
on the COM Security tab, the required user (under whom the AS service is running) is included in the lists Access Permissions and Launch and Activation Permissions
It is necessary to log on to the computer as the required user and start Excel/Word.
After the described adjustments have been made, export to Excel/Word, or work with another DCOM model object, should work.
After checking and, if necessary, adding the directories, it is recommended to try whether access to DCOM Excel/Word from the AS succeeds (this may be the only obstacle to starting MS Excel/Word as DCOM from the AS service).
More information on the OLE action is given here.