0. Installation


0.0. Interactive reports are additional modules to legacy R-Keeper 7 system.

0.0.1. IR has several modules with independent connection to SQL DB.

0.1. Modern version IR reports you can install with full RK7 installer for Windows. You have option to install only reports without RK7 core there.

0.2. As for RK7 IR reports, which has the following application in scheme:

0.2.1. UCS common server

0.2.2. UCS Feature server for RK7 Interactive reports

0.2.3. RK7 Manager station plugin (extensions GUI menu):

0.2.3.1. IR datasets reference

0.2.3.2. IR reports reference

0.3. IR will create and use its own tables in RK7 database.

0.4. Detailed configuration of applications you do in their INI files.

0.5. It is possible to use metod of copy files and install FS and CS without installer. See other manuals for details.


1. Creating an Interactive report for Fast Report


1.1. The creation of any report consists of two parts: the formation of dataset and presentation of these in a convenient form.

1. Let’s start with the formation of the dataset. We go into manager station to «Options – Interactive reports – IR Data Sets

2. In the opened window create a new Data Set (New IR Data Sets) in the group «Datasets for other reports». Specify the «Name» and «System name» for new dataset.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

3. Put content into properties «SQL Query»

 

Text of SQL Query:

SELECT

      r.NAME AS "NAME" 

       ,ol.DATETIME AS "DATETIME"

      ,ol.PARAMETER AS "PARAMETER"

      ,e.NAME AS "OPERATOR"

      ,e2.NAME AS "MANAGER"

      ,COUNT(ORDERS00.ORDERNAME) as "CNTORDERS"

      ,r.SIFR AS "SIFR"                             

      ,r.GUIDSTRING AS "GUIDSTRING" 

  FROM OPERATIONLOG ol                 

left join VISITS v on v.SIFR=ol.VISIT and v.MIDSERVER=ol.MIDSERVER and v.ISTARTCOMMONSHIFT=ol.ICOMMONSHIFT

left join EMPLOYEES e on e.SIFR = ol.OPERATOR

left join EMPLOYEES e2 on e2.SIFR = ol.MANAGER

left join CASHES c on c.SIFR = ol.STATION

left join CASHGROUPS cg on cg.SIFR = c.CASHGROUP

left join RESTAURANTS r on r.SIFR = cg.RESTAURANT

left join ORDERS ORDERS00

  ON ORDERS00.VISIT=ol.VISIT AND ORDERS00.MIDSERVER=ol.MIDSERVER AND ORDERS00.ICOMMONSHIFT=ol.ICOMMONSHIFT AND ORDERS00.STARTSERVICE<=ol.DATETIME and ORDERS00.ENDSERVICE>=ol.DATETIME

WHERE (r.GUIDSTRING IN (:RESTAURANT2)) AND (ol.DATETIME >= :date1) AND (ol.DATETIME <= :date2) and

 OPERATION=833

group by

       ol.DATETIME

      ,ol.PARAMETER

      ,e.NAME

      ,e2.NAME

      ,r.NAME

      ,r.SIFR

      ,r.GUIDSTRING

order by ol.DATETIME

Some SQL Query rules:

a. Parameters in the query are marked by a colon, followed by the parameter name conjoint writing in Latin. For example: (: RESTAURANT2).

b. Order of the fields in the SQL-sample will determine order of the fields in the report display.

c. If you need to change the order of the fields, you have to create a new data set with the required field order.

d. Appropriate fields will be created after correctly specifying of SQL-query in the dataset.

e. In the field settings you can change the display name, enable / disable sorting and grouping data.

 

 

 

Properties of created options are available on the "IR Data Set Parameters".

For example, in the parameter RESTAURANT2 included property TypeListFromSql, that means choosing the values ​​of the data set obtained by the SQL-query specified in the property "SQL query". 

 

 

SQL-query for a parameter RESTAURANT2

 

Open IR reports tab.

 

 

4. Create a layout for printed form of the report. You must specify the type of output for the generated report. Specify a value FR4 for printed form property RepType.

 

 

5. Click on the value of the property "Layout" and open a window with parameters included in the report:

 

6. Enter the parameters, and then opens a window for editing a printed report form.

If you don't understand how to work in this window, you should refer to the user manual FastReport 4 - http://www.fast-report.com/public_download/html/UserMan/index.html

 

7. Open the report in the user interface after you edit the layout.

 


2. Creating interactive report for the screen form


 

Use created dataset to display the prepared data. All you need to bring prepared data on the screen.

8. Create a new report and give it a name, then select property «RepType» value DesktopGrids.

 

 

9. Open the layout of this report. There will be absolutely empty text box that must to be filled.

You have to write by hand description of the layout. But we can take as a model any of the available screen layouts report to facilitate the task. 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

That's what eventually happened in this example:

<IR_FORM borderwidth="10"> <OBJECT type="IR_SQL" guid="{CFEACC30-A18E-4071-A0AA-69290DD6789F}" order="0"> </OBJECT>

<OBJECT type="IR_PANEL" borderwidth="10" order="0">

                <OBJECT type="IR_PANEL" order="0">                           

                               <OBJECT type="IR_BUTTON" guid="{BEE1200A-A95D-4DDB-BD28-003A1D96A286}" order="0">

                                               <TEXT>Остановка ресторана</TEXT>

                                               <ANCHORS>akLeft, akTop</ANCHORS>

                                               <IHEIGHT>35</IHEIGHT>

                                               <IHEIGHT>195</IHEIGHT>

                                               <ALIGNMENT>alRight</ALIGNMENT>

                               </OBJECT>                              

                               <ANCHORS>akLeft, akTop</ANCHORS>

                               <ALIGNMENT>alTop</ALIGNMENT>

                               <IHEIGHT>35</IHEIGHT>

                </OBJECT>               

                <OBJECT type="IR_REPORTTITLE"  order="1">

                               <TEXT>%REP_NAME%</TEXT>

                               <ANCHORS>akLeft, akTop</ANCHORS>

                               <ALIGNMENT>alTop</ALIGNMENT>

                               <IHEIGHT>30</IHEIGHT>

                               <IWIDTH>100</IWIDTH>

                </OBJECT>                

                <OBJECT type="IR_REPORTFILTER"  order="2">

                               <TEXT>Ресторан: %RESTAURANT2%

Дата: %date1% - %date2%</TEXT>

                               <ANCHORS>akLeft, akTop</ANCHORS>

                               <ALIGNMENT>alTop</ALIGNMENT>

                               <IHEIGHT>60</IHEIGHT>

                               <IWIDTH>100</IWIDTH>

                </OBJECT>          

                <ANCHORS>akRight, akTop</ANCHORS>

                <ALIGNMENT>alTop</ALIGNMENT>

                <IHEIGHT>130</IHEIGHT>

                <IWIDTH>1000</IWIDTH>

</OBJECT>

<OBJECT type="IR_PANEL" autosize="1" order="1">

  <OBJECT type="IR_DS" guid="{48B8FE07-3EAE-4D48-B8A5-6D05623F6307}" order="5">

    <ANCHORS>akLeft, akTop</ANCHORS>

    <ALIGNMENT>alTop</ALIGNMENT>

    <IHEIGHT>100</IHEIGHT>

    <IWIDTH>1000</IWIDTH>

    <COLMOVING>0</COLMOVING>

    <AUTOSIZE>1</AUTOSIZE>

    <EXPANDLEVEL>-1</EXPANDLEVEL>

                <FIELDS>

                               <FIELD sysname="NAME" alignment="taLeftJustify">

          <IMINWIDTH>150</IMINWIDTH>

                      </FIELD>

                    <FIELD sysname="DATETIME" alignment="taCenter">

          <IMINWIDTH>80</IMINWIDTH>

        </FIELD>

                    <FIELD sysname="PARAMETER" alignment="taRightJustify" allagregate="sum" format="%INTEGER%">

          <IMINWIDTH>100</IMINWIDTH>

        </FIELD>

                    <FIELD sysname="OPERATOR" alignment="taLeftJustify">

          <IMINWIDTH>150</IMINWIDTH>

        </FIELD>

                    <FIELD sysname="MANAGER" alignment="taLeftJustify">

          <IMINWIDTH>150</IMINWIDTH>

        </FIELD>

        <FIELD sysname="CNTORDERS" alignment="taRightJustify" allagregate="sum" format="%INTEGER%">

          <IMINWIDTH>100</IMINWIDTH>

        </FIELD>

                               <FIELD sysname="SIFR" colvisible="0">

          <IMINWIDTH>150</IMINWIDTH>

        </FIELD>

                               <FIELD sysname="GUIDSTRING" colvisible="0">

          <IMINWIDTH>150</IMINWIDTH>

        </FIELD>

     </FIELDS>

    <FOOTER>1</FOOTER>

  </OBJECT>

<ANCHORS>akRight, akTop</ANCHORS>

<ALIGNMENT>alTop</ALIGNMENT>

<IHEIGHT>130</IHEIGHT>

<IWIDTH>1000</IWIDTH>

<AUTOSIZE>1</AUTOSIZE>

</OBJECT>

</IR_FORM>

 

 

An important caveat to description of the content for layout.

In line:

<IR_FORM borderwidth="10"> <OBJECT type="IR_SQL" guid="{CFEACC30-A18E-4071-A0AA-69290DD6789F}" order="0"> </OBJECT>>

Leave everything as it is, because here comes the technical process for recalculation of units for the report.

The line below describes the button that opens the printed form of report.

<OBJECT type="IR_BUTTON" guid="{BEE1200A-A95D-4DDB-BD28-003A1D96A286}" order="0">

Take the value of the guid for our report "Stop restaurant report" from SQL-table [IR_REPORTS]

Next in the line:

<OBJECT type="IR_DS" guid="{48B8FE07-3EAE-4D48-B8A5-6D05623F6307}" order="5">

Take the value of the guid for our report "Stop restaurant report 2" from SQL-table [IR_DATASETS]