1 (edited by apmuthu 12/22/2012 05:38:29 am)

Topic: Fixing Usage - report generator

Now that the report generator has been installed lets fix the usage issues.

1. Page cache affects it as the php pages are now dished out from the modules/repgen folder.

2. Quotes and other special characters being escaped and stored in db causing issues when editing.

3. After pressing the run button on any report all other types of buttons are disabled / act as run button.

Re: Fixing Usage - report generator

There are many statements like:

$query="INSERT INTO xx_reports VALUES ('".$id."','info','".$info."')";

in the repgen extension that need to be wary of single quotes getting into the strings like $info....

3 (edited by apmuthu 12/22/2012 05:39:22 am)

Re: Fixing Usage - report generator

The following original sql statement from reports.sql:

INSERT INTO `xx_reports` (`id`, `typ`, `attrib`) VALUES
('F2', 'funct', 'atime|2007-09-21|Bauer|Actual Time|function atime() {return date("h:i a");}');

on editing the author field becomes:

INSERT INTO `xx_reports` (`id`, `typ`, `attrib`) VALUES 
('F2','funct','atime|2012-12-22|Joe|Actual Time|function atime() {return date(&quot,h:i a&quot,),}');

whereas it should have at worst been:

INSERT INTO `xx_reports` (`id`, `typ`, `attrib`) VALUES 
('F2','funct','atime|2012-12-22|Joe|Actual Time|function atime() {return date(\"h:i a\");}');

Re: Fixing Usage - report generator

@apmuthu,

I see a lot of changes and you sent me a part patch for repgen. maybe better if you send me a new repgen.zip package. Will you do that apmuthu?
I will then send it to the repository.

/Joe

Re: Fixing Usage - report generator

Attached here is the v2.3.13-1 version of the repgen Report Generator Extension incorporating corrections done so far.

Includes 2 fixes for the tab succeeding an "=" sign and preceeding a gettext translation "_("xxx").

Includes extra page sizes (but stays commented out) in the repgen.inc file

Fixed the manual.html for wrong link and removed the form tags in it.

reports.sql - cleaned up and organised by typ and id with standard delimiters with fields of double quote.

Post's attachments

repgen_v2.3.13-1.zip 151.8 kb, 15 downloads since 2012-12-23 

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

6 (edited by apmuthu 12/24/2012 05:52:23 pm)

Re: Fixing Usage - report generator

Currently the following are observed:
1. Create new block works.
2. Create new function works and the code gets stored anew as the htmlentities version that is acceptable as long as no single quotes are used.
3. Test button in create new function does not work when any quote - single or double - are used. It works for any function with nothing after the function name - assuming that the function exists as part of some include(d) file.
4. Create new report results in only the report info, select and group entries being stored and the items and graphics are not stored nor are they editable - possible glitch due to db_query["BEGIN"] being used with no db_query["END"] but just a db_query["COMMIT"] assuming even that stored procedure / trigger rights are available for the MySQL user.
5. On the reports listing page, if we run any report, then subsequently all other buttons - Edit, Delete, Copy - also just run the reports.

Preliminary code reading / divining suggests that
1. some cache / globals parsing issue is involved in 5 above.
2. globals missing out on report id when passing to the strings and graphics page in 4 above. A mixture of POST and GET besides conflicting cleaning of GET and POST duplication efforts may be involved.
3. multiple escaping of quotes and / or php.ini settings different from the recommended ones being in use in some parts of the code in item 3 above for eval issues.

All Edit is done by deleting the existing record and inserting a new one in it's place - this can be more efficiently done using an update statement. "Update on insert fail" type of construct will fail as there is no primary key and the "where" can be ambiguous.

Wikied the above.

Re: Fixing Usage - report generator

Ok, thank you for all your answers.
Now should we wait for the next release to have repgen working on 2.3.13+?

Re: Fixing Usage - report generator

Will need a bit of work to get it fully working. Check the wiki link in my previous post for the current state.

Re: Fixing Usage - report generator

The Report Generator module code has been adopted as FA extension long time ago despite it contains many design issues. We have provided it anyway, to give some base for better solution development to any interested third party programmers.

Keep in mind, that in current state the module should never (it means NEVER) be used on FrontAccounting installations working in not fully trusted environment.

Treat this warning seriously: due to still existing vulnerabilities this extension should not be installed on any servers accessed from external net. This warning has been included in extension package info, but better safe than sorry, so I have added the info to wiki too.

Janusz

Re: Fixing Usage - report generator

Thanks Janusz.

Re: Fixing Usage - report generator

RepGen Extension v2.3.9-3 has been updated to v2.3.13-1 in my personal GitHub repo.

Re: Fixing Usage - report generator

Good day. Could you help me.

I tried installing repgen from Setup>maintenance>install extension. report generator did not appear, in the setup tab.

I tried manual install of repgen and followed https://frontaccounting.com/fawiki/index.php?n=Devel.FAReportGenerator, I still could not make rep gen appear in my setup tab.

any other tips?

13 (edited by apmuthu 09/12/2013 12:12:35 pm)

Re: Fixing Usage - report generator

Re-Updated the RegGen v2.3.9-3 extension to v2.3.13-1 at my personal GitHub Repo.
View Git ChangeLog.

The real change is in the sql file and hence the table xx_reports must be updated.

The changed files are attached in this post..

Change the installed_extensions.php files at the webroot and the company specific folder as well to reflect the change in version of the extension.

Post's attachments

repgen_2.3.9-3_to2.3.13-1.zip 22.7 kb, 5 downloads since 2013-09-12 

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

Re: Fixing Usage - report generator

thanks apmuthu. i was able to install rep gen and was able to access it. unfortunately stumbled into another problem on opening repgen

Debug mode database warning:
error code : 1146
error message : Table louie_Acc.xx_reports' doesn't exist
sql that failed was : SELECT * FROM xx_reports WHERE (typ = 'info' OR typ = 'block' OR typ = 'funct') ORDER BY id

mysql_fetch_array(): supplied argument is not a valid MySQL result resource in file: /home1/louie/public_html/ad/louie_Acc/includes/db/connect_db.inc at line 89

Should i manually add xx_reports to my database?

Re: Fixing Usage - report generator

Yes, it is because your initial install may not have proceeded correctly. Manually create it from the sql in the extension.

Re: Fixing Usage - report generator

Thanks. apmuthu. Was able to make it run by manually inserting the table.  now time to test the extension

Re: Fixing Usage - report generator

apmuthu - I have been looking at the previous topics regarding RepGen. 

Firstly, I would just like to say thank you for the significant contribution you made in making this extension work. Kudos.

I am having trouble in using it, i guess you are in the best position to point me in the right direction.

here are my problems:
1. i tried making a report. My SQL statement is working fine when tested. but when i hit run i get a blank pdf file.
2. page definition for strings - store item button does not work. it does not save any item at all.

have checked debug - no error were recorded

18 (edited by apmuthu 09/29/2013 06:00:47 pm)

Re: Fixing Usage - report generator

Check in Firefox browser with java plugin enabled.
Also some temp or cache folder may not have write access by the webserver user.

Unfortunately, despite my having put up the code both here and in my personal repo, the official repo does not want to get update the package as it is considered vulnerable.... The rationale here is possibly to retain a non working package for users to hack it themselves rather than a partially hacked version that will still require hacking albeit a lot less and yet usable.

Re: Fixing Usage - report generator

this report generator would not working from my side because when ever we clicked to run, edit, delete, copy button its not working and specially its always show me demo page and error,

demo page include the demo page number module/function/
and error includes TCPDF error: Unable to create output file: /0/pdf_files/6.pdf

version is:     2.4.0-4    2.4.0-4

can you let me know how can resolve this issue and also give me some examples for this

Re: Fixing Usage - report generator

Upgrade to FA 2.4.4 Git Master version and use the FA 2.4.x version of the report generator extension at https://github.com/apmuthu/FA24extensions/tree/master/Extensions/repgen

Re: Fixing Usage - report generator

hey,
thanks,
well i will take a look in it,

can you please let me know how i remove default extension from install area so i can upload files manually at modules/folder and install it,
let me know about that

area of image here : https://imgur.com/a/csUOjUP

regards

Re: Fixing Usage - report generator

Its the reverse of installation - Deactivate it for all companies - then delete it using the red cross - then delete the folder.

Then upload the ext.

The FrontAccounting Wiki(Manual, examples, tips, setup info, links to accounting sites, etc) https://frontaccounting.com/fawiki/

Re: Fixing Usage - report generator

hey,
which folder i need to delete?

Re: Fixing Usage - report generator

??? the ext folder in '/modules/' that you want to delete and then install manually

The FrontAccounting Wiki(Manual, examples, tips, setup info, links to accounting sites, etc) https://frontaccounting.com/fawiki/

Re: Fixing Usage - report generator

i think the extension folder automatically deleted after clicking the red cross button.
second when i install it manually it would not work for me, any demo / tutorial is available for this new version and second when i place a folder of extension in module folder e.g modules/repgen this module is not found at install extension link its only show me version 2.4.0.4 rather then new upload folder.
and manually install is not work for me....