12
Creating a Report using iReport and its integration into hmhreportcockpit Creating a report using iReport Download iReport (Hybris supports iReport 4.0.2) Run the iReport4.0.2 software To create a new report go to Files new Blank A4 Open this Template Provide your ReportName, Location and click on finish For database connection: -click on the cylindrical icon(Report datasources) on the top bar new Database JDBC connection Here is an example of database JDBC connection settings: -Test and save your connection

Custom Report Tutorial

Embed Size (px)

Citation preview

Page 1: Custom Report Tutorial

Creating a Report using iReport and its integration into hmhreportcockpit

Creating a report using iReport

Download iReport (Hybris supports iReport 4.0.2) Run the iReport4.0.2 software To create a new report go to Files new Blank A4 Open this Template Provide your ReportName, Location and click on finish For database connection:

-click on the cylindrical icon(Report datasources) on the top bar new Database JDBC connection Here is an example of database JDBC connection settings:

-Test and save your connection

Page 2: Custom Report Tutorial

After all the above steps you should see a screen like this :-

The middle part of the screen has 3 sections:- Designer, XML and Preview1. Designer :

-This section is divided into 7 parts: Title, Page Header, Column Header, Detail 1 , Column Footer, Page Footer and summary (Self Explanatory). -Click on window and select palette. This will open a palette window on the right side.-You can drag and drop Report Elements from the palette window on the design page

2. XML:-This section is where you can modify the code-The query String is written in the xml page

3. Preview:- (always save and built your code before clicking on preview)-The preview shows you a preview of your report-The user specific parameters (if any) need to be specified before the report gets generated

Sample report (Designer):-

Page 3: Custom Report Tutorial

-The division of page for the above sample report:-Title – Upper orange portion (Labels and Text Field) Page Header - empty Column Header – DAY, PRODUCTID, PRODUCTNAME, TOTPRICE, TOTQUANTITY (Labels) Detail 1 – The details contains all the Text Fields (Explained in the xml section) Column Footer - emptyPage Footer– the middle orange portion (Text Fields) summary – Graph (chart)(All the above report elements are dragged from palette window)

-The Report Inspector on the left can be viewed for details

Page 4: Custom Report Tutorial

Sample Report (XML):-

-Parameters (From and To) are used to take user specified details (dates in the above case)-The queryString is used to fetch the data from the connected database-Fields(Designer’s TextFields) are used to display the fetched values

Page 5: Custom Report Tutorial

-Summary Chart:

-The series expression, categoryExpression and valueExpression basically represents the x and y axis of the sample graph. Modification of the same will lead to different graphical representations.

Page 6: Custom Report Tutorial

Sample report (Preview):- -As in this sample report we have two parameters for user specified data range (From and To), a window is prompted to enter the values.

-Depending on the inserted values the report gets generated

Page 7: Custom Report Tutorial
Page 8: Custom Report Tutorial

Integrating the report into hmhreportcockpit

Firstly, as the hmhreportcockpit displays only a single page report, for a multipage report you need to check the option of ‘ignore pagination ’ (found under properties as shown below)

Page 9: Custom Report Tutorial

Now, go to http://localhost:9001/hmhreportcockpit/index.zul (make sure your hybris server is up and running)

Click on create a new widget upload a new file Fill up the fields and upload the jrxml file Your screen should look like this:

And click on Done Edit the values of the parameters from the widget parameters section on the right This will generate the report.

Page 10: Custom Report Tutorial