Using Report feature you can create canned and adhoc reports over data from a datasource. The datasource can be a database or a REST web service. Refer Creating Data Connections for information on creating a datasource.
Prerequisites
To create reports, you must have already created database or webservice connection and datasource to fetch application data. Refer Creating Data Connections for more information on creating connection and datasource.
To create reports, perform the following steps in Canvas Studio:
- Click Create > Report.
The Information Report page appears. - In the Report Maintenance tab, enter a unique ID for the report in the Report Id field.
- Enter a display name for the report in the Report Name field.
- Click the Data Source Name field and select a datasource. Refer Creating Data Connections to create a database or webservice connection and datasource.
Click the Select Columns to Display field and select the columns for the report.
When generating reports in the application, end users will be able to select only the columns selected here for the report. Similarly, the following fields behave in the same manner - Select Groupable Columns, Select Sortable Columns, and Select Filterable Columns.
- Click the Select Groupable Columns field and select the column(s) by which the report results are to be grouped.
- To include group header in the report, click Group Header Template.
The Template Config page appears with the list of columns from the selected datasource on the left-hand side of the page.- By default, in the Template Config page, a section with single-column (stack) layout is displayed. To change the layout, click the respective column icons. You can change the layout from single-column (stack) to six-columns.
- Drag and drop the columns into the section.
- If you want to add additional sections in the group header, click Add Section and drag and drop the required columns into that section.
- Click Save () icon to save the group header changes and go back to Report Maintenance tab.
- Click the Select Sortable Columns field and select the column(s) by which the report results are to be sorted.
- Click the Select Filterable Columns field and select the column(s) by which the report results are to be filtered.
Click the Select Allowed Formats field and select the formats in which the report can be generated. The following formats are supported: CSV, HTML, PDF, RTF, and XLS.
End users can generate reports in the application in the formats configured in the Select Allowed Formats field. For example, if CSV and HTML are selected for a report, end users can generate reports in the application in CSV and HTML formats only.
If you want to use resource bundles for the report column headers (column labels) specified in Select Columns to Display field, enter the name of the resource bundle property name in the Resource Bundle field and click Add Labels.
The Resource Bundle Entries page appears. By default, English language is selected in the Language drop-down list. You can select any other language for your application from the Language drop-down list.Enter the labels (captions) for each of the report headers in their respective fields and click Save.
A confirmation message appears.Click OK for the message.
Select the template for the report from the Select Report Template drop-down list. By default, CANVAS_DEFAULT is available as the template.
Select the font for the report from the Select Font drop-down list.
Enter the number of records to be displayed per page in the report in the Records Per Page field.
The following screen shot shows sample data for the report generation:The sample data shown on the screen shot relates to a Sales Order Report for which data is retrieved from a datasource. The Sales Order report will display the order details, such as Order ID, Order Date, Customer ID, Product ID, Product Name, Quantity, Price, and Sales Amount. The report will be generated in HTML and PDF formats.
Notice that the column names from the datasource contain underscores (e.g. Order_ID). Hence, a resource bundle called 'common' is used. This is a property file that contains the exact labels for each column name that you provided by clicking Add Labels. When the Sales Order report is generated, the column names will be replaced with the labels from the resource bundle.
Click Submit.
A confirmation message appears.Click OK for the message.
The new report is made available for the end users in the Information Reports workspace in the end application.
To edit the report created in Canvas Studio, refer Editing Reports. For executing (generating) reports in the application, refer Running Reports (Report Generation). For scheduling reports in the application, refer Scheduling Reports.