Output2 - Options / 90° cell rotation [message #7361] |
Mon, 30 September 2019 09:55 ![Go to next message Go to next message](/theme/default/images/down.png) |
htManager
Messages: 427 Registered: May 2014
|
Senior Member |
|
|
Can I rotate the cell values? I try to explain it with the next lines:
........| | | | | |
Line 1 x x x o x o
Line 2 x o x x x o
...
The pipes are the headings 90° rotated. So I could generate my (Pivot-table) report on one page.
[Updated on: Mon, 30 September 2019 09:55] Report message to a moderator
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Re: Output2 - Options / 90° cell rotation [message #7383 is a reply to message #7382] |
Tue, 22 October 2019 07:14 ![Go to previous message Go to previous message](/theme/default/images/up.png) ![Go to next message Go to next message](/theme/default/images/down.png) |
AJM
Messages: 2361 Registered: April 2006 Location: Surrey, UK
|
Senior Member |
|
|
This is the sequence of events in the OUTPUT2 pattern:
1) The report structure file is read into memory during execution of the initsession() function.
2) The following methods are called: $dbobject->initialise(), $dbobject->getExtraData(), $dbobject->getData_serial().
3) The PDF object is instantiated and the $pdf->outputPDF_ListView() method is called which has the following steps:
3.1) Call the $dbobject->_cm_pre_output() method.
3.2) Call the $pdf->listView() method which has the following steps:
3.2.1) Call $dbobject->fetchRow().
3.2.2) Call $dbobject->_cm_post_fetchRow().
3.3.3) Call $pdf->listView_print().
3.3.4) Call $dbobject->_cm_formatData().
3.3.5) Call $pdf->listView_assemble_row() for each column.
3.3.6) Call $pdf->printRow() to output the row to the PDF document, which calls the following at the start of each page:
3.3.6.1) Call $dbobject->_cm_ListView_header()
3.3.6.2) Call $pdf->Header() to print the page heading.
3.3.6.3) Output the column labels.
While testing this I discovered that the ability to use dynamic column labels was not available, so I have amended std.pdf_list.class.inc (which is attached) to add this ability. To use this feature you need to do the following:
a) In your report structure file change the column label from a literal to '%%id' where 'id' is the label identity.
b) In your object's _cm_ListView_header() method (see step 3.3.6.1 above) insert code similar to the following:
$this->dynamic_column_headings = array('id' => 'whatever');
This will then enable the step at 3.3.6.3 (which I have amended) to replace '%%id' with 'whatever'.
Try it and see.
Tony Marston
http://www.tonymarston.net
http://www.radicore.org
|
|
|
|
|
|
|
Re: Output2 - Options / 90° cell rotation [message #7394 is a reply to message #7383] |
Sat, 14 December 2019 07:23 ![Go to previous message Go to previous message](/theme/default/images/up.png) ![Go to next message Go to next message](/theme/default/images/down.png) |
htManager
Messages: 427 Registered: May 2014
|
Senior Member |
|
|
At the moment I can create the report header as I wanted as you can see in the attached screen shot.
My problem now is that I have the same value in all coloumns.
In the cm_formatData() method I can collect the data for the row by an array. But how to send them to the report? Is there a possibility such as for the header columns like "$this->dynamic_column_headings = array('id' => 'whatever');"?
But I think I do not know how it definitely works. In my report body there is always the same field specified. So it should be always the same value....
$structure['body']['fields'][] = array('spiele_anwesenheit_status' => '%%2');
$structure['body']['fields'][] = array('spiele_anwesenheit_status' => '%%3');
$structure['body']['fields'][] = array('spiele_anwesenheit_status' => '%%4');
$structure['body']['fields'][] = array('spiele_anwesenheit_status' => '%%5');
[Updated on: Sat, 14 December 2019 09:59] Report message to a moderator
|
|
|
Re: Output2 - Options / 90° cell rotation [message #7395 is a reply to message #7394] |
Sun, 15 December 2019 04:03 ![Go to previous message Go to previous message](/theme/default/images/up.png) ![Go to next message Go to next message](/theme/default/images/down.png) |
AJM
Messages: 2361 Registered: April 2006 Location: Surrey, UK
|
Senior Member |
|
|
That screenshot shows that you have modified the report headings OK, but when it comes to the data which is shown in each column it is the contents of $fieldarray which counts. The _cm_formatData() method deals with one row at a time which means that $fieldarray is an associative array of $fieldname => $fieldvalue pairs. All you need to do is insert the right $fieldvalue for each $fieldname.
Tony Marston
http://www.tonymarston.net
http://www.radicore.org
|
|
|
Re: Output2 - Options / 90° cell rotation [message #7396 is a reply to message #7395] |
Tue, 31 December 2019 12:23 ![Go to previous message Go to previous message](/theme/default/images/up.png) ![Go to next message Go to next message](/theme/default/images/down.png) |
htManager
Messages: 427 Registered: May 2014
|
Senior Member |
|
|
I finally got the result that I want. I attached a report. Now there is one thing left which I want to correct. If I generate the names for the heading with "\n" I have problems with the sequence ma. It seems that m . "\n" will cause an empty row as you can see in the report. The other problem are the german characters ä, ö, ü. Can you give me a hint how I can deal with this?
I actually have this code:
for ($sp=0; $sp<$stringlaenge; $sp++)
{
$spielernameoutput = $spielernameoutput . substr($spielername, 0, 1) . "\n";
$spielername = substr($spielername, 1, $stringlaenge - $sp);
}
[Updated on: Tue, 31 December 2019 12:30] Report message to a moderator
|
|
|
|
Re: Output2 - Options / 90° cell rotation [message #7398 is a reply to message #7397] |
Thu, 02 January 2020 03:50 ![Go to previous message Go to previous message](/theme/default/images/up.png) ![Go to next message Go to next message](/theme/default/images/down.png) |
htManager
Messages: 427 Registered: May 2014
|
Senior Member |
|
|
I use Times for the column headings.
Here is the pdf.styles.inc entry:
$style['hdg_anwesenheit']['font'] = array('family' => 'Times', // Courier, Helvetica, Times
'style' => '', // blank=Regular, B=Bold, I=Italic, U=Underline
'size' => 9, // size in points
'height' => 3.9, // line height in units
'draw' => .3, // width of drawn lines
'overflow' => y, // overflow
'border' => '1', // position of border lines
'halign' => 'left'); // horizontal text alignment (left, right, center)
|
|
|
|
|
|
|
|
|
|
|