Welcome Guest, Not a member yet? Register   Sign In
Report Writer

I have created a basic report writer in Codeigniter. I just released it so it is still a little rough. I am opening it up to the community for use. I would love it if people wanted to update and help to upgrade it. I put up an whole project with the report writer code in it so you can see how it works.

Check it out...I wanted to let the entire community know but was not sure where to post it....


Mind expanding a bit on what this actually does? "report writer" can be many, many different things.

Oh yes good point. So it is a basic and simple SQL based report generator. you can select tables, fields and create joins using a GUI. At the moment there is no grouping or summing, I hope to add that at some point. It also supports exporting the data to excel using Phpexcel.

Again it is very basic but I wanted to share it with people, maybe it would be useful to someone. In my search there was nothing that came close to this for free.


The configuration file does not exist.

how to install the helper? or how to run the sample?


Sorry for the delay in the post. You should be able to download the project. Then you can extract the items needed and place in your project. I have not setup a stand alone plugin before so I put up what people needed. I certainly could have done a better job.

The main components are



third_party directory

views/* (All files in the views folder)

There are some routes in the the routes.php file that you will need.

$route['default_controller'] = "createreportctlr";
$route['selecttable'] = "createreportctlr/selecttable";
$route['edit-report/(:num)'] = "createreportctlr/editreport/$1";
$route['selecttable/(:num)'] = "createreportctlr/selecttable/$1";
$route['selectcolumn'] = "createreportctlr/selectcolumn";
$route['getTableColumn'] = 'createreportctlr/getTableColumn';
$route['setcondition'] = 'createreportctlr/setCondition';
$route['getexcelexport/(:num)'] = 'createreportctlr/getExcelExport/$1';
$route['removehistoryrecord'] = 'createreportctlr/removehistoryrecord';

and then there are some items for declaring the tables you want to show. you can put them in a separate config file or in the config.php. This line is used to select the tables you want someone to have the ability to report from. (Sample tables are in there).

$config['database_reports_tables'] = array('company'=>'Company','department'=>'Department','inventory'=>'Inventory');

There are some items that need cleaned up in the model. below is the sql you need which I forgot to put in the project.

CREATE TABLE IF NOT EXISTS `historyreportsfields` (
`pkHistoryReportsFieldID` int(11) NOT NULL AUTO_INCREMENT,
`fkReportHistoryID` int(11) NOT NULL,
`AllTablesName` text NOT NULL,
`SelectedTablesName` text NOT NULL,
`SelectedColumns` text NOT NULL,
`AllConditions` text NOT NULL,
`SelectedSortByColumnName` varchar(255) NOT NULL,
`SelectedSortOrder` varchar(255) NOT NULL,
`RecordsPerPage` int(11) NOT NULL,
`SaveReport` varchar(255) NOT NULL,
PRIMARY KEY (`pkHistoryReportsFieldID`)

CREATE TABLE IF NOT EXISTS `reporthistory` (
`pkHistoryID` int(100) NOT NULL AUTO_INCREMENT,
`ReportName` varchar(255) NOT NULL,
`SqlQuery` text NOT NULL,
PRIMARY KEY (`pkHistoryID`)

Sorry it really needs to be refined and cleaned up but I needed to crank something out fast....hope this helps.

Theme © iAndrew 2016 - Forum software by © MyBB