## Introduction ## Aperte Reports doesnt support report design - one has to create it externally. The recommended way is use for that purpose WYSIWYG editor like [iReport](http://jasperforge.org/projects/ireport). At this point, it is assumed that you are familiar with this tool and some technical details concerning it may be skipped. In case of any doubts, please refer to [iReport's documentation](http://jasperforge.org/website/ireportwebsite/IR%20Website/ir_documentation.html?header=project&target=ireport). In this part, you will learn how to create a report design and configure it in order to use with Aperte Reports. As a sample, we create a report presenting configured roles in Liferay and the number of users asigned to each role. Data for the report is fetched from Liferay's database by query: ```sql select name as role, count(*) as users from role_ r left join users_roles ur on (r.roleid = ur.roleid) group by name ``` Make sure that Aperte Reports will have access to the Liferay's database via JNDI resource. All Aperte Reports environment bundles are configured to expose that datasource, but if you configured your Liferay's installation, please add the following JNDI resource: ```xml ``` Example above presents Tomcat configuration, check documentation for your application server/container, if you are using different. ## Create a design in iReport ## 1. Open iReport and create a new file. 1. Launch Report Wizard. 1. Enter the name, configure datasource and type the query 1. Put _Chart_ element in the _Title_ band and two _Text Fields_ in the _Detail_ band 1. Add some descriptions 1. Adjust band size to improve report's readability 1. Test design by clicking _Preview_ ## Configure design in order to use it in Aperte Reports ## Aperte Reports requires datasource definition. Parameter _[datasource](ReportParameters#Report_datasource_parameter.md)_ should point to a JNDI connection resource. In iReport, add new _parameter_ and enter the expression as a _description_ property: ``` java:comp/env/jdbc/liferay ``` ## Summary ## After those steps, you should have a jrxml file with content like [this](SampleReportDesigns#Liferay_User_Roles.md). Generated report should be similiar to the one on the picture below. ![http://wiki.aperte-reports.googlecode.com/git/img/tutorial/lur-report.png](http://wiki.aperte-reports.googlecode.com/git/img/tutorial/lur-report.png)