Add-in A

Transcription

Add-in A
BLUESOFTS JOINT STOCK COMPANY
Add-in A-Tools
Query, Share and manage Excel workbook on LAN, internet
Add-in A-Tools
Editing and Management Excel Data on the network
Query data on worksheet
Contents
Introduction ........................................................................................................... 3
Setup and Run A-Tools ........................................................................................... 4
Add-in A-Tools display ................................................................................................... 4
Server functionality (Excel Server) ........................................................................ 5
Start Server .................................................................................................................. 5
Opening shared Excel files (Databases) ........................................................................... 5
Data regions formatted before sharing in the network ...................................................... 7
Create the shared data in the network ............................................................................ 8
Develop a list of groups and users connected to the sever ................................................ 9
Setting the rights for User Group ...................................................................................10
Managing connected users ............................................................................................12
Data Backup ................................................................................................................14
Change the view of database and rights.........................................................................16
"Pause" and "Continue" to run the server .......................................................................16
Disconnect the database...............................................................................................17
Stop the server ............................................................................................................17
Client functionality (Excel Client) ........................................................................ 18
Connect to the server ...................................................................................................18
Connect to the data in the server ..................................................................................19
Managing the list of connected users .............................................................................21
The supporting functions for editing and updating the data to the server ..........................21
A-Tools Options ...........................................................................................................22
Inconnect to the server ................................................................................................24
Data query (filter) guide in Excel’s worksheet ..................................................... 25
“SQL Builder” and “BS_SQL” function .............................................................................25
Named range in Excel’s worksheets ...............................................................................26
Create BS_SQL formula with "SQL Builder" .....................................................................27
User guide of BS_SQL function ......................................................................................29
Create DBKEY - Connecting external data.......................................................................31
Query, get data from the server through BS_SQL function () ...........................................32
Guide to the different functions of A-Tools .....................................................................32
View video tutorials of Add-in A-Tools ................................................................. 32
Guide to connect Excel’s data on the network:................................................................32
Errors handling when A-Tools can’t start with Microsoft Excel ..........................................32
BLUESOFTS JOINT STOCK COMPANY
Website: www.atoolspro.com Or www.bluesofts.net
2
Email: sales@bluesofts.net
Add-in A-Tools
Editing and Management Excel Data on the network
Query data on worksheet
Introduction
A-Tools an add-in run in Microsoft Excel environment. A-Tools has the following
functions:
Share and manage Excel workbook on LAN, internet: To share Excel data files
for multiple users on the network, Excel ‘s way is only share full folder that contains an
Excel files. In this way, the computers in your network can access the copy and even
completely remove this data file. The owner of this Excel files can only share all sheets in
workbook (file) the whole it is difficult to hide the sheets or prevent others from seeing data.
Other requirements as allow users access to the data but has the rights: read only, edit,
limit how many people are connected ,.... Excel can not do it.
With A-Tools allows editing and managing Excel data on the network. Users to
manage Excel data powerful on the network, allow connect to the spreadsheet over TCP/IP
(not full share folder – Excel’s way), manage connections to the data ranges, setting rights
for each user group: read only, edit, limit how many people are connected ,....,When data is
changed on worksheet then other computers in the network are updated immediately (after
about ~ 1 millisecond).
Query data on worksheet: Create dynamic reports by the use functions to query
the database (DB) with T-SQL language. Allows connecting to databases within and outside
such as Excel, Access, FoxPro, MS SQL, MySQL, Firebird, ... With tool “SQL Builder” will help
users create query formula (with BS_SQL function) easily and efficiently. Users can create
reports in worksheet is highly sophisticated, is filtered according to various conditions,
associated with different data sources, ensuring accuracy, stability and high speed.
A-Tools Programming: A-Tools supports the user interface to perform the
function is very convenient. In addition it also provides APIs function and COM objects as
BSNetwork for the developer programming combined with A-Tools to exploiting the
capabilities of A-Tools, strengthening for their applications.
If you want to program VBA with A-Tools , you should read documents in “A-Tools
Programming.pdf” file .
The extra functions:

Build statistical formulas associated with multiple conditions.

Convert text, number to words, ....
BLUESOFTS JOINT STOCK COMPANY
Website: www.atoolspro.com Or www.bluesofts.net
3
Email: sales@bluesofts.net
Add-in A-Tools
Editing and Management Excel Data on the network
Query data on worksheet
Setup and Run A-Tools
The user needs to download A-tools here:
 A-Tools Pro - Commercial version
http://www.bluesofts.net/Products/AddIns/A-Tools/A-Tools_Pro.exe
 A-Tools Free - Free version
http://www.bluesofts.net/Products/AddIns/A-Tools/A-Tools_Free.exe
After downloading setup of A-Tools. The user double clicks on the file and installs it
normally.
Note : The user must login to Windows by Administrator. When the user installs
successfully, All users can run A-Tools.
To run A-Tools, the user must open Microsoft Excel. Then, the user will see the
menu of A-Tools near the bottom of ribbon menu of Microsoft Excel.
Menu Add-in A-Tools in Microsoft Excel
When the user opens the Microsoft Excel 2007 and chooses A-Tools menu, the user will see
functions of A-Tools as the following picture.
Interface on Microsoft Excel 2003 or lower versions.
A-Tools run with:
+ Windows: 2000, XP, Vista, 7, 8, Server 2003, Server 2008, Server 2012 (or higher)
with 32 or 64-bit.
+ Microsoft Excel: 2000,XP,2003,2007,2010,2013 (or higher) with 32 or 64-bit.
BLUESOFTS JOINT STOCK COMPANY
Website: www.atoolspro.com Or www.bluesofts.net
4
Email: sales@bluesofts.net
Add-in A-Tools
Editing and Management Excel Data on the network
Query data on worksheet
Server functionality (Excel Server)
Start Server
From A-Tools menu, select the "Start server" function.
+ Server name: If Clients want to connect with this computer, they must use the
name or IP address to connect.
+ User name: Name of original supply system is "admin”. After the user had accessed
by this name, the user can create a list of accessed names.
+ Password: Don’t fill in if the name is admin.
Only users who have a username (account) and password, can run Excel Server
function and Excel Client function.
Opening shared Excel files (Databases)
From A-Tools menu, the user runs “Server manager” function. When the screen is
appeared, the user need to select the “Databases” from the left window. The database
manager function will be appeared on the right screen.
BLUESOFTS JOINT STOCK COMPANY
Website: www.atoolspro.com Or www.bluesofts.net
5
Email: sales@bluesofts.net
Add-in A-Tools
Editing and Management Excel Data on the network
Query data on worksheet
The server shares data in the network that started from creating a list of the Excel
data files.
+ Add : The user can add Excel database files to the list of server manager.
+ Remove : The user can remove the database files from the list of server manager.
+ C&A : if the user can select the data in this database ,the user will be managed
according to the regulations of a managing report- " Checking and Approval “.
+ Visible: If the user select it , this databases (workbook) will be seen in the server ,
otherwise it is hidden .
+ Inactivitie: If this database file is selected ,Clients in the network can not connect to
this database . Only clients are permited from server. Datas will be hidden in databases
screen if its database is selected " inactivitie ".
+ Visible option: allows the user sees databases in the state : active , inactive , all .
BLUESOFTS JOINT STOCK COMPANY
Website: www.atoolspro.com Or www.bluesofts.net
6
Email: sales@bluesofts.net
Add-in A-Tools
Editing and Management Excel Data on the network
Query data on worksheet
Data regions formatted before sharing in the network
A-Tools automatically updates the value format: number, currency, percentage, date,
Custom Format. However, there are many ways of formatting the values in Excel. To
ensure high consistency of value format between the server and client, the users
should format the value in data regions in its own characteristics.
After server data are formatted a spreadsheet structure, value type, background
color, text color, font, line..., the clients are allowed to connect with the server.
The main task of the client is to connect, view and enter value. The format will not be
automatically sent to the server, only value types are automatically formatted; however, the
user should take the previous value format on the server.
If you want to update the data formatted from the client into the server,
you must do the following:
+ Choose the data region needed
+ If Excel 2003: Menu A-Tools, select "Excel Network " -> "Update Formats"
+ If Excel 2007: tab A-Tools, in group Commands”, select "Update Data" -> "Update
Formats"
BLUESOFTS JOINT STOCK COMPANY
Website: www.atoolspro.com Or www.bluesofts.net
7
Email: sales@bluesofts.net
Add-in A-Tools
Editing and Management Excel Data on the network
Query data on worksheet
Refer to the support functions for editing and updating the data to the server
Create the shared data in the network
In the screen "Server Management", from the left pane, select the data file name,
worksheet name, the function “Ranges for connecting" will appear in the right screen.
The cilents are granted to open the data regions for editing.
+ Add: Added new shared zone. Shared region in A-Tools has three types:
-
Complete Workbook, when users open it read-only cilent that is not edited.
Worksheet/ Sheet, users can read and edit in the whole worksheet.
The data / Range is a set of contiguous blocks or discrete areas, users
opening the client can only edit in the allocation.
+ Remove: remove the data from the shared list.
+ Name: data area is named by the user.
+ Address: the region address of the worksheet, in this range the user can edit.
BLUESOFTS JOINT STOCK COMPANY
Website: www.atoolspro.com Or www.bluesofts.net
8
Email: sales@bluesofts.net
Add-in A-Tools
Editing and Management Excel Data on the network
Query data on worksheet
+ Sheet Name: The name of the sheet in the workbook.
+ Hidden cols: Indicate the hidden columns when shared.
from I-> M
I-> M
For example: C: D, F, I: M - hide columns from C-> D, column F, column
For example: 3:4,5, I: M - hide columns from C-> D, column F, column from
You can use the letters for column index or column name.
+ Hidden Rows: Indicate the hidden rows when shared.
For example: 16,17,18:22 - hide rows 16, 17, 18 -> 22
+ Check: if selected, the data will not be fixed and printed if you do not select the
correct data. This principle of the database was done if it is selected "C & A" - "Checking
and Approval" / Acceptance and Approval. This information field allows the user from the
clients to establish if granted.
+ Approve: if checked and "Confirm" is selected too, the data will not be allowed to
edit and print if you do not select the data not to be printed. This principle of the database
was done if it is selected "C & A " - " Checking and Approval" / Acceptance and Approval.
This information field allows the user from the client to establish if granted
+ Inc Ref: if selected, the formulas in this region are linked to the data in the other
worksheets in its workbook.
+ User(s): A - Tools is counting the number of connectors in the data region.
+ Max Users: Indicates the number of maximum connectors to the data. The value -1
doesn’t limit in the number of connectors.
it.
+ Inactive :if selected, this range is locked and the users are not allowed to connect to
Develop a list of groups and users connected to the sever
In the screen "Server Manager" from the left pane, select "Groups and Users", the
function of users and groups management will appear in the right screen.
BLUESOFTS JOINT STOCK COMPANY
Website: www.atoolspro.com Or www.bluesofts.net
9
Email: sales@bluesofts.net
Add-in A-Tools
Editing and Management Excel Data on the network
Query data on worksheet
This function allows users to create groups and users. Only someone with a username
and password caninitialize or connect to the server.
+ Inactive: if selected, your username will not be allowed to connect to the server.
That the user names blue, red and selected "Connected" means they are already
connected to the server.
Setting the rights for User Group
In the screen "Server Manager", from the left pane, select "Rights" the right screen
will appear decentralization function.
A-Tools implements the group decentralization, people in that group will own the same
rights.
.
BLUESOFTS JOINT STOCK COMPANY
Website: www.atoolspro.com Or www.bluesofts.net
10
Email: sales@bluesofts.net
Add-in A-Tools
Editing and Management Excel Data on the network
Query data on worksheet
+ Read Only: If selected, the group is not allowed to be edited in that data region.
+ Format: if selected, the group will be allowed to runthe format command to the
server
+ Print: if selected, the group will be shown the changes out of identified range in the
address column .
+ Check: if selected, the group will be running the function "Confirm" for reporting
management. This function is valid only if the database of this data region is "C & A".
+ Approve: if selected, the group will be running the function "Approve" for reporting
management. This function is valid only if the database of this data region is "C & A".
When users from the client open the data area which is granted the rights "Confirm",
"Approve", the buttons "Confirm ", "Approve" will appear at the bottom of the screen of the
client.
+ Filter: filter the data in the forms of rapid decentralization.
All: all the data regions will appear.
ranges of Workbook: only the workbook styles (all files) appear.
If you select any workbook (file), you will have to filter the data in that workbook.
The range is also under the rule: All / Active / Inactive of "Server Manager".
This function allows to filter the data fast, to decentralize for the workbooks and
groups quickly and conveniently.
BLUESOFTS JOINT STOCK COMPANY
Website: www.atoolspro.com Or www.bluesofts.net
11
Email: sales@bluesofts.net
Add-in A-Tools
Editing and Management Excel Data on the network
Query data on worksheet
In its own task, each group will be allocated the rights to interfere in the work in
variable degrees.
Managing connected users
In the screen "Server Manager", from the left pane, select "Connections ", the
function connected users administration will appear on the right screen
From this list, the server can allow users to continue their intervention to the server or
not, allowing users to chat with one another.
From this list, the user see “Black list” and “Connection List “ functions.
BLUESOFTS JOINT STOCK COMPANY
Website: www.atoolspro.com Or www.bluesofts.net
12
Email: sales@bluesofts.net
Add-in A-Tools
Editing and Management Excel Data on the network
Query data on worksheet
+If you select “ Black list” : the “Black list” will appear on the screen.
The computer has IP address or machine code in the list will not be connected.
+If you select “connection list”: the “Connection list” function will appear on the
screen.
BLUESOFTS JOINT STOCK COMPANY
Website: www.atoolspro.com Or www.bluesofts.net
13
Email: sales@bluesofts.net
Add-in A-Tools
Editing and Management Excel Data on the network
Query data on worksheet
The computer has IP address or machine code in the list will be allowed to connect to
the server.If the list is empty, all cilents are allowed to connect to the server if they are not
in Black List.
Data Backup
Select the button "Backup ..." to open the function "Backup Databases"
OPTIONS
+ Backup subdirectory of the file: if selected, the A-Tools will create a subdirectory
of the database backed up.
BLUESOFTS JOINT STOCK COMPANY
Website: www.atoolspro.com Or www.bluesofts.net
14
Email: sales@bluesofts.net
Add-in A-Tools
Editing and Management Excel Data on the network
Query data on worksheet
+ Back up Ranges & Rights: if selected, A-Tools will backup all the shared data and
their rights.
+ Backup files are inactive”: if selected, A-Tools will establish backup database in the
stateof "K. operation". This function can only be done if the "Backup Areas & Rights"
is selected.
+ The files are named: after copied (new file), database is named after templates. AToolssets itself the pattern yyyy-mm-dd [FILENAME]. [FILENAME] is mandatory
declaration of A-Tools, users are not allowed to delete and edit.
To perform a backup, the user selects the button "Backup". When the screen
"Browse For Folder" appears, the user selectsthe address of storing backup
databases.
After you click "OK", backup results are shown as the following screen:
After you click "OK", backup results are shown as the following screen:
BLUESOFTS JOINT STOCK COMPANY
Website: www.atoolspro.com Or www.bluesofts.net
15
Email: sales@bluesofts.net
Add-in A-Tools
Editing and Management Excel Data on the network
Query data on worksheet
Change the view of database and rights
The server manages database files with the states: "inactive "," active ". If you want
all of them to be shown, choose "All". When the user selects "inactive", the windows of
"Databases"and "Rights setting” will only appear the data "inactive", similar to the selection
of" active ".
"Pause" and "Continue" to run the server
In some cases, such as server maintenance, server setup, it is necessary to suspend
the server. For this to be done, in the screen "server manager", the user presses the
BLUESOFTS JOINT STOCK COMPANY
Website: www.atoolspro.com Or www.bluesofts.net
16
Email: sales@bluesofts.net
Add-in A-Tools
Editing and Management Excel Data on the network
Query data on worksheet
button "Pause". As soon as the button "Pause" is selected, its name (label) is changed to
"Continue".
When the button "Pause" is selected, the server will not accept any connection
require from the client: Log; Open the data. The client can still edit normally but not update
immediately, temporarily stored in the server memory, only after the user selects
"Continue" on the screen "server manager" on the server, the data is immediately
undated into the databases.
Disconnect the database
When a database is connected to the clients, on the screen "Databases" of the
server, blue letters will appear, users select this file and click "Disconnect", then A-Tools will
disconnect all the clients.
This function is executed when the user needs to change the settings for this
databases in the server and the client does not get access to when it is being set up.
This function is usually performed with the "Pause".
Stop the server
From A-Tools menu, select "Stop server”.
Note: The users can only close the data files after stoped the server.
BLUESOFTS JOINT STOCK COMPANY
Website: www.atoolspro.com Or www.bluesofts.net
17
Email: sales@bluesofts.net
Add-in A-Tools
Editing and Management Excel Data on the network
Query data on worksheet
Client functionality (Excel Client)
Connect to the server
From A-Tools menu, select the function "Connect"
+ Server Name: the user can enter the name or IP address of the server, the user
should enter the IP address to connect.
+ User Name: the name of original supply system is "user".
+ Password: if with the name "user", password is blank.
Only those who have a username (account) and password run the Excel Server and Excel
Client.
BLUESOFTS JOINT STOCK COMPANY
Website: www.atoolspro.com Or www.bluesofts.net
18
Email: sales@bluesofts.net
Add-in A-Tools
Editing and Management Excel Data on the network
Query data on worksheet
Connect to the data in the server
After connecting to the server successfully, the user will open the list of data regions
that we are allowed to connect with. That the user can edit, delete, format depends on the
rights granted in the group.
The user can open the data from A-Tools menu, select "Client Manager".
To open an range, select the needed range and then click the button "Open range " .
A –Tools manages 3 types of ranges:
• The address – allows us to edit in the given address.
• The worksheet – allows us to edit in the entire worksheet.
• The workbook - allow us to edit in the entire workbook.
Note: If a database file that has both the address and the workbook, if opening the
workbook, the user can only view but not edit. The right of a region depends on the right of
the higher level. For example, the right of the address depends on the rights of the
worksheet and workbook.
To close the opening range, select “open range” (green) and then click the button
"Close range”.
If opening the data successfully, the user will see the data as shown below.
BLUESOFTS JOINT STOCK COMPANY
Website: www.atoolspro.com Or www.bluesofts.net
19
Email: sales@bluesofts.net
Add-in A-Tools
Editing and Management Excel Data on the network
Query data on worksheet
+ If you select the button "Check", the other users in the network can’t edit but print
the data by its own right of printing.
+ If you choose the "Approve", the other users in the network can’t edit but print the
data.
The "Check" and "Approve" function are valid only if itschosen database is "C & A"
and the user has a license of the " Report Manager " of A-Tools Pro.
BLUESOFTS JOINT STOCK COMPANY
Website: www.atoolspro.com Or www.bluesofts.net
20
Email: sales@bluesofts.net
Add-in A-Tools
Editing and Management Excel Data on the network
Query data on worksheet
When the computers connect to the network, you can edit them into a range of data
from the server.
http://www.bluesofts.net/Products/AddIns/A-Tools/Pics/ExcelCaro.gif
Managing the list of connected users
In the screen "Client Manager", from the left pane, select "Connected users", the
function of connected user administration will appear on the right screen.
From this list, the user can chat with listed people. Those on the list are those
connecting to the server.
The supporting functions for editing and updating the data
to the server
+ Track change: if selected, when the remote computer changes the value in any
address cell, the user will select that cell and notifies the change. This function
should only be used when the user needs to keep track of the cursor box of other
computers connecting to a range of data.
BLUESOFTS JOINT STOCK COMPANY
Website: www.atoolspro.com Or www.bluesofts.net
21
Email: sales@bluesofts.net
Add-in A-Tools
Editing and Management Excel Data on the network
Query data on worksheet
+ Auto update: if selected (default), when the user changes the value in the
connected area, the server will update soon If the edited data are not immediately
updated to the server, users should uncheck to ensure faster speed of editing. When
you need to update the value to the server, simply select the value to be updated,
select "Upload Values". If you want to update the format, select "Upload formats”. If
you want to both update the value and format, select "Upload formats and values”.
A-Tools Options
From A-Tools menu, select the "Options" or at the screen "Server/client Manager",
select "Options".
+ "Share visual Basic for Application" - The client can use macro from the server
file. Select this option, the server administrator should thoroughly check before users can
connect!
+ "Open the database if the client requests": if selected, when the server is
started, A-Tools doesn’t open database (active), the database is opened only if the client
requests the connection, when the client disconnects, the server will check the database
BLUESOFTS JOINT STOCK COMPANY
Website: www.atoolspro.com Or www.bluesofts.net
22
Email: sales@bluesofts.net
Add-in A-Tools
Editing and Management Excel Data on the network
Query data on worksheet
to see that if there is any connecting client or not, if not this database will be closed
automatically.
This feature is the most useful for the server, saving RAM memory, faster running
speed. This is the optimal solutions for the server.
Note: when choosing this function users need to ensure that databases can be
openned, not to set Security Mechanisms for opening or structure. If database (workbook)
is set password or workbook is protected, A-tools can't work.
+ “Automatic Calculation" :If NOT selected, the formula in the sheet at the server
does not recalculate when the data changes, but in the open, the client has to recalculate. This is the optimal solution for helping the server works faster and lighter.
+ "Hide Microsoft Excel while running Excel Server": if selected, when the user
start server, the Micrsoft Excel screen is completely hidden .There is icon in the Traybar –
That is on the right corner of the computer screen. The user can right-click on this icon to
run the fuctions of server.
+“Add sheets when add workbook ": if selected,on the screen " Managing network
connections ", when adding files to the server ,A- Tools automatically adds all sheets in
that file for the user.
BLUESOFTS JOINT STOCK COMPANY
Website: www.atoolspro.com Or www.bluesofts.net
23
Email: sales@bluesofts.net
Add-in A-Tools
Editing and Management Excel Data on the network
Query data on worksheet
+ “Max Connections”: define the number of clients they are allowed to connect to
the server.
+ “Time for updating values”: define time is milliseconds and update values from
cliets to the server .Standard establishment is 100 milliseconds.
+ “Save all workbooks automatically when the server stops”: If selected, all
workbooks automatically are saved when the server stops.
+ “Auto save after n minutes”: If established, the server will automatically save all
workbooks that are sharing after n minutes one time.after n minutes.
+ “Default Port”: The default port is 1711 in A-Tools. For some reason it needs to
change, please double click to change. A-Tools share datas on the Internet if the user uses
the technique of opening port in the modem. If you need help, please contact with
customer care department of BLUESOFTS joint stock company.
+ “Directory level”: define directory level on the left window to manage folder in
the server that contains databases.
To save establishment to system, the user must select “Done”
Inconnect to the server
From A-Tools menu, the user can select “Inconnect”.
To practice easily with sharing Excel workbook function on network by A-Tools, the user can
refer our clips at the following address:
http://bluesofts.net/giai-phap-phan-mem/a-tools-truy-van-loc-soan-thao-va-quan-tri-du-lieuexcel-qua-mang/186-video-a-tools.html
BLUESOFTS JOINT STOCK COMPANY
Website: www.atoolspro.com Or www.bluesofts.net
24
Email: sales@bluesofts.net
Data query (filter) guide in Excel’s worksheet
“SQL Builder” and “BS_SQL” function
A-Tools uses BS_SQL function to filter data and make reports. BS_SQL function use TSQL statement with functions of A-Tools to filter data and make reports flexibly and
powerfully. Data can be connect from tables in a relationship and variety of databases such
as: Excel, Access, Foxpro, MS SQL, MySQL, Firebird, .... Although the data that are filtered
into Excel worksheets can be from many sources, they are connected together (If the
original data changes, the report will also change )
Add-in A-Tools
Truy vấn (lọc) dữ liệu trong bảng tính Excel
Named range in Excel’s worksheets
It has many data ranges in worksheet. A-Tools filters data from these ranges.
For example: The user filters to choose documents in “KHO” sheet, A3:K68 range.
Set up a formula:
=BS_SQL("SELECT * FROM [KHO$A3:K68]")
If the data range named KHO (=KHO!A3:K68), it has the following formula:
=BS_SQL("SELECT * FROM KHO")
The name help the user to effectively use Excel’s formulas. With A-Tools, the name
of “ KHO” range is considered as the name of a table in Excel’s database.
How to create a name for the data range
Users do in the following sequence:
+ 1: Select the data range.
+ 2: Select the “Formula” menu (With Excel 2007 or higher versions)
+ Select the “Insert->Name” menu (With Excel 2003 or lower versions)
+ 3: Select the “Define Name”
+ Name: name KHO range
+ Refers to: With reference address, Excel automatically fills.
After entering the name, press “OK” to complete.
BLUESOFTS JOINT STOCK COMPANY
Website: www.atoolspro.com Or www.bluesofts.net
26
Email: sales@bluesofts.net
Add-in A-Tools
Truy vấn (lọc) dữ liệu trong bảng tính Excel
Create BS_SQL formula with "SQL Builder"
From the "A-Tools” menu, choose "SQL Builder"
With Excel 2003 from the menu "A-Tools" -> "Data Query" select "SQL Builder"
1
3
2
4
5
(1) DBKEY - connections: select the database or DBKEY (connection code to external
database). To connect to the external database, the user must create DBKEY, how to
create is shown the next page.
(2) List of the area or table names (table, query) the data in the database (1). Users
double click or drag the data from (2) to (3) to the data source.
(3) Connect the relationship keys between tables (table) (in the picture "MA_VLSPHH").
Choose the data fields to display and condition.
(4) + Output: if selected, that data field will be shown
+ Expression: field name or expression
+ Aggregate: chọn tên hàm thống kê: Sum; Count; Min; Max;…
BLUESOFTS JOINT STOCK COMPANY
Website: www.atoolspro.com Or www.bluesofts.net
27
Email: sales@bluesofts.net
Add-in A-Tools
Truy vấn (lọc) dữ liệu trong bảng tính Excel
+ Alias:name the field or expression at "Expression"
+ Sort Type: select the type of ascending (Ascending) or down (descending) order
+ Sort Order: give priorities to the arrangement field
+ Grouping: select grouped data fields. This section is used when users indicate
statistical function at "Aggregate." If all of the fields don’t have indicated statistical
function, select "Grouping".
Criteria: set the filter condition. The user can use the mouse to select data in a
spreadsheet cell for the active condition, in fact using RANGE function (...).
(5) After doing 4 sections above, A-Tools will automatically create T-SQL statement for
BS_SQL function.
Select the button "Next" which will appear below the screen:
+ Define Name: A-Tools will automatically create a name for the result.
+Automatic naming columns: A-Tools names itself the areas from each column in the result.
The name created will be used in Excel formulas.
+ Insert Rows: if selected, the result table will insert the data lines after the cursor. If not,
the data will be overwritten.
+ Address set SQL parameter for BS_SQL function: the cell containing the SQL statement.
It’s necessary to use it when a series of SQLstatement is long (number of characters> 128
characters).
BLUESOFTS JOINT STOCK COMPANY
Website: www.atoolspro.com Or www.bluesofts.net
28
Email: sales@bluesofts.net
Add-in A-Tools
Truy vấn (lọc) dữ liệu trong bảng tính Excel
+ Address cell for formula: in the first cell in the worksheet, the value of the result table is
included.
Click the button "Finish" and then A-Tools runs BS_SQL function in the worksheet.
The formulas containing BS_SQL is created by "SQL Builder" as the following:
User guide of BS_SQL function
BS_SQL function in A-Tools is a multi-function and very special. The result returned by
the function is a table of data filtered in complex conditions,the data is concatenated while
data sources can be from many different types of databases. Just in BS_SQL function, the
user can create kinds of dynamic reports.
BS_SQL function includes:
BS_SQL ( SQL [ , OPTIONS ] )
+ SQL : As a range of SQL query declaration. SQL is a database query language as in
Access ,Foxpro , dBASE , SQLServer , Oracle ...
SQL statement in the function BS_SQL are coordinated with the functions : RECNO ,
CELL , RANGE , DATA , GetOnce , FORMULA , FieldIf , VTC , ... Thanks to the combination
of these functions in SQL declaration, BS_SQL function can return the results flexibly.
+ OPTIONS : The optional parameter (optional) , this parameter is a series , allowing
additional report of function parameter, the parameters are separated by a semicolon ( ;)
The parameters used in OPTIONS include: DBKEY , HR , NAME , AUTONAMES ,
INSERT , SERVERSOURCE .
BLUESOFTS JOINT STOCK COMPANY
Website: www.atoolspro.com Or www.bluesofts.net
29
Email: sales@bluesofts.net
Add-in A-Tools
Truy vấn (lọc) dữ liệu trong bảng tính Excel
You can program macros in VBA to run in the events of BS_SQL function, reporting
that you run the macro made in the parameter OPTIONS. The parameters are declared as
follows:
+ Allow to run a macro before updating data in a spreadsheet
OnBeforeUpdate = YourMacro
+ Allow to run a macro after data is updated
OnAfterUpdate= YourMacro
+ Allow to run a macro when double click on the data (containing BS_SQL function)
OnDblClick = YourMacro
+ Allow to run a macro when the cell pointer moves
OnSelectionChange = YourMacro
+ Allow to run a macro (function) to change the value in the process of getting data
from SQL query results.
OnGetValue = YourMacro
For example: get all the data from stock record into the Excel spreadsheet, stock
record in the Access file "Examble.mdb" was connected to the DBKEY code – MDB.
=BS_SQL(“SELECT * FROM KHO” , “DBKEY=MDB”)
SERVERSOURCE parameter is used to retrieve data from the server.
For example:
=BS_SQL(“SELECT * FROM KHO” , “DBKEY=MDB; SERVERSOURCE=YES”)
The tool of "SQL Builder" helps users create formulas for BS_SQL function easily,
through this tool, users can exploit usage of BS_SQL function.
A-Tools provides BS_SQL function to create active report, using a query language TSQL and many more attributes which are just only in A-Tools, so you can create active
reports with high complexity without programming. You should read carefully the documents
of A-Tools on BS_SQL function to exploit A-Tools well.
SQL statement in A-Tools is inherited from the standard T-SQL language and
developed with the declaration functions with SQL string to make complex reports. To
exploit the use of SQL in A-Tools, the user should read the files in install folder A-Tools by
turn.
Bai 1 - Huong dan su dung ham BS_SQL
Bai 2 - Cac ham ho tro nhom ham Database Functions.xls
Bai 3 Hàm CSDL (Database Functions).xls
Bai 4 - Huong dan tao bao cao.xls
Read more articles of BS_SQL function manual here:
C:\A-Tools\Help\BS_SQL.htm
The file of "SoKeToanSQL.xls" containing the system of ledger designed with BS_SQL
function in A-Tools runs very fast and flexibly.
View video tutorials here:
http://www.bluesofts.net/Products/AddIns/A-Tools/Help/DEMO/Index.htm
BLUESOFTS JOINT STOCK COMPANY
Website: www.atoolspro.com Or www.bluesofts.net
30
Email: sales@bluesofts.net
Add-in A-Tools
Truy vấn (lọc) dữ liệu trong bảng tính Excel
Create DBKEY - Connecting external data
A-Tools allows you to connect to external databases: Access, Foxpro, MS SQL, MySQL,
... To connect to Excel, users must create DBKEY.
From the menu "A-Tools" choose "SQL Builder"
With Excel 200, from the menu "A-Tools" -> "Data Query" select "DBKEY - Establish
connections with external databases".
+DBKEY: code of connection. DBKEY name is used in the functions of A-Tools such
as BS_SQL, BS_TABLE,...
+ Add: add DBKEY (additional connection)
+ Edit: edit the setting figures DBKEY
+ Remove: RemoveDBKEY from A-Tools. If DBKEY is removed, the formula
containing DBKEY are false.
For example: Data Query of stock records, the type of documentis entered with 'N'
1) Stock records are located in the opening file
=BS_SQL(“SELECT * FROM KHO WHERE LOAIPHIEU=’N’ ”)
2) Stock records are located in the Access Database file "Examble.mdb".
We have created DBKEY with MDB name to connect to "Examble.mdb"
BLUESOFTS JOINT STOCK COMPANY
Website: www.atoolspro.com Or www.bluesofts.net
31
Email: sales@bluesofts.net
Add-in A-Tools
Truy vấn (lọc) dữ liệu trong bảng tính Excel
=BS_SQL(“SELECT * FROM KHO WHERE LOAIPHIEU=’N’ ” , “DBKEY=MDB”)
Query, get data from the server through BS_SQL function
When the server is start. From the client, use BS_SQL function and assign the
attribute SERVERSOURCE = YES to receive data from the server.
Assuming that, the server is running and opening a workbook with the data as "KHO".
How to write a function is as the following:
=BS_SQL("SELECT * FROM KHO" , "SERVERSOURCE=YES")
If the server managesstock records in the Access database and it is connected by
DBKEY code named "MDB"
=BS_SQL("SELECT * FROM KHO" , "DBKEY=MDB; SERVERSOURCE=YES")
From two above examples, instead of taking data in the client, users can retrieve data
from the server. If you write the function BS_SQL () in the old way just, just only add the
declaration in the parameter OPTIONS as SERVERSOURCE = YES.
Guide to the different functions of A-Tools
To know the newest imformation of A-Tools ,please view here
http://www.atoolspro.com
View video tutorials of Add-in A-Tools
http://www.bluesofts.net/Products/AddIns/A-Tools/Help/DEMO/Index.htm
Guide to connect Excel’s data on the network:
http://www.bluesofts.net/Products/AddIns/A-Tools/Help/DEMO/A-Tools_Network/ATools_Network.html
Errors handling when A-Tools can’t start with Microsoft
Excel
http://www.bluesofts.net/Baiviet/Office/ExcelEnabledAddin/Index.html
BLUESOFTS JOINT STOCK COMPANY
Website: www.atoolspro.com Or www.bluesofts.net
32
Email: sales@bluesofts.net