Home » RADICORE development » Framework » PDF - horizontal line in title zone
|
Re: PDF - horizontal line in title zone [message #5632 is a reply to message #5631] |
Wed, 15 June 2016 06:20   |
AJM
Messages: 2381 Registered: April 2006 Location: Surrey, UK
|
Senior Member |
|
|
I have done this in one of my outputs. Here is the code I used:
$structure['title'][] = array('text' => '',
'style' => 'rule',
'width' => '100%',
'y_relative' => 2.5,
'newline' => 'y');
This is what I had in my pdf.styles.inc file:
$style['rule']['font'] = array('family' => 'Times', // Courier, Helvetica, Times
'style' => '', // blank=Regular, B=Bold, I=Italic, U=Underline
'size' => 1.75, // size in points
'height' => 0.75, // line height in units
'draw' => 0); // width of drawn lines
$style['rule']['fillcolour'] = array(113,113,113); // colour for background
$style['rule']['textcolour'] = array(0,0,0); // colour for foreground
$style['rule']['drawcolour'] = array(0,0,0); // colour for line drawing
Easy peasy lemon squeezy (when you know how).
|
|
|
|
|
|
Re: PDF - horizontal line in title zone [message #5636 is a reply to message #5635] |
Thu, 16 June 2016 10:55   |
htManager
Messages: 456 Registered: May 2014
|
Senior Member |
|
|
I have found a solution. In the class file I insert a field in $row as field label. I examine the value of the field 'training_plan_detail_uebung_ablauf'. If it is null, the value for the (new) field 'training_plan_detail_uebung_ablauf_label' is null, too. So I can use the property 'ignore_if_empty' for the field label in the report.
Or is there a better/easier solution?
There is one problem left: The positions of the 'multiN' rows don't move to top if I have no output although I have inserted the property 'ignore_if_empty'. Do I have to do something more?
[Updated on: Thu, 16 June 2016 11:33] Report message to a moderator
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Re: PDF - horizontal line in title zone [message #5676 is a reply to message #5675] |
Sat, 25 June 2016 05:01   |
AJM
Messages: 2381 Registered: April 2006 Location: Surrey, UK
|
Senior Member |
|
|
Your report structure file is wrong. Each line in the report is supposed to contain two fields. In the structure file that you sent me earlier you had the following:
$structure['multi1']['fields'][8][] = array('field' => 'xxx_label',
'width' => 15,
'border' => '',
'style' => 'label_tplan',
'ignore_if_empty' => 'y');
$structure['multi1']['fields'][8][] = array('field' => 'xxx',
'width' => 180,
'x' => 15,
'border' => '',
'ignore_if_empty' => 'y');
You should change it to the following:
$structure['multi8']['fields'][1][] = array('field' => 'xxx_label',
'width' => 15,
'border' => '',
'style' => 'label_tplan);
$structure['multi8']['fields'][1][] = array('field' => 'xxx',
'width' => 180,
'x' => 15,
'border' => '');
In your _cm_output_multi() method you should have code such as the following:
case 'multi8':
if (!empty($fieldarray['xxx') {
$outarray = array('xxx_label' => '...', 'xxx' => '...');
} else {
$outarray = array();
} // if
break;
The framework will output whatever values you give it. If you give it a row with empty values then it will print empty values. If you do not want the row printed at all then you must output an empty row and not a row containing empty values.
|
|
|
|
|
|
|
|
|
|
Re: PDF - horizontal line in title zone [message #5710 is a reply to message #5708] |
Sun, 10 July 2016 10:30   |
htManager
Messages: 456 Registered: May 2014
|
Senior Member |
|
|
The line is 1 unit under the images. But the images seem to be still there. See attached picture.
This is the report.inc code:
$structure['multi1']['fields'][9][] = array('image' => '%%training_plan_detail_uebung_pfad_grafik_05',
'imagewidth' => 40,
'imageheight' => 40,
'border' => '',
'x' => 16,
'y_relative' => 1,
'ignore_if_empty' => 'y');
$structure['multi1']['fields'][][] = array('text' => '',
'style' => 'rule',
'y_relative' => 1,
'width' => '100%',
'newline' => 'y');
-
Attachment: grafik.png
(Size: 38.03KB, Downloaded 1299 times)
|
|
|
|
|
|
|
|
|
Re: PDF - horizontal line in title zone [message #5731 is a reply to message #5730] |
Fri, 15 July 2016 04:13   |
AJM
Messages: 2381 Registered: April 2006 Location: Surrey, UK
|
Senior Member |
|
|
This works perfectly well in my development environment. I have adapted the "Invoice (PDF)" task in the EXAMPLE subsystem and produced the output shown in the attached image. I have 4 rows of data where the item id is 'Stuff', 'Other Stuff', 'Widgets' and 'Gadgets'. The data is shown in 3 lines: 1= standard data, 2= images and 3= a horizontal rule. In the attached image you will see that the data for 'Stuff' contains a label and 2 images, the data for 'Other Stuff' contains a label and 1 image. The data for the last 2 rows do not show any images at all, not even empty spaces where the images should be. I did this using the following code in the screen structure file:
// identify output for 1st additional zone
$structure['multi1']['fields'][1][] = array('field' => 'quantity', 'width' => 20, 'halign' => 'center', 'y_relative' => 1);
$structure['multi1']['fields'][1][] = array('field' => 'product_name', 'width' => 30);
$structure['multi1']['fields'][1][] = array('field' => 'product_desc', 'width' => 75);
$structure['multi1']['fields'][1][] = array('field' => 'product_price', 'width' => 25, 'halign' => 'right');
$structure['multi1']['fields'][1][] = array('field' => 'extended_price', 'width' => 25, 'halign' => 'right');
$structure['multi1']['fields'][1][] = array('field' => 'vat_percent', 'width' => 15, 'halign' => 'center');
// additional line to demonstrate 'ignore_if_empty' option
$structure['multi1']['fields'][2][] = array('field' => 'image_label',
'width' => '20',
'style' => 'noborder',
'y_relative' => 1,
'ignore_if_empty' => 'y');
$structure['multi1']['fields'][2][] = array('image' => '%%image_01',
'imagewidth' => 75,
'imageheight' => 95,
'style' => 'noborder',
'ignore_if_empty' => 'y');
$structure['multi1']['fields'][2][] = array('image' => '%%image_02',
'imagewidth' => 75,
'imageheight' => 95,
'style' => 'noborder',
'ignore_if_empty' => 'y');
// third line to put a horizontal rule across the page
$structure['multi1']['fields'][3][] = array('text' => '',
'width' => '100%',
'style' => 'rule',
'y_relative' => 1);
You need to compare this with your screen structure file so that you can spot the differences.
|
|
|
|
|
|
Re: PDF - horizontal line in title zone [message #5737 is a reply to message #5734] |
Mon, 18 July 2016 04:45  |
AJM
Messages: 2381 Registered: April 2006 Location: Surrey, UK
|
Senior Member |
|
|
After I inserted the code to allow the 'ignore_if_empty' option for images I tried testing it in a various combination of scenarios, and I hit a small problem when a cell containing an image was in the same line as one or more other cells containing text. After fixing that problem I thought that all was well, but when I reran your scenario I found that it did not work properly, so that was another problem that needed fixing. All my tests now work, so I think I've fixed everything, but Murphy's Law will probably prove me wrong.
[Updated on: Mon, 18 July 2016 04:46] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Wed Apr 16 23:58:03 EDT 2025
Total time taken to generate the page: 0.05164 seconds
|