The report builder creates reports by selecting a base object and reading the doctrine metadata for the relationships/fields on that entity. A user is able to select from the pre-configured base entities, the available display fields, and even filter the results.
Two different report types are available, aggregate and detailed. An aggregate report counts the number ov base elements that match the supplied filters. A detailed report simply gives all of the records.
Defining base elements is the critical part of creating ad-hoc reports. Which elements you need entirely depends on your schema and business needs. For example, if your application/reporting needs are focused on users, you would want the user entity listed. If you have an e-commerce system, you might want a "products", or an "order" entities listed.
Define your base entities in your config.yml
# config.yml brown298_report_builder: builder: base_entities: - 'Brown298\DtTestBundle\Entity\User'
As an example of building an aggregate report, in our demo section, we have a "user" table and a "faq" table. If we wanted to know for how many faq questions each user has created, we would create a report by selecting:
select count(User.id), User.firstName, User.lastName from User join Faq on User.id = Faq.created_by where Faq.question != '';