The next step in the development of the applied solution will be creation of convenient reports on activities. Reports as well will be created without any programming, using only visual design tools.
Reports are located in the Reports branch of the Configuration object tree. Let us add a new report.
Figure 1-89. Creating a new report
Name the new report Expenses and then click Open data composition schema of this report.
Figure 1-90. Opening the data composition schema of the Expenses report
Since this is a new report, it does not contain any data composition schema, the platform will open Template Wizard and suggest you to create a new template. That template will contain a data composition schema. Agree by clicking Finish.
Figure 1-91. Template Wizard
After that, the platform will open the Data composition schema editor. For now, this composition schema is empty.
Figure 1-92. The empty data composition schema
Now you will define sources of data that the report will use to retrieve data, and define the structure of the report.
Add a Data set of type Query. In other words, the data for this report will be retrieved from the database, managed by 1C:Enterprise.
Figure 1-93. Creating a new query
You can enter a query manually or use Query builder. Let us use second way, for that click Query Builder…
Figure 1-94. Opening Query builder
In the Query builder window on the left there is a list of tables that can be used for retrieving data. Expand the AccumulationRegisters branch and double-click to select FinancialTransactions.BalanceAndTurnovers table.
Figure 1-95. Selecting the FinancialTransactions.BalanceAndTurnovers table
In the Tables panel that is in the middle, select the FinancialTransactionsBalanceAndTurnovers table and click Add all fields . All fields of this table will be selected as query fields.
Figure 1-96. Selecting data for query
The query is configured, click OK.
The wizard will generate the query text and automatically populate fields of the data composition schema.
Figure 1-97. Data composition schema fields
Click the Resources tab. Here, using double-clicks select following fields:
Figure 1-98. Data composition schema resources
Click the Settings tab. Here, in order to create the structure of the report, you will use another wizard. To do this, click Open settings wizard .
Figure 1-99. Opening Data Composition Settings Wizard
Data Composition Settings Wizard allows you to quickly create several simple variants of the report. For this tutorial purposes, List is a good choice. Therefore, do not change anything, and just click Next.
Figure 1-100. Creating a report in the form of list
On the next step, select fields that will be displayed in the report. Double-click the following fields in Available fields list:
Then click Next.
Figure 1-101. Selecting report fields
Now we need to select fields that will group the data in the report. Users would like to see reports on each acquaintance, and on each event associated with the acquaintance. To achieve this, the list of available fields double-click on both Person and Event fields to select them as grouping fields.
After that, click OK. You are now done with defining the structure of the report.
Figure 1-102. Selecting group fields of the report
The platform will now show the structure of the report.
Figure 1-103. Completed structure of the report
It is almost done. Now, give a user an ability to arbitrarily set the report period. This will be useful when the register will contain large amount of records accumulated after a long period of using this application. This is easy to do as under the structure of the report, there are two parameters available, named Begin of period and End of period.
Figure 1-104. Report parameters
Right-click each of parameters and then select Custom settings item property.
Figure 1-105. Opening Custom settings item property
In the opened window, select the Include in custom settings check box and click OK.
Figure 1-106. Include in custom settings
After repeating this procedure for both Begin of period and End of period parameters, continue configuring the report. To do this, close the data composition schema editor and return to Expenses report editor. Click the Subsystems tab and include this report in the Finances subsystem.
Figure 1-107 Including Expenses report in the Finances subsystem
Start the application in 1C:Enterprise mode and take a look at the report. Notice that this report is located in the Finances section. Also, notice that the platform automatically placed the report in the Reports menu group.
Figure 1-108. Opening Expenses report
After the report is opened, click Create.
Figure 1-109. The Expenses report
Having confirmed that the report works properly and displays records of the Cash receipt and the Cash expense documents according to dimensions that were defined for the register, return to Designer mode.
Create one more simple report that can show the current balance of available funds. Name it CashBalance and include it in the Finances subsystem. Similarly, to the Expenses report, click Open data composition schema for the Cash balance report on the Main tab and create the data composition schema. Add the data set of the Query type on the Data sets tab.
Figure 1-110. Adding the query for the Cash balance report
In the opened window, use Query builder as previously. However, for the new report, select the FinancialTransactions.Balance table.
Figure 1-111. Selecting tables for the Cash balance report
Next, expand FinancialTransactionsBalance in the middle panel, click the AmountBalance field, and then double-click or click Add selected to select it.
Figure 1-112. Selecting the AmountBalance field
Click OK to close Query builder. After this, again you will see the Data Sets tab of the data composition schema editor. No changes need to be made here. Click the Resources tab, then double-click the AmountBalance resource.
Figure 1-113. Selecting the AmountBalance resource
Open the Settings tab. Here, use the Data Composition Settings Wizard once again, confirming the default type, List.
Figure 1-114. Data Composition Settings Wizard
On the next page, double-click the Period standard field in the DataParameters group. This field will allow seeing the date, which the report is created for. Then add the AmountBalance field.
Figure 1-115. Selecting report fields
After selecting fields, click OK because there is nothing else that this report is required to display. The next thing to do is to include the Period parameter to Custom settings as you did when configuring the Expenses report.
Figure 1-116. Including Period to Custom settings
Set the default value of the Period parameter to Beginning of this day so that the report will automatically display the information for the current day.
Figure 1-117. Selecting Beginning of this day as the default value of the Period parameter
After that changes, the report settings will look as follows:
Figure 1-118. Settings of the Cash balance report
Now start the application in 1C:Enterprise mode and check the report.
Figure 1-119. Opening the Cash balance report in 1C:Enterprise mode
Information presented in the report is extremely simple but useful. Now the user can always check how much money is available now.
Figure 1-120. The data of the Cash balance report
Excellent! Now, create another report. After this report will be finished the CRM application will be complete.
Return to Designer mode, create a new report, and name it DailyChart, then include it in the Finances subsystem, and finally click Open data composition schema. Add the Data set of the Query type, and then open Query builder.
In the left panel select the FinancialTransactions.BalanceAndTurnovers table. Up to this point, the process has no difference from what you did during configuring the Expenses report.
Seeing that the report is named Daily chart you might have guessed that a new report will display not numeric data but a chart. And now the trick. To present the data from the register in the suitable for this report format, select FinancialTransactionsBalanceAndTurnovers table in the middle panel of Query builder and click Virtual table parameters .
Figure 1-121. Opening Virtual table parameters
In the opened window, in the the Periodicity field, select Day and then click OK to save and close the window.
Figure 1-122. Adjusting Virtual table parameters
Then, in the middle panel, select the Period and the AmountClosingBalance fields from the FinancialTransactionsBalanceAndTurnovers table.
Figure 1-123. The Period and the AmountClosingBalance fields
Click OK to close Query builder. Then, click the Resources tab and select the AmountClosingBalance field as a resource.
Figure 1-124. The Resources tab of the Daily chart report
Click the Settings tab and open Data Composition Settings Wizard. This time, click Chart. Data is displayed as a chart, and then click Next.
Figure 1-125. The Chart report type
After adding Period and AmountClosingBalance to selected fields, click Next.
Figure 1-126. Adding chart fields
On the next page, add the Period field to the list in the Points panel on the right side. Click Next.
Figure 1-127. Configuring Points of the chart
On the next page, add Period to order fields on the right panel. Click Next.
Figure 1-128. Data order fields of the chart
On the next page, in the Chart type field select Line. At this point, the design of chart complete, and you can click OK.
Figure 1-129. Chart types
In the same way as you did for previous reports, include the Begin of period and the End of period parameters in Custom settings using Custom settings item property.
Figure 1-130. Adding properties to custom settings
Now you can see what you have created. Start the application in 1C:Enterprise mode, open the Daily chart report, and then click Create.
Figure 1-131. The Daily chart report
From this chart users can clearly see the changes in balance of money, made by Cash receipts and Cash expenses.