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

Home » RADICORE development » Transaction Patterns » Output2 - Options / 90° cell rotation
Output2 - Options / 90° cell rotation [message #7361] Mon, 30 September 2019 09:55 Go to next message
htManager is currently offline  htManager
Messages: 220
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 #7362 is a reply to message #7361] Tue, 01 October 2019 04:42 Go to previous messageGo to next message
AJM is currently offline  AJM
Messages: 2157
Registered: April 2006
Location: Surrey, UK
Senior Member
Not at present, but I will look into it.

Re: Output2 - Options / 90° cell rotation [message #7364 is a reply to message #7362] Tue, 01 October 2019 09:49 Go to previous messageGo to next message
AJM is currently offline  AJM
Messages: 2157
Registered: April 2006
Location: Surrey, UK
Senior Member
I cannot see any option for this is the TCPDF library, so I'm afraid that you are out of luck.

Re: Output2 - Options / 90° cell rotation [message #7365 is a reply to message #7364] Wed, 02 October 2019 05:33 Go to previous messageGo to next message
htManager is currently offline  htManager
Messages: 220
Registered: May 2014
Senior Member
What a pity. Thank you for looking for an option. Do you have any idea how I could solve this problem in a different way?
Re: Output2 - Options / 90° cell rotation [message #7366 is a reply to message #7365] Thu, 03 October 2019 05:26 Go to previous messageGo to next message
AJM is currently offline  AJM
Messages: 2157
Registered: April 2006
Location: Surrey, UK
Senior Member
If you look at https://www.tonymarston.net/php-mysql/output-to-pdf.html#col umn.widths.list you will see that it is possible for column labels to overflow onto the next line if the text is too wide for the cell width. It is also possible to insert the "\n" (newline) character between each letter to force it to overflow. Unfortunately I cannot see a way to rotate the text through 90 degrees, so you will still read it vertically.

Re: Output2 - Options / 90° cell rotation [message #7369 is a reply to message #7366] Fri, 04 October 2019 05:11 Go to previous messageGo to next message
htManager is currently offline  htManager
Messages: 220
Registered: May 2014
Senior Member
Thank you. I will try this out.
Re: Output2 - Options / 90° cell rotation [message #7370 is a reply to message #7369] Sat, 05 October 2019 11:51 Go to previous messageGo to next message
htManager is currently offline  htManager
Messages: 220
Registered: May 2014
Senior Member
In which method can I place best my code to modify the output? I want to show a 'x' for true and an '' for false. So I can see which player was present at a match.
In my pdf the 0 is always the presence of the first player in the first match. I think that I have to correct my SQL query in the controller script. Where can I dump the query result best?
Re: Output2 - Options / 90° cell rotation [message #7371 is a reply to message #7370] Sun, 06 October 2019 03:51 Go to previous messageGo to next message
AJM is currently offline  AJM
Messages: 2157
Registered: April 2006
Location: Surrey, UK
Senior Member
You can use the _cm_formatData() method which is the last method to be called before the data is passed to the PDF processor.

Re: Output2 - Options / 90° cell rotation [message #7377 is a reply to message #7371] Fri, 18 October 2019 12:38 Go to previous messageGo to next message
htManager is currently offline  htManager
Messages: 220
Registered: May 2014
Senior Member
At the moment I think I have found a way to generate my Pivot table but I need some further information from you.

1. In the _cm_initialise() method I query my table to find all relevant players and insert these as an array in $GLOBALS['']
2. In the _cm_formatData() method I now can investigate if the player was present or not present at the match. I do this with x or blank.

What I do not know is where to place best the code for the 90° heading variables as you told me with the "\n" character. I have seen that I can create the headings with variables like $structure['body']['fields'][] = array('spiele_anwesenheit_status_ausgabe' => $GLOBALS['Spielername01']);

The problem is that obviously the report structure file is called before the _cm_initialise() method so that the variable $GLOBALS['Spielername01'] is empty. The UML diagrams don't show the output pattern sequences. Can you tell me how I can solve this problem?
Re: Output2 - Options / 90° cell rotation [message #7378 is a reply to message #7377] Sat, 19 October 2019 04:21 Go to previous messageGo to next message
AJM is currently offline  AJM
Messages: 2157
Registered: April 2006
Location: Surrey, UK
Senior Member
Are these labels static or dynamic? If they are static you can define them with "\n" characters in the report.inc file. If they are dynamic then they need to be defined as fields instead of labels so that the contents of each field can be set in your code and not in the report.inc file. This is explained in https://www.tonymarston.net/php-mysql/output-to-pdf.html#tit le.contents - scroll down until you see you see the keyword "<text>" and the option for "%%<text>".

Re: Output2 - Options / 90° cell rotation [message #7379 is a reply to message #7378] Sat, 19 October 2019 08:21 Go to previous messageGo to next message
htManager is currently offline  htManager
Messages: 220
Registered: May 2014
Senior Member
The labels are dynamic. The number of colums can be different. But I think I have found a solution.

In my controller script I first call a method in one of my library inc files and there I run the query to get the number of colums and there I can create the labels. All this data I write to §GLOBALS so that I can read in the values in the report structure file.
Re: Output2 - Options / 90° cell rotation [message #7381 is a reply to message #7379] Sun, 20 October 2019 05:02 Go to previous messageGo to next message
AJM is currently offline  AJM
Messages: 2157
Registered: April 2006
Location: Surrey, UK
Senior Member
I'm glad you found a solution.

Re: Output2 - Options / 90° cell rotation [message #7382 is a reply to message #7381] Mon, 21 October 2019 04:53 Go to previous messageGo to next message
htManager is currently offline  htManager
Messages: 220
Registered: May 2014
Senior Member
There is one problem left. When will the report structure file be initialised? If I call my method at the begin of the controller script I do not have the values (in $GLOBALS) for querying the table. If I want to do this in the _cm_initialise() method of the class, the report structure file and the field labels are already "initialised" and I can't change them anymore.
Do you have a documentation about the sequences of the methods?
Re: Output2 - Options / 90° cell rotation [message #7383 is a reply to message #7382] Tue, 22 October 2019 07:14 Go to previous messageGo to next message
AJM is currently offline  AJM
Messages: 2157
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.


Re: Output2 - Options / 90° cell rotation [message #7384 is a reply to message #7383] Wed, 23 October 2019 16:53 Go to previous messageGo to next message
htManager is currently offline  htManager
Messages: 220
Registered: May 2014
Senior Member
Thank you very much for the detailed documentation and the Explanation. I think, tomorrow I will have time to get on work again at my problem. But I can't download the std.pdf_list.class.inc. There is always an http 403 error. Do I have to do something else?
Re: Output2 - Options / 90° cell rotation [message #7385 is a reply to message #7384] Fri, 25 October 2019 04:37 Go to previous messageGo to next message
AJM is currently offline  AJM
Messages: 2157
Registered: April 2006
Location: Surrey, UK
Senior Member
Try this zip file instead.

Re: Output2 - Options / 90° cell rotation [message #7386 is a reply to message #7385] Fri, 25 October 2019 07:49 Go to previous messageGo to next message
htManager is currently offline  htManager
Messages: 220
Registered: May 2014
Senior Member
The same problem. I see a white screen and this: http://forum.radicore.org/index.php?t=getfile&id=558& ;
Re: Output2 - Options / 90° cell rotation [message #7387 is a reply to message #7386] Sat, 26 October 2019 04:45 Go to previous message
AJM is currently offline  AJM
Messages: 2157
Registered: April 2006
Location: Surrey, UK
Senior Member
Strange, that's never happened before. I will send you a copy in a private message.

Previous Topic: Output2 - SQL
Next Topic: Introduction to Transaction Patterns within Radicore
Goto Forum:
  


Current Time: Sat Dec 07 18:01:58 EST 2019

Total time taken to generate the page: 0.01436 seconds