Topic: Report Generator

Today we added a new add-on module, Report Generator. It is quite a comprehensive module. There are some example reports there to get started. There is also a manual.html inside the installed directory. Have fun!!
Please notice that this module is only available from release 1.14 of FrontAccounting.

/Joe

Re: Report Generator

Hi all -

Does the Report Generator work with the current (2.3.12) version of Front Accounting? I have tried to run it, but because it seems that its SQL installation doesn't get run when it was installed via the FA extension manager, I had to run that manually.

Now, when I run a report, I just get a blank screen without input.  Thoughts?

Re: Report Generator

Try to set the flag, $go_debug = 1 in file config.php. This will trap any errors.

/Joe

Re: Report Generator

I've done that, and now with the pre-built reports through Report Generator I get a variety of errors - some are strings not formatted an expected way, some are other PHP errors, and one of the reports still returns a simply blank screen.

I'm asking really if anyone has had the report generator working in 2.3.12; it seems that there's been sufficient enough changes in the codebase since 2.3.9 (which the module identifies with) to render the plugin useless.

I basically want a budget variance report - one that compares inputed budgeted numbers for this fiscal against actuals from last year. I know that I can do this in Excel with FA data, but even trying to do the report generates a bazillion errors that I can't immediately sort.

As a suggestion, I would recommend that the FA modules repository have a "compatible until" column that would act as a filter against the current version, to prevent installation of modules that don't work with the core code.

Re: Report Generator

If the errors have to do with PHP v5.3 in the PDF generation then Mercurial ChangeSet 3107  fixes it. This fix is after the release of v2.3.13.

Re: Report Generator

I installed repgen on top of version 2.3.13.
When I run the existing sample report, it works fine.
But when I create my own report and go to the next step (Page Definition for Strings), the button Store Item does not have any effect, and the list of items stays empty. When I run the report, I have a blank pdf.
Also, clicking on the button "Back to Select a report" I stay on the same page.

I already tried the go_debug = 1 and 2, I applied the fix regarding ereg and preg in the file reporting/includes/Workbook.php, but this still doesn't help.

I also applied the fix in repgen_const.inc:
//$_SESSION['get_text']->add_domain($_SESSION['language']->code, $path_to_root.'/modules/repgen/lang');
$GetText->add_domain($_SESSION['language']->code, $path_to_root.'/modules/repgen/lang');

Still not working.

My PHP version is PHP 5.3.3.

Does someone have repgen working with 2.3.13?

Any suggestion?

Re: Report Generator

any errors in the logs?
Windows / Linux OS?
Any line endings issue?

Re: Report Generator

No information from the logs. apache logs do not give anything, and go_debug=1 or 2 also.
OS is Linux Centos.

9 (edited by apmuthu 12/20/2012 06:10:15 pm)

Re: Report Generator

Along with $go_debug, try $sql_trail as well and check the trail table.

Try the latest FA v2.3.13 Mercurial Build 3127 (it contains a few patches for installing modules)  from scratch - do not try restoring any previous data and do a fresh install of the module and then fix any errors in the module files and try.

Re: Report Generator

I made a frech install based on the lattest build 3127.
Install is ok and works fine.
Then I installed the module Report Generator through the application.
Surprisingly, the module is not visible in the Setup -> Maintenance section.
I checked the Access setup, for the role of Administrator, the module report generator do not appear in the table of Access also.

I tried to access the report generator directly from the URL and got the following error message:
(url: http://mysite.com/frontacc_m/modules/repgen/repgen_select.php)

Undefined index: SA_REPORT_GENERATOR in file: /var/www/html/twenty-test/frontacc_m/includes/current_user.inc at line 155

I can provide access to this fresh install as admin, as I will remove it after problem is solved.

11 (edited by apmuthu 12/22/2012 01:09:32 am)

Re: Report Generator

Compare the module's files with those from Sep 2010 (v2.3.0) taking into account the various extension parameters that have changed.

The error may be due to themodules/repgen/includes/acc_levels.php(must the file extension be.inc?) using the old style $security_areas. This file is not used now.

$security_areas['SA_REPORT_GENERATOR'] = array(SS_SPEC|155, _("Report Generator"));

Must the SS_SPEC|155 above be SS_REPORT_GENERATOR|130 ?

Optionally the missing single quote for thedefinein line 23 of modules/repgen/hooks.php:

I can see the Report Generator Menu link greyed out in Setup -> Maintenance on the right side. It gets corrected when we tick the Setup -> Access Setup last ":" role for System Administrator, then the Report Generator checkbox pops up and on ticking and saving, logging out and logging back in, the Report Generator works.

One correction may be needed in the modules/repgen/sql/reports.sql file at line 59, the id should be '6' instead of 'B1' which is for blocks.

Some extra report definitions have been culled out of www.fvr.ro and attached herewith. Since the table xx_reports has no primary key, it seems to be accumulating duplicate records.

The installed_extensions.php file in the webroot uses true/false for the 'active' attribute of the array whereas it is 0/1 in the company/#/installed_extensions.php files. Renumbering the array elements in both files in the same manner maintains status quo.


Can the FA Admins correct it and upload a new PKG?

Post's attachments

extra_reports_sql.zip 998 b, 5 downloads since 2012-12-21 

You don't have the permssions to download the attachments of this post.

Re: Report Generator

Hello Guys,

I have just removed my installation of repgen and done a new install/activate exstension, Report Generator.

First I created the instance and secondly I activated it for the Training Co.

Then I imported the /sql/reports.sql manually into phpMyAdmin for the database.

Then, when looking in Setup Tab, the Report Generator is disabled (gray).

Then, go into Access Setup and select the role and at the very bottom you see the report regenerator. Check it and also check the next item.

Logout the company and login again.

Now you should be able to enter the Report Generator. And run the first report.

/Joe

13 (edited by apmuthu 12/21/2012 10:48:56 pm)

Re: Report Generator

The key here is that the label Report generator for the group is not displayed in the roles and after uncommenting the debug code in admin/includes/security_roles.php (lines 217, 218) and turning $go_debug = 1 in the config.php, we get the following error:

Bad section 38200:
Undefined offset: 229888 in file: /var/www/frontac/admin/security_roles.php at line 219

The security role Report generator is displayed corrrectly but the group name (line preceeding it) "Report Generator:" is not displayed but only ":".

Re: Report Generator

This is strange, I didn't get any errors in my installation. I do have the latest HG repository included, of course.

/Joe

Re: Report Generator

At Line 219 of admin/includes/security_roles.php  the value of

$parms = array(229988, "Report Generator", 116)
$ext = 3
$sec = 130

Fresh install of hg 3127 with only the repgen module installed. Module works when activated and role enabled. Only the group label is not displayed.

Attached are the snapshots of before and after ticking the checkbox.

Post's attachments

sec_role_images.zip 5.6 kb, 3 downloads since 2012-12-21 

You don't have the permssions to download the attachments of this post.

Re: Report Generator

This is what I have here:

/Joe

Post's attachments

roles.png 9.5 kb, file has never been downloaded. 

You don't have the permssions to download the attachments of this post.

17 (edited by apmuthu 12/22/2012 01:25:20 am)

Re: Report Generator

Hi Joe, that is what I would like to have.

In the hg 3127, it appears that the hooks.php of the modules are loaded before the translation strings get added and hence the non display. This is so since the section string is available only when install_access() is invoked.
Incidentally, the module/includes/acc_levels.php file does not seem to get used anywhere at all.

As a temporary workaround, I have commented out the define for the SS_REPORT_GENERATOR in the module's hooks.php and altered the install_access() function to be:

        function install_access()
        {

                $security_sections['SS_SPEC'] = _("Special maintenance");

                $security_areas['SA_REPORT_GENERATOR'] = array(SS_SPEC|130, _("Report Generator"));

                return array($security_areas, $security_sections);
        }

and it now shows up under Special maintenance section group.

18 (edited by apmuthu 12/22/2012 03:53:29 am)

Re: Report Generator

Final Solution was the removal of a tab character after the "=" sign on line 23 in modules/repgen/hooks.php.
Any function that starts with an underscore should not have any preceding tabs in the current version of PHP (at least the one on Debian Squeeze) if immediately on the RHS of an assignment statement.

The PHP version tested was:

# php -version
PHP 5.3.3-7+squeeze14 with Suhosin-Patch (cli) (built: Aug  6 2012 20:08:59)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies

There are 83 files in the standard FA distribution having a tab preceding a gettext function - _("xxx") - usage and this has never been a problem. Only in this case it was an assignment to a variable (an array variable in this instance).

The attached patch addresses a similar "=\t" issue with modules/repgen/repgen_strings.php as well.

Bugs yet to be fixed:
On activating the Reports Generator extension, when we try to edit, delete or copy the first and only report in the default list, we get to see the report iself like pressing the Run button. The Edit, Copy and Delete functionality seems lost.

Post's attachments

repgen_FA.patch.zip 627 b, 4 downloads since 2012-12-22 

You don't have the permssions to download the attachments of this post.

Re: Report Generator

On my side, I have the 3127 install running with only repgen, the 3 sample reports run fine now, but still the button store item does not store anything. It makes it impossible for me to create a report with real content.

Also, the edit or delete buttons in the items list are not fonctionning.

What can I do?

When I click on the store item button, here are the requests that appear in mode saltrailer = 1:

select * from 0_chart_master,0_chart_types,0_chart_class where account_type=id and class_id=cid order by account_code
SELECT attrib FROM xx_reports WHERE typ='funct'
SELECT * FROM xx_reports WHERE typ = 'block'
SELECT  * FROM xx_reports WHERE (typ = 'item' AND id='6')

There is no insert instruction.

Re: Report Generator

Moving further discussion on this topic to get report generator working fully to the new thread.