repcadm snake

REPCoder Admin

Reporting Server based on REPCODER.DLL and Firebird / InterBase SQL

Version: 1.0 (release date: 2016-06-24) repcoder_admin.zip (9 MB)

REPCoder


Start:

There is no instalation procedure. You need only REPCADM.EXE and REPCODER.DLL. In the 64-bit version: REPCADM64.EXE and REPCODER64.DLL.

It is a database application created to manage reports designed with REPCoder. The designed report projects are normally stored in SFM files. REPCADM.EXE stores them in a Firebird (or InterBase) database as blobs. So you can put your reports on a server and access them as remote database data. The owner of this Reporting database is REPC_ADMIN. This username must be added to the security database of the Firebird (InterBase) server at the same beginning.

REPCADM.EXE fetches a report from the Reporting database, saves it locally in a temporary SFM file and opens using repc_open_report function of REPCODER.DLL. Then the SFM file is deleted from the local disc (after the report is closed).

start

Client configuration:

Here you first specify the type of the Reporting database. It can be based on Firebird or InterBase SQL server. The version and path of the client library is also shown. The latest (thread-safe) versions are recommended. The name of the client library is: fbclient.dll (Firebird) or gds32.dll (InterBase). For 64-bit version the InterBase client is ibclient64.dll.

configuration

Create a reporting database:

Then you specify the Server name and the Connection string to the Reporting database. You can also "Manage users" of the server here. It is good to add the username: REPC_ADMIN at the same beginning, because it is the Owner of the reporting database. For this you have to know the password for the server superuser: SYSDBA. Then you use the "Create database" button to create the reporting database on the server. If the REPC_ADMIN user was not created yet you will be asked to enter the SYSDBA password. The program will add REPC_ADMIN to the security database. Its default password is "admin". You can later change this password in the "Manage users" dialog.

Before creating the database you are asked to specify its Character Set and Collate. The default recommended values are: UTF8 and UNICODE. But you can choose it on your own. It is important for the TEXT data in the reporting database: names of reports, groups, projects, documents.

create_database

You can of course create as many reporting databases as you need, and on different servers. But it is not necessary. One database is enought for all needs, because you can create different Projects there to organize your reports.


Login to the reporting database:

After the reporting database has been created, you must use the "Connect" button in the upper-left corner of the main window. First you should login as REPC_ADMIN, because only this owner user can create the projects and design the reports. Other users have rather the read-only access to the reporting database. They can only execute the reports provided by REPC_ADMIN. The only difference is that they can also create their own documents (report results) and grant access to them to other users.

login

After successfull login you see the following window. The predefined Demo project is opened there. For your own reporting database this project does not exist (the list of projects will be empty).

after_login

Projects:

The main structure of the "Reporting database" is: REPORTS --> GROUPS --> PROJECTS.

So first you create a Project. Each project has its unique Name and the selected Database Access Method: 1-BDE, 2-ODBC, 3-Firebird, 4-InterBase.

project

For each project you define its Groups and at the end you add reports to the groups. Each group has its unique Name (in the Project) and a short unique Code. These codes define the tree structure of groups (for example: A,B, A1,A2,B1,B2, A11,A12,B11,B12 ...).

For each project you also define and configure the set of target Databases. All the target databases of the Project should have the same structure. They should differ only with the data stored inside. Usually they will be the databases of different business clients. Each target database has its unique Name in the Project. For each target database you create the list of users and configure their target default logins and (optional) target roles. The user names are those stored in the security database of the underlying Firebird (InterBase) reporting server.

databases

The most important feature of the target database is the Connection String. It will be passed to each report as its parameter number 1. So when you design a report with REPCADM.EXE this parameter is already defined and should not be removed. It is used to define the connection string inside the reports. The reports are designed by REPC_ADMIN with REPCoder (provided here by REPCODER.DLL).

You can also specify another optional connection parameter: CharSet if necessary. The charset is optional, because it can also be specified inside the reports.

Another parameter here is the so-called Automatic Login. If checked, users will not be prompted for logins and passwords.

So the additional structure of the "Reporting database" is: DBUSERS --> DATABASES --> PROJECTS.

dbusers

Reports:

The reports can be designed only by the owner user: REPC_ADMIN. Each report has its unique Name in the Project. Only the REPC_ADMIN user can define projects, groups, databases, list of database users and their permissions. When creating a report it can be loaded from SFM file (designed earlier with REPCoder) or be designed here as a completely New report. You can also mark a report as having Public access or with a Not used flag. This flag is for old, obsolete reports. You can hide them later in the main window using the "Hide not-used" checkbox.

report

To execute a report, a user of the "Reporting database" must have a Permission granted by REPC_ADMIN. Only Public reports can be executed by all users. The user must have also been added to the "list of users" of the target database for which the report is to be executed.

permission

Target database access password:

When a user of the reporting database wants to execute any report he must first:

password

This password can be set using the "Password" button in the upper-right corner of the main window. If not set the user is prompted to do it before he tries to open the first report.

After the password is set the target database name is marked with the yellow color.

after_password

You should understand that this Password is then passed to REPCODER.DLL when any report is executed. So you don't need to define a password on the level of a report project. The same is with the Login and Role to the target database. These 3 parameters, together with the target database Connection String and CharSet are passed to each report called by REPCODER.DLL. This way a report "kwnows" the connection parameters for the target database. And you don't need to worry about it when you design a report.


UserName and Login:

So you should see the difference between the two terms that are used in "REPCoder Admin": UserName and Login. The "UserName" is only the name of a user of the "Reporting database" (where the report projects are stored). These names are stored in the security database of the underlying Firebird or InterBase SQL server. But the "Login" is the corresponding name of this user for a target database. So one user of the "reporting database" can have many different logins for different "target databases".


Documents:

All users can execute the reports and optionally save their SFR results as the Documents. The report results are stored in temporary SFR files and then put into the "Reporting database" as blobs.

documents

The user who created a document can also grant permissions to it to other users of the "reporting database". He can also drop a document any time. This actions are also always allowed to REPC_ADMIN (the owner of the reporting database).

The documents can also be extracted back from the "reporting databse" to SFR files - "Save to files" button.


Export / Import:

The reports designed in the program and stored in the "reporting database" can be easily extracted to SFM files.

export

Also a whole Project (all groups and reports) can be saved to a binary file (.PRO) and then imported in another project, in the same or a different reporting database. The target databases of the project are not saved in this archive.


A sample report:

blobs

IMPORTANT:

If a directory where REPCADM.EXE is located has also the "sfm" subdirectory, then the temporary SFM files will be stored by REPCADM.EXE just there. You can also put there some image files that your reports will be using. So it is recommended that this subdirectory exists.


API for programmers:

The programmers using REPCODER.DLL can also easily access the reports stored in the reporting database (instead of standard SFM files) from their applications. To enable this, a new (and only one) exported function was added to REPCODER.DLL: repc_admin_setup. Here you pass all the information necessary to access reports in the project of the "Reporting database". The return value is 1 (success) or 0 (error). The function header in C is:

BOOL repc_admin_setup(
BOOL bInterbase, /* 0: Firebird-based reporting database, 1: InterBase-based reporting database */
wchar_t* ConnString, /* reporting database: Connection String */
wchar_t* User, /* reporting database: Username */
wchar_t* Password, /* reporting database: Password */
wchar_t* ProjectName, /* reporting database: Unique project name */
wchar_t* DbName, /* target database: Unique database name in the project */
wchar_t* DbLogin, /* target database (optional): Login for DbName (if not specified the defined value will be used) */
wchar_t* DbPassword, /* target database: Password for DbName */
wchar_t* DbRole, /* target database (optional): Role for DbName (if not specified the defined value will be used) */
BOOL bVerify, /* (0: no verification, 1: verify if "ProjectName" and "DbName" exist and if "User" is on the list of "DbName" users) */
BOOL bShowErrorMess /* (0: quiet verification without messages, 1: MessageBox with error when the verification fails) */
);

After you call this function with success you can easily access the reports stored in the project ("ProjectName") in the reporting database ("ConnString"). You normally use the functions of REPCODER.DLL like "repc_open_report" or "repc_call_report" in exactly the same way as you open SFM files with them. The only difference is that you do not provide the ".SFM" extension in the report name. It should be just the unique name of the report in the given "Project" in the reporting database.

This UNICODE function has also its ANSI version: "repc_admin_setup_a" (as all other functions in REPCODER.DLL).

This function is also provided for C#, DELPHI, JAVA. For more info see the "Guide 4 - DLL.sfm" in the repcoder.zip package.

The function "repc_admin_setup" only sets some globals in the REPCODER.DLL. It does not leave the reporting database opened on output and does not allocate any resources. So there is no cleaning function provided to free resources at the end. The reporting database is opened each time a report is called to fetch its blob data (SFM file) and then it is closed immediately.

But REPCADM.EXE behaves in the different way - it keeps the reporting database opened all the time it is running. If you are a programmer you need REPCADM.EXE only at the beginning - to create the reporting database or later - to make changes to it. Because it is not possible to design reports in the reporting database using REPCODER.DLL from your application. You can only execute them this way.