Radicore Forum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » RADICORE » How To » Dynamic Report Column Headings
Dynamic Report Column Headings [message #1895] Thu, 04 December 2008 11:55 Go to next message
gpatti is currently offline  gpatti
Messages: 283
Registered: August 2008
Senior Member
In FAQ 109 you describe how screen column headings can be changed dynamically. Can the same type of functionality be reproduced for report column headings?
Re: Dynamic Report Column Headings [message #1896 is a reply to message #1895] Thu, 04 December 2008 13:02 Go to previous messageGo to next message
AJM is currently offline  AJM
Messages: 2347
Registered: April 2006
Location: Surrey, UK
Senior Member
The contents of the report structure file is read into $GLOBALS['report_structure'] at the start of the script, and this can be modified within any table class before it is processed. There are no purpose-built functions for this as yet.

Re: Dynamic Report Column Headings [message #1897 is a reply to message #1895] Thu, 04 December 2008 18:37 Go to previous messageGo to next message
gpatti is currently offline  gpatti
Messages: 283
Registered: August 2008
Senior Member
Can't get this to work. I'm trying to modify column headings within _cm_pre_output() for the class being printed by setting $GLOBALS['report_structure']['body']['fields'][n] but the values set in the report structure file are still being printed.

Could you provide some further pointers please?

Thanks,

Graham
Re: Dynamic Report Column Headings [message #1898 is a reply to message #1897] Thu, 04 December 2008 19:07 Go to previous messageGo to next message
AJM is currently offline  AJM
Messages: 2347
Registered: April 2006
Location: Surrey, UK
Senior Member
After looking at the code I see that the contents of $GLOBALS['report_structure'] is moved to $this->structure when the PDF class is instantiated.

Re: Dynamic Report Column Headings [message #1899 is a reply to message #1895] Fri, 05 December 2008 10:16 Go to previous messageGo to next message
gpatti is currently offline  gpatti
Messages: 283
Registered: August 2008
Senior Member
Still not getting this to work, Tony. Whatever I change in either $this->report_structure or $this->structure is not getting through to the output document.

Re: Dynamic Report Column Headings [message #1900 is a reply to message #1899] Fri, 05 December 2008 13:44 Go to previous messageGo to next message
AJM is currently offline  AJM
Messages: 2347
Registered: April 2006
Location: Surrey, UK
Senior Member
Try this update to version 1.42.0 which contains a new function called 'replaceReportHeadings($replace)' where $replace is an associative array. This in the format 'fieldname' => 'newlabel'. The function will examine the report structure file and where it finds 'fieldname' it will replace the existing label with 'newlabel'.

(attachment deleted, replaced in later post)


[Updated on: Sat, 06 December 2008 05:25]

Report message to a moderator

Re: Dynamic Report Column Headings [message #1901 is a reply to message #1895] Fri, 05 December 2008 18:44 Go to previous messageGo to next message
gpatti is currently offline  gpatti
Messages: 283
Registered: August 2008
Senior Member
Well it does work except for a small error on your part! Lines 3107 and 3108 in include.general.inc refer to $screen_structure instead of $report_structure. I've changed that in my copy and it works great.

Thank You
Re: Dynamic Report Column Headings [message #1902 is a reply to message #1901] Sat, 06 December 2008 05:25 Go to previous message
AJM is currently offline  AJM
Messages: 2347
Registered: April 2006
Location: Surrey, UK
Senior Member
Whoops! Embarassed That's what happens when you test the code and then "improve" it.

Here is a corrected version of that update.


Previous Topic: Search for field in related table
Next Topic: How to make a list2 on a non existing child table
Goto Forum:
  


Current Time: Tue Apr 23 10:33:33 EDT 2024

Total time taken to generate the page: 0.01151 seconds