This topic is locked

Complex Reports

4/6/2010 10:53:58 PM
PHPRunner General questions
J
jimbobaggins author

Hi

I have four tables

Account with name and address

Contact with person name and details

Project Header

Project Tasks
and two relation ship tables
project_accounts which ties an account to a project

project_contacts which ties projects to contacts
I want to create report or view or layout and a printer friendly layout that

displays similarly to a mail merge letter format or an invoice format
eg
Name at top from accounts

address from accounts below this
contact name below this
Project details below this
and finally all the task records below that.
I would also like to incorporate a letterhead style graphic at the top of the report.
I can join all the tables and get the data to display as a series of records with all

data on one line for each record in the project tasks file bu that is not what i want.
I have read about changing things in the data source?? but cant seem to find where this is.
I have tried moving things around in the editor but to no avail.
Am I asking too much or should I use MSoffice or open office base to achieve this.
thanks

jpedwardspost 4/12/2010

Hi Jim,
If you want to create the letters locally (ie on the users pc) you could export the data to xls or csv and process it using msoffice or openoffice mailmerge (as you mentioned).
If you want the user to be able to produce these letters 'on the fly' on the webserver it will be more complicated because you will need to hand over to a 'report writer' package or script.
One method I have used successfully and I think others on this forum have also used is to create your 'template letters' in your favourite wordprocessor and where you want the form data to appear just put in template field markers like ##NAME##, ##ADDRESS## etc then save these files as 'rtf' format.
Then pass the unique_id of the record to a php script which queries the data from the record and substitutes the template field markers with the actual data. This way the whole thing works on the webserver (no downloading of xls or csv). Also, if your using a 'nix webserver, it's pretty easy to convert the resulting rtf letter to a pdf document which of course can be read natively within the browser of the user without the user having to launch any external apps.
A bit of effort to set up but it works well.
Hope this gives you a few ideas,
Cheers,
JP.
PS to Admin,

This is a very common requirement - maybe include a feature where you can link an rtf template to a table and generated phprunner app gives functionality to automatically export record data into ##fieldname## variables to present data in user desired format :-).



Hi

I have four tables

Account with name and address

Contact with person name and details

Project Header

Project Tasks
and two relation ship tables
project_accounts which ties an account to a project

project_contacts which ties projects to contacts
I want to create report or view or layout and a printer friendly layout that

displays similarly to a mail merge letter format or an invoice format
eg
Name at top from accounts

address from accounts below this
contact name below this
Project details below this
and finally all the task records below that.
I would also like to incorporate a letterhead style graphic at the top of the report.
I can join all the tables and get the data to display as a series of records with all

data on one line for each record in the project tasks file bu that is not what i want.
I have read about changing things in the data source?? but cant seem to find where this is.
I have tried moving things around in the editor but to no avail.
Am I asking too much or should I use MSoffice or open office base to achieve this.
thanks