In this recipe, we will guide you through the steps required to simply get data in the quickest fashion from MongoDB using a feature of the Pentaho Report Designer called the Report Designer Wizard. This wizard helps us to define our connection to the MongoDB data source, as well as to define a query that is to be executed to get data into our report.
To get ready for this recipe, you first need to start the MongoDB server with the same database as in the last chapter. You will also want to start the Pentaho Report Designer.
The Pentaho Report Designer is started in Windows as follows:
This can be done via the Windows Start menu by navigating to Start | All Programs | Pentaho Enterprise Edition | Design Tools | Report Designer and then by clicking on the report designer icon.
The Pentaho Report Designer is started in Linux as follows:
Open up a terminal and navigate to the PentahoEE/design-tools/report-designer
folder. Execute the report-designer
bash script using ./report-designer.sh
.
When the Report Designer loads, you should be presented with a Welcome screen.
In this section, we are going to create a simple report using the Pentaho Report Design Wizard and the data from MongoDB:
{ $query: {}, $orderby: { customer.address.country:1, customer.address.city:1, product.line:1, } }
{ customer.address.country:1, customer.address.city:1, product.line:1, totalPrice:1 }
Now that the query has been defined, you should return to the main Report Wizard window with your query available to be selected.
The Report Wizard allows us to simply create a query and configure it to return the correct data in a couple of steps. Once we have the data from the query, we can then select what fields will be included in the report. With the query and report defined in the Report Wizard, we will be able to generate a report in the Pentaho Report Designer that will get us quickly started. From this point, we are free to edit the generated report further using the various tools that come with the Pentaho Report Designer.