reports:how_to
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| reports:how_to [2024/07/26 08:55] – added Configuration antonio.andriychuk | reports:how_to [2024/10/08 09:01] (current) – Added Images and minor changes antonio.andriychuk | ||
|---|---|---|---|
| Line 2: | Line 2: | ||
| - | In the following guide, you will learn how to create custom reports. As standards, BeCloud' | + | In the following guide, you will learn how to create custom reports. As per standards, |
| \\ | \\ | ||
| - | To be able to create a custom report you must satisfy | + | To be able to create a custom report, you must meet some requirements, |
| * An average knowledge of SQL, the more focussed on MariaDB, the merrier; \\ | * An average knowledge of SQL, the more focussed on MariaDB, the merrier; \\ | ||
| * Have installed a query constructor application; | * Have installed a query constructor application; | ||
| * Have installed JasperSoft Reports Studio; \\ | * Have installed JasperSoft Reports Studio; \\ | ||
| - | If it' | + | If this is your first time downloading |
| Line 19: | Line 19: | ||
| ===== Configuration ===== | ===== Configuration ===== | ||
| - | After the installer of JasperSoft Reporting Application, | + | After installing |
| **A quick disclaimer: __the downloaded version of JasperSoft Reporting Application doesn' | **A quick disclaimer: __the downloaded version of JasperSoft Reporting Application doesn' | ||
| - | First, in order to retrieve the correct version to be used, it is necessary to navigate to the Help Page of BrightPattern, on the " | + | First, in order to retrieve the correct version to be used, it is necessary to navigate to the Help Page of BrightPattern. On the " |
| - | Inside you will find a file named " | + | Inside you will find a file named " |
| {{: | {{: | ||
| - | Now, open your JasperSoft | + | Now, open your JasperSoft |
| - | After you can just "Apply and Close" to apport | + | After you can just "Apply and Close" to apportion |
| | | ||
| {{: | {{: | ||
| + | \\ \\ | ||
| + | ====== Building the Custom Report ====== | ||
| - | ===== Starting with Building the Custom Report | + | Starting with Building the Custom Report. \\ |
| - | For starters, you must log in to the Admin page of the tenant in which the custom report will be uploaded. This is because the custom report will be based on an existing report, which will be called " | + | For starters, you must log in to the Admin page of the tenant in which the custom report will be uploaded. This is because the custom report will be based on an existing report, which will be called " |
| As per the Example of this scope, the following tutorial will be based on the report Call Detail and the custom report built for Beeasy " | As per the Example of this scope, the following tutorial will be based on the report Call Detail and the custom report built for Beeasy " | ||
| \\ | \\ | ||
| - | The scope of this report was to have a monthly/ | + | The scope of this report was to have a monthly/ |
| - | Open the .jrxml file with the JasperSoft Report Studio application and double-click the columns to access the edit page where the main SQL query is located (1) and access the " | + | Open the .jrxml file with the JasperSoft Report Studio application and double-click the columns to access the edit page where the main SQL query is located (1) and access the " |
| {{: | {{: | ||
| Line 60: | Line 62: | ||
| WHEN custom1 LIKE ' | WHEN custom1 LIKE ' | ||
| WHEN custom1 LIKE ' | WHEN custom1 LIKE ' | ||
| - | END) as nv, | + | END) as nv. |
| COUNT(CASE | COUNT(CASE | ||
| - | WHEN (queue_time > 0 OR pending_time > 0) THEN 1 | + | WHEN queue_time > 0 OR pending_time > 0 THEN 1 |
| END) as offered, | END) as offered, | ||
| COUNT(CASE | COUNT(CASE | ||
| Line 69: | Line 71: | ||
| ROUND((COUNT(CASE | ROUND((COUNT(CASE | ||
| WHEN (talk_time > 0) AND (disposition NOT LIKE ' | WHEN (talk_time > 0) AND (disposition NOT LIKE ' | ||
| - | END) * 100) / NULLIF(COUNT(CASE | + | END) * 100) / NULLIF(COUNT(CASE) |
| - | WHEN (queue_time > 0 OR pending_time > 0) THEN 1 | + | WHEN queue_time > 0 OR pending_time > 0 THEN 1 |
| END), 0), 2) as perc_answered, | END), 0), 2) as perc_answered, | ||
| (COUNT(CASE | (COUNT(CASE | ||
| - | WHEN (queue_time > 0 OR pending_time > 0) THEN 1 | + | WHEN queue_time > 0 OR pending_time > 0 THEN 1 |
| END) - COUNT(CASE | END) - COUNT(CASE | ||
| WHEN (talk_time > 0) AND (disposition NOT LIKE ' | WHEN (talk_time > 0) AND (disposition NOT LIKE ' | ||
| END)) as abandoned, | END)) as abandoned, | ||
| - | ROUND(99 + (COUNT(CASE | + | ROUND(99 + (COUNT(CASE)) |
| - | WHEN (queue_time > 0 OR pending_time > 0) THEN 1 | + | WHEN queue_time > 0 OR pending_time > 0 THEN 1 |
| END) - COUNT(CASE | END) - COUNT(CASE | ||
| WHEN (talk_time > 0) AND (disposition NOT LIKE ' | WHEN (talk_time > 0) AND (disposition NOT LIKE ' | ||
| - | END) * 100 ) / NULLIF(COUNT(CASE | + | END) * 100 ) / NULLIF(COUNT(CASE) |
| - | WHEN (queue_time > 0 OR pending_time > 0) THEN 1 | + | WHEN queue_time > 0 OR pending_time > 0 THEN 1 |
| END), 0), 2) as perc_abandoned, | END), 0), 2) as perc_abandoned, | ||
| (SUM(queue_time) + SUM(pending_time)) as tma, | (SUM(queue_time) + SUM(pending_time)) as tma, | ||
| Line 151: | Line 153: | ||
| </ | </ | ||
| + | \\ | ||
| + | ===== Developing the report: Query ===== | ||
| + | To develop a query, open the " | ||
| + | As an example, let's think about a customer that is requesting a report that can display these data: \\ | ||
| + | * Date; | ||
| + | * Inbound Calls Received; | ||
| + | * Outbound Calls Made; | ||
| + | * Service-name; | ||
| + | * Talk-Time; | ||
| + | * Average Talk Time; | ||
| + | * Max Talk Time; | ||
| + | |||
| + | This report has a special request: it must be displayed on a daily basis and on a monthly basis alongside the year. \\ | ||
| + | Next, open query constructor application and start to develop the query. Following the previous example the query will turn out like this: \\ | ||
| + | < | ||
| + | SELECT | ||
| + | YEAR(start_time) AS year, | ||
| + | IF($P{interval} = " | ||
| + | WHEN MONTH(start_time) = 1 THEN " | ||
| + | WHEN MONTH(start_time) = 2 THEN " | ||
| + | WHEN MONTH(start_time) = 3 THEN " | ||
| + | WHEN MONTH(start_time) = 4 THEN " | ||
| + | WHEN MONTH(start_time) = 5 THEN " | ||
| + | WHEN MONTH(start_time) = 6 THEN " | ||
| + | WHEN MONTH(start_time) = 7 THEN " | ||
| + | WHEN MONTH(start_time) = 8 THEN " | ||
| + | WHEN MONTH(start_time) = 9 THEN " | ||
| + | WHEN MONTH(start_time) = 10 THEN " | ||
| + | WHEN MONTH(start_time) = 11 THEN " | ||
| + | WHEN MONTH(start_time) = 12 THEN " | ||
| + | END, DATE_FORMAT(start_time, | ||
| + | COUNT(CASE | ||
| + | WHEN caller_phone_type = ' | ||
| + | END) AS calls_received, | ||
| + | COUNT(CASE | ||
| + | WHEN caller_phone_type = ' | ||
| + | END) AS calls_made, | ||
| + | SUM(CASE | ||
| + | WHEN caller_phone_type = ' | ||
| + | AND (queue_time > 0 OR pending_time > 0) AND talk_time > 0 THEN talk_time | ||
| + | END) AS talk_time, | ||
| + | AVG(CASE | ||
| + | WHEN caller_phone_type = ' | ||
| + | AND (queue_time > 0 OR pending_time > 0) AND talk_time > 0 THEN talk_time | ||
| + | END) AS avg_talk_time, | ||
| + | MAX(CASE | ||
| + | WHEN caller_phone_type = ' | ||
| + | AND (queue_time > 0 OR pending_time > 0) AND talk_time > 0 THEN talk_time | ||
| + | END) AS max_talk_time | ||
| + | FROM test_com.call_detail cd | ||
| + | WHERE start_time >= $P{start_time} AND start_time < $P{end_time} | ||
| + | AND media_type = " | ||
| + | GROUP BY IF($P{interval} = " | ||
| + | </ | ||
| + | |||
| + | As you can see, we're trying to gather all of the informations from the previous example and merge it all in one query. \\ | ||
| + | This is the description of each element that is composing the query: \\ | ||
| + | * __start_time__: | ||
| + | * __$P{start_time}__: | ||
| + | * __caller/ | ||
| + | * __queue_time or pending_time__: | ||
| + | * __talk_time__: | ||
| + | |||
| + | |||
| + | {{: | ||
| + | |||
| + | After developing the query, we can move to Jasper to continue with building the front-end of the report. \\ \\ | ||
| + | |||
| + | ===== Developing the report: Jasper ===== | ||
| + | Moving to Jasper, we must add the previously built query in the DataSet and Query dialog panel. \\ | ||
| + | Then, procceed to " | ||
| + | |||
| + | Since we're trying to insert also parameters, we must move to the next tab called " | ||
| + | |||
| + | {{: | ||
| + | |||
| + | Thereafter you have to create or use each column with a custom label of the column and on each field of the column you can build the desired report. Following the given example, the reports from the builder will look something like this: | ||
| + | |||
| + | {{: | ||
| + | |||
| + | Be aware that sometimes, you have to partially alterate some fields functionalities, | ||
| + | Also, it may happen that once you finish with the report and launch it in the admin page you will not see some fields. To fix this you have to select the column, go to " | ||
| + | |||
| + | |||
| + | ===== Developing the report: Front-end ===== | ||
| + | After creating the back-end (with queries and construction of fields and parameters) it's time to develop the front-end, so the web-page that an user will see once launching the report. \\ | ||
| + | In this topic, we're going to: | ||
| + | * Change the hyperlink from " | ||
| + | * Streamline the query to run a 'lil faster; | ||
| + | * Creating parameters fields and link them to the query; | ||
| + | |||
| + | {{: | ||
| + | |||
| + | \\ \\ | ||
| + | ==== Change the Hyperlink ==== | ||
| + | To change the Hyperlink, you must first select the Brightpattern in the "Main report" | ||
| + | \\ Then, procceed with changing the value of the field from " | ||
| + | |||
| + | {{: | ||
| + | |||
| + | \\ \\ | ||
| + | ==== Streamline the query ==== | ||
| + | This step is more easier than expected, this step is also important to make the report able to only take the tenant dataset and not every tenant. In order to apply this explaination in query terms, open the DataSet of the first page and change the FROM call_detail (as an example, change the table to the interested one or where you've been requested to develope a look-alike report) to FROM (tenant dataset).call_detail . | ||
| + | \\ As an example, if I have to make a report on the beincontact.it tenant you must insert: "FROM test_com.call_detail"; | ||
| + | Another worth mention is that, in order to create a more streamline and fast query, if it is requested to only extract the query on a single service, add this service on the WHERE condition. | ||
| + | |||
| + | {{: | ||
| + | |||
| + | \\ \\ | ||
| + | ==== Parameters and Link ==== | ||
| + | In order to create a better-streamlined-work I suggest to copy the created parameter from the " | ||
| + | \\ As per the provided example, we're going to select " | ||
| + | |||
| + | {{: | ||
| + | |||
| + | Next, another thing worth to do in order to require an input from the User is to navigate on the " | ||
| + | |||
| + | {{: | ||
| + | |||
| + | \\ \\ | ||
| + | ====== Conclusions ====== | ||
| + | Once done this small report as an example, save it and upload the report on the " | ||
| + | \\ As you could' | ||
reports/how_to.1721984141.txt.gz · Last modified: by antonio.andriychuk
