PHPackages                             eidsonator/semantic-reports-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Admin Panels](/categories/admin)
4. /
5. eidsonator/semantic-reports-bundle

ActiveLibrary[Admin Panels](/categories/admin)

eidsonator/semantic-reports-bundle
==================================

A Symfony2+ Bundle for displaying reports from any data source, including SQL and MongoDB

1641PHP

Since Apr 27Pushed 10y ago2 watchersCompare

[ Source](https://github.com/eidsonator/SemanticReportsBundle)[ Packagist](https://packagist.org/packages/eidsonator/semantic-reports-bundle)[ RSS](/packages/eidsonator-semantic-reports-bundle/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Semantic-ui Reports Bundle
==========================

[](#semantic-ui-reports-bundle)

**Now works with Symfony2.x and Symfony3.x**

A Symfony bundle for managing and displaying nice looking, exportable reports from any data source, including SQL and MongoDB.

Major features include:

- Display a report from any data source that can output tabular data (SQL, MongoDB, PHP, etc.)
- Output reports in HTML, XML, CSV, JSON, or your own custom format
- Add customizable parameters to a report (e.g. start date and end date)
- Add graphs and charts with the Google Data Visualization API
- Supports multiple database environments (e.g. Production, Staging, and Dev)
- Fully extendable and customizable

Installation &amp; Documentation
--------------------------------

[](#installation--documentation)

[Installation &amp; Documentation](https://github.com/eidsonator/SemanticReportsBundle/blob/master/Resources/doc/index.md) can be found in /Resources/doc/

Reporting an issue or a feature request
---------------------------------------

[](#reporting-an-issue-or-a-feature-request)

Issues and feature requests can be submitted to the [Github issue tracker](https://github.com/eidsonator/SemanticReportsBundle/issues).

Basic Introduction
------------------

[](#basic-introduction)

Reports are organized and grouped in directories. Each report is it's own file.

A report consists of headers containing meta-data (e.g. name and description) and the actual report (SQL queries, javascript, or PHP code).

All reports return rows of data which are then displayed in a sortable/searchable HTML table.

Reports can be exported to a number of formats including CSV, XLS, JSON, and XML.

The Php Reports framework ties together all these different report types, output formats, and meta-data into a consistent interface.

Example Reports
---------------

[](#example-reports)

Here's an example SQL report:

```
-- Products That Cost At Least $X
-- VARIABLE: {"name": "min_price"}

SELECT Name, Price FROM Products WHERE Price > "{{min_price}}"
```

The set of SQL comments at the top are the report headers. The first row is always the report name.

The `VARIABLE` header tells the report framework to prompt the user for a value before running the report. Once provided it will be passed into the report body ("{{min\_price}}" in this example) and executed.

Here's a MongoDB report:

```
// List of All Foods
// MONGODATABASE: MyDatabase
// VARIABLE: {
//   "name": "include_inactive",
//   "display": "Include Inactive?",
//   "type": "select",
//   "options": ["yes","no"]
// }

var query = {'type': 'food'};

if(include_inactive == 'no') {
    query.status = 'active';
}

var result = db.Products.find(query);

printjson(result);
```

As you can see, the structure is very similar. MongoDB reports use javascript style comments for the headers, but everything else remains the same.

The MONGODATABASE header, if specified, will populate the 'db' variable.

Here's a PHP Report:

```

```

Again, the header format is very similar.

The INCLUDE header includes another report within the running one. Below is example content of /stripe.php:

```
