Data From Database

Import from Database function is used to get data from database.

SheetKraft contains the Data From Database option which can be accessed by the Import From Button present in the SheetKraft Toolbar ( See figure)

The data can be imported from a particular table of the database. Or a Stored Procedure or Manual Query can be used to retrieve data from database.

Case 1: Basic Example

The following guidelines describe how data can be imported from a particular table using Data From Database.

Step 1

Click on the Import From Button and select the Database option to open this dialogue box.

Step 2

Click on the browse button next to Connection, to configure the database connection. If the Configuration File is already setup as explained in Desktop & Server Configurations, then this step can be skipped.

A window for configuring connection appears. Configure the connection as shown in Step 4 of Export to Database.

Step 3

After entering the connection settings, select Table option.

Select the table name by clicking on the browse button next to the Table Name.

The database tables are listed in the format <SchemaName>.<TableName>.

Step 4

After selecting the database table, the data in the database table will be loaded.

Select the required columns in the output by checking on the checkbox corresponding to each column. The columns can be reordered by dragging the headers.

Step 5

The number of data rows retrieved from the database can be limited bt checking Max rows and entering the required number in the corresponding field.

Step 6

To get filtered/sorted data, click Filter/Sort and follow the steps given in Filter/Sort. Click Next to get the data without filtering or sorting.

You will be asked where to save the result. To save the data in the Existing WorkSheet, you can input the index of the starting cell where you want to copy the data. Or you can save the data in a New Worksheet.

Step 7

After entering your choice, click Finish.

Case 2: Using Stored Procedure

Repeat the steps 1 and 2 in Case 1.

Step 3

After entering the connection settings, select Procedure option.

Select the procedure by clicking on the browse button next to Procedure.

The following window appears where the stored procedures are listed in the format <SchemaName>.<ProcedureName>.

Step 4

After selecting the stored procedure, parameters in the procedure, if any, will be loaded.

Enter the parameter values in the field corresponding to each parameter.

Step 5

Click on Show Preview to display the data that will be retrived. This can also be used to check if there is any error in the parameter values.

Step 6

Continue steps 5-7 in Case 1. The result is shown in figure below:

Case 3: Using Manual Query

Repeat the steps 1 and 2 in Case 1.

Step 3

After entering the connection settings, select ManualQuery option.

Step 4

Enter the query to retrieve data from the database in the field to Query.

After entering the query, if the query doesnot have any error , the data to be imported will be loaded.

Step 5

Continue steps 6-7 in Case 1. The result is shown in figure below: