BVMS Server- and Client-SDK
BVMS Server- and Client-SDK
BVMS Server- and Client-SDK
Bosch.Vms.SDK
ILogbook Interface
ILogbook Methods
ExportLogbookEntriesToCsvFile Method
Write Method

# ILogbookExportLogbookEntriesToCsvFile Method |

Exports all logbook entries matching the specified search criteria to a CSV file (or several CSV files if necessary).

Note: The current implementation of this method should only be used in sever scripts.

Namespace: Bosch.Vms.SDK
Assembly: Bosch.Vms.SDK (in Bosch.Vms.SDK.dll) Version: 1.9.0.0
Syntax
C#
Copy

    void ExportLogbookEntriesToCsvFile(
    	LogbookSearchParameters searchParams,
    	string fileName
    )

#### Parameters

searchParams LogbookSearchParameters
  An object which encapsulates all search parameters
fileName String
  File name of the CSV file (including extension and directory path where CSV file containing the resulting logbook entries will be saved).

Exceptions

Exception | Condition
--- | ---
SdkException | Thrown in case of any errors occurred during export process. For example: - Export target directory is not whitelisted. - Method executed in client script or in a external SDK application connected to Operator Client.

Remarks

The current implementation should only be used in server scripts.
If the method is used in an external SDK application and if the operation takes more than 60 seconds then it will throw an exception which is caused by a timeout of the remote call.

This method will write all logbook entries to the CSV file which match the search criteria defined in argument searchParams.

If more than one million logbook entries match the specified search criteria then the method creates several CSV files, each containing at most one million entries. (The reason for this is that Microsoft Excel(TM) 2007 and 2010 cannot import CSV files with more than 1.048.576 rows.) The names of the additional CSV files are constructed by appending an ordinal number to the specified file name.

If one of the search requests fails the method throws an exception of class LogbookSearchSdkException which has a property of enum type LogbookSearchResultCode; the value of this property indicates the reason for the failure. If the method fails for other reasons it throws a SdkException.

Tip
The method uses "accept known good" input validation strategy and ensures that requested fileName is strictly within a configured whitelist where exports are allowed. Requested export path must met one of the following condition: - Specified path directory is white-listed itself; - Specified path directory is subdirectory of any white-listed directory; - Specified path is within an optical disc device, such as a CD or DVD-ROM or within removable storage device, such as a floppy disk drive or a USB; When none of the conditions above are met, requested export is rejected.

Tip
Exports whitelist is defined by BVMS administrator on Central Server in ..\ProgramData\Bosch\VMS\ServerData\PathWhitelistForExports.txt.

See Also

#### Reference

ILogbook Interface
Bosch.Vms.SDK Namespace

Copyright © Bosch Sicherheitssysteme GmbH