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

Home » RADICORE development » Framework » PDF - horizontal line in title zone
PDF - horizontal line in title zone [message #5631] Tue, 14 June 2016 10:42 Go to next message
htManager is currently offline  htManager
Messages: 439
Registered: May 2014
Senior Member
Can I output a horizontal line in the title of a report and if yes, how?

I tried the following: I defined a (calculated) cell and want to show the 'Bottom' border but I don't succeed. Is there a different possibility?

Here is the code:

// define contents of page title
$structure['title'][] = array('text' => '%%datum_output',
'width' => 190,
'border' => 'b',
'newline' => 'y');
Re: PDF - horizontal line in title zone [message #5632 is a reply to message #5631] Wed, 15 June 2016 06:20 Go to previous messageGo to next message
AJM is currently offline  AJM
Messages: 2371
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 #5633 is a reply to message #5632] Wed, 15 June 2016 10:27 Go to previous messageGo to next message
htManager is currently offline  htManager
Messages: 439
Registered: May 2014
Senior Member
Thank you very much! Perfect. How can I read about these possibilites which I don't know?
Re: PDF - horizontal line in title zone [message #5634 is a reply to message #5633] Thu, 16 June 2016 04:48 Go to previous messageGo to next message
AJM is currently offline  AJM
Messages: 2371
Registered: April 2006
Location: Surrey, UK
Senior Member
There are too many possibilities and combinations to document. What I have showed here was done using the standard features supplied in the framework. I am simply outputting a full width blank line with a particular background colour and line height. I am also making use of 'y_relative' and 'newline', both of which are documented.

Re: PDF - horizontal line in title zone [message #5635 is a reply to message #5634] Thu, 16 June 2016 06:37 Go to previous messageGo to next message
htManager is currently offline  htManager
Messages: 439
Registered: May 2014
Senior Member
I understand. It is logical! If you see the result you see the logic behind it! But I am lack of experience in these things.
The same for the next question: Is there a possibility to ignore a 'label' field in a 'multiN' row if the following 'field' field is empty?

I tried to use the following code in the report.inc file:

$test = '';
if (!empty($test)){
$structure['multi1']['fields'][3][] = array('label' => 'Ablauf:',
'width' => 17);
}
$structure['multi1']['fields'][3][] = array('field' => 'training_plan_detail_uebung_ablauf',
'width' => 180,
'x' => 15,
'ignore_if_empty' => 'y');

But how can I get the value of the field 'training_plan_detail_uebung_ablauf'?
Re: PDF - horizontal line in title zone [message #5636 is a reply to message #5635] Thu, 16 June 2016 10:55 Go to previous messageGo to next message
htManager is currently offline  htManager
Messages: 439
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 #5637 is a reply to message #5636] Fri, 17 June 2016 05:22 Go to previous messageGo to next message
AJM is currently offline  AJM
Messages: 2371
Registered: April 2006
Location: Surrey, UK
Senior Member
I'm not sure what you mean. MultiN rows are processed in sequence, so they do not move around. Can you give me a copy of your screen structure file with a description of what you are trying to do so that I can duplicate it on my system.

Re: PDF - horizontal line in title zone [message #5638 is a reply to message #5637] Fri, 17 June 2016 08:51 Go to previous messageGo to next message
htManager is currently offline  htManager
Messages: 439
Registered: May 2014
Senior Member
I want that the 'ignored_if_empty' rows will be replaced by the following rows. In the picture you see in the first row 8 fields. In the second row you see only 6 fields but they require the same space as the first row. The same with the third row.
I hope I could explain it to you and you understand what I mean.
  • Attachment: multi.png
    (Size: 33.34KB, Downloaded 1442 times)
Re: PDF - horizontal line in title zone [message #5639 is a reply to message #5638] Fri, 17 June 2016 11:48 Go to previous messageGo to next message
AJM is currently offline  AJM
Messages: 2371
Registered: April 2006
Location: Surrey, UK
Senior Member
Can you send me your screen structure file so that I can see how it is defined.

One thing you might try is instead of outputting an empty field (a fieldname with a blank or null value) you unset the field completely and output nothing.


Re: PDF - horizontal line in title zone [message #5643 is a reply to message #5639] Sat, 18 June 2016 04:50 Go to previous messageGo to next message
htManager is currently offline  htManager
Messages: 439
Registered: May 2014
Senior Member
Attached you find the report structure file.

I tried to unset the field with the following code:
unset($row['training_plan_detail_uebung_organisation']); instead of outputting: $row['training_plan_detail_uebung_organisation'] = '';

But nothing happened. The position of every field and the horizontal line was the same as before.
Re: PDF - horizontal line in title zone [message #5644 is a reply to message #5643] Sat, 18 June 2016 06:09 Go to previous messageGo to next message
AJM is currently offline  AJM
Messages: 2371
Registered: April 2006
Location: Surrey, UK
Senior Member
If you look at the documentation you will see that the 'ignore_if_empty' options can be used in the 'title' element of a report structure file, but for detail reports it is specified in the style file. There is no mention of it being available in the 'multiN' element of a report.

The easiest way to accomplish what you want is to define each line with a different 'multiN' number, such as 'multi1' to 'multi8' instead of 8 lines for a 'multi1'. If you do not want a line to appear in the output then in your _cm_output_multi() method you return nothing. If you return a non-empty array then that 'multiN' line will be printed even if every element is blank.


Re: PDF - horizontal line in title zone [message #5646 is a reply to message #5644] Sat, 18 June 2016 13:16 Go to previous messageGo to next message
htManager is currently offline  htManager
Messages: 439
Registered: May 2014
Senior Member
For my understanding what you mean:

Before:

multi1
field1
field2
field...
horizontal line

Now: Only non-empty fields are appended to $outarray.

multi1 (=field1)
multi2 (=field2)
..
multi3 (=field5)
multi4 (=field...)
horizontal line

But how do I have to create the report.inc? At the moment I have the following structure:

$structure['multi1']['fields'][1][] = array('field' => 'training_plan_detail_uebung_name_label',
'width' => 17,...

For my skills this construction seems to be very difficult. I think I will reduce the lines.
Re: PDF - horizontal line in title zone [message #5647 is a reply to message #5646] Sun, 19 June 2016 05:02 Go to previous messageGo to next message
AJM is currently offline  AJM
Messages: 2371
Registered: April 2006
Location: Surrey, UK
Senior Member
Each line in your output has a label and a value, but at present you have everything as different lines in a 'multi1' element. What I am saying is that you should have your 2nd line as a 'multi2', your 3rd line as a 'multi3', et cetera. This also means that you would have to adjust your _cm_output_multi() method, but when you don't have anything to be printed on a particular line then you return nothing for that line.

Re: PDF - horizontal line in title zone [message #5653 is a reply to message #5647] Mon, 20 June 2016 11:10 Go to previous messageGo to next message
htManager is currently offline  htManager
Messages: 439
Registered: May 2014
Senior Member
Sorry for asking once again but I do understand what you mean but I don't understand how to do it.

At present I have the following code in my pdf output class in _cm_output_multi():

function _cm_output_multi ($name, $fieldarray)
$outarray = array();
switch ($name) {

case 'multi1':

// get contents of foreign table TRAINING_PLAN_DETAIL
$dbobject =& RDCsingleton::getInstance('training_plan_detail'); // Instanz für Detail-Tabelle
$where = " training_plan_detail.verbaende_art_id='{$fieldarray['verbaen de_art_id']
......}'";

$data = $dbobject->getData ($where);

if (!empty($data)){
$gr = sizeof($data);

for ($i=0; $i<$gr; $i++)
{
$row['training_plan_detail_seq'] = 'No: ' . $data[$i]['training_plan_detail_seq'];
if (!empty($data[$i]['training_plan_detail_uebung_name'])){
$row['training_plan_detail_uebung_name'] = $data[$i]['training_plan_detail_uebung_name'];
$row['training_plan_detail_uebung_name_label'] = 'Name:';

In $data there are all items of the selected table. I know that all relevant data are written to the $ouput array.
In my report.inc I have the multi1 defined with the known fields. I do not know how I can select the 'non-empty' fields and write them in the multiN output array.

Do I have to define a variable to construct the multiN like: $multi = 'multi' . $i?

If this is too difficult, please don't waste your time. I will then create the report as before.

And can I output an image in the multi area? I have only read about outputting barcode in multiN and outputting images in body area.
Re: PDF - horizontal line in title zone [message #5663 is a reply to message #5653] Tue, 21 June 2016 04:41 Go to previous messageGo to next message
AJM is currently offline  AJM
Messages: 2371
Registered: April 2006
Location: Surrey, UK
Senior Member
If you look at the contents of _cm_output_multi() you will see a switch statement like the following:
$outarray = array();

switch ($name) {
    case 'multi1':
        // return a non-empty array to print an empty line
        $outarray[] = array('dummy' => '');
        break;

    case 'multi2':
        // return a non-empty array to print an empty line
        $outarray[] = array('dummy' => '');
        break;

    case 'multi3':
        // return a non-empty array to print an empty line
        $outarray[] = array('dummy' => '');
        break;

    case 'multi4':
        // return a non-empty array to print an empty line
        $outarray[] = array('dummy' => '');
        break;

    .....

    default:
        // return a non-empty array to print an empty line
        $outarray[] = array('dummy' => '');
        break;
} // switch

return $outarray;

Each time this method is called is has a different 'multiN' value in $name, so within the relevant 'case' statement you require code to construct $outarray before it is returned. You are currently outputting both a label and a text field for each line, so in the situation where the text field is empty and you do not want the line printed at all then do nothing as $outarray is already empty. If you put ANYTHING at all in $outarray then the line WILL be printed even if there are no values to print.


Re: PDF - horizontal line in title zone [message #5666 is a reply to message #5663] Tue, 21 June 2016 10:52 Go to previous messageGo to next message
htManager is currently offline  htManager
Messages: 439
Registered: May 2014
Senior Member
Thank you for your patience. I think I do now understand what you mean and how you handle it.

I went thtrough the code with my debugger and wanted to know if the following is true:

1. the output3.php controller file is called

2. the report.inc file is called.
.....
$structure['multi3']['fields'][1][] = array('field' => 'multi_03','width' => 180,'x' => 15);
.....

3. my output3_pdf_subclass.inc is called where I have to generate the $outarray for the mulitN record.
case 'multi3':
$row['multi_03'] = 'foobar';
$outarray[] = $row;
break;

But what I still not understand and what was the origin of this post is, how can I generate a multiN record as a horizontal line and is there a possibility to show images in the multiN records?
The easiest way for the report which I would like to create would be the option 'ignore_if_empty' in the multiN zone and the possiblilty to show 'images' instead of 'fields'.
Please think of it that I haven't that much experience in programming like you have but I am very motivated to learn it and to implement it with RADICORE.
Re: PDF - horizontal line in title zone [message #5670 is a reply to message #5666] Wed, 22 June 2016 05:25 Go to previous messageGo to next message
AJM is currently offline  AJM
Messages: 2371
Registered: April 2006
Location: Surrey, UK
Senior Member
I have already shown you how to generate a horizontal line. The documentation already shows how you can out an image in a line. There is code in the EXAMPLE prototype whichs this.

If each line in the report has its own 'multiN' record, but if you do not want anything output (not even a blank line) then set $outarray to FALSE or an empty array. If there is anything in $outarray at all then a line will be printed, even if it is blank.


Re: PDF - horizontal line in title zone [message #5675 is a reply to message #5670] Fri, 24 June 2016 11:13 Go to previous messageGo to next message
htManager is currently offline  htManager
Messages: 439
Registered: May 2014
Senior Member
The image is now visible in the output. The problem was that the image in the first row was covered by the first lines of the second row. After setting 'y_relative' in the next line on a higher value the picture is now visible.

I tried to solve the multiN problem in the following way:

In report.inc I defined multi2

$structure['multi2']['fields'][1][] = array('multi2_type' => 'multi2_value');

In the class file I defined multi2 as follows:

case 'multi2':
$row['multi2_type'] = 'field';
$row['multi2_value'] = "'Label 02: ', 'width' => 17, 'border' => '', 'style' => 'label_tplan');";

$outarray[] = $row;

But all I get are two empty fields with borders. Is this the right way?
Re: PDF - horizontal line in title zone [message #5676 is a reply to message #5675] Sat, 25 June 2016 05:01 Go to previous messageGo to next message
AJM is currently offline  AJM
Messages: 2371
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 #5681 is a reply to message #5676] Tue, 28 June 2016 06:31 Go to previous messageGo to next message
htManager is currently offline  htManager
Messages: 439
Registered: May 2014
Senior Member
I think, I understand now what you mean at least I understand (hopefully) the logic. I tried to get it running for me but it seems to be too complex for my skills.

The report consists of several items with up to 10 fields. This would produce 80 multiN lines if no field is empty, isn't it?

I have three output types: 'field', 'image' and 'text'. The output type is declared in the multiN section of the report.inc. But I do not know what output type will be sent for a multiN line. And in the outarray I can only send the value for the output type (i.e. 'field') as far as I can see.

That's why I will create two report versions: a short and a long version in the 'normal' way.

Thanks a lot for your help.
Re: PDF - horizontal line in title zone [message #5696 is a reply to message #5681] Sun, 03 July 2016 05:45 Go to previous messageGo to next message
htManager is currently offline  htManager
Messages: 439
Registered: May 2014
Senior Member
Thank you very very much for modifying the framework for the option 'ignore_if_empty' in Body contents. Can you modify this in one of the next releases for type 'image' too? That would be perfect. Many thanks in advance.
Re: PDF - horizontal line in title zone [message #5699 is a reply to message #5696] Mon, 04 July 2016 12:59 Go to previous messageGo to next message
AJM is currently offline  AJM
Messages: 2371
Registered: April 2006
Location: Surrey, UK
Senior Member
See if this updated script works.

Re: PDF - horizontal line in title zone [message #5705 is a reply to message #5699] Thu, 07 July 2016 04:58 Go to previous messageGo to next message
htManager is currently offline  htManager
Messages: 439
Registered: May 2014
Senior Member
Sorry, it doesn't work.

This is the report code:

$structure['multi1']['fields'][9][] = array('image' => '%%training_plan_detail_uebung_pfad_grafik_05',
'imagewidth' => 40,
'imageheight' => 40,
'x' => 96,
'y_relative' => 1,
'ignore_if_empty' => 'y');

The space for the pictures is still you don't see them.
Re: PDF - horizontal line in title zone [message #5706 is a reply to message #5705] Thu, 07 July 2016 14:32 Go to previous messageGo to next message
AJM is currently offline  AJM
Messages: 2371
Registered: April 2006
Location: Surrey, UK
Senior Member
Try this.

Re: PDF - horizontal line in title zone [message #5707 is a reply to message #5706] Fri, 08 July 2016 05:58 Go to previous messageGo to next message
htManager is currently offline  htManager
Messages: 439
Registered: May 2014
Senior Member
This std.pdf.class.inc works but now I have a problem with the horizontal line again. I attached a jpg where you can see what I mean.

The specification for the horizintal line has a value for 'y_relative' => '12'. You see this on the left hand of the picture.
If I change this value to '1' or '2' (right side) the pictures are partially covered. I changed the background colour to see if I forgot to add 'ignore_if_empty' to a field.
Here is the code for the horizontal line in report.inc:

$structure['multi1']['fields'][][] = array('text' => '',
'style' => 'rule',
'y_relative' => 12,
'width' => '100%',
'newline' => 'y');
  • Attachment: grafik 01.jpg
    (Size: 81.08KB, Downloaded 1048 times)
Re: PDF - horizontal line in title zone [message #5708 is a reply to message #5707] Fri, 08 July 2016 12:17 Go to previous messageGo to next message
AJM is currently offline  AJM
Messages: 2371
Registered: April 2006
Location: Surrey, UK
Senior Member
The code was not setting the line height correctly. I have changed it to use the image height which has to be converted from pixels into whatever your unit of measure is. See updated script in the attached file.

Re: PDF - horizontal line in title zone [message #5710 is a reply to message #5708] Sun, 10 July 2016 10:30 Go to previous messageGo to next message
htManager is currently offline  htManager
Messages: 439
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 1058 times)
Re: PDF - horizontal line in title zone [message #5712 is a reply to message #5710] Mon, 11 July 2016 03:54 Go to previous messageGo to next message
AJM is currently offline  AJM
Messages: 2371
Registered: April 2006
Location: Surrey, UK
Senior Member
You are still making the mistake of defining all output elements in a single 'multi1' line. If you look at your output you should see that the images are on their own line, just as the horizontal rule is on its own line. Each line on your output should therefore be defined on its own 'multiN' element, such as 'multi1', 'multi2', 'multi3' etc. I have tried this in my test system, and when there are no images the line is not output at all instead of the being output with blank spaces where the images should be.

What you are trying to do is have a single row of data being split over several lines in the output, which makes it difficult when you want certain elements not to appear at all. You need to output a separate row for each line on the output, and when you want a line to be not printed at all you simply output an empty row for that line.


Re: PDF - horizontal line in title zone [message #5720 is a reply to message #5712] Tue, 12 July 2016 09:08 Go to previous messageGo to next message
htManager is currently offline  htManager
Messages: 439
Registered: May 2014
Senior Member
Tony, can you send me the code of your test report.inc which you mentioned. I hope that if I see a working code I realize which mistake I made.
Re: PDF - horizontal line in title zone [message #5721 is a reply to message #5720] Wed, 13 July 2016 04:01 Go to previous messageGo to next message
AJM is currently offline  AJM
Messages: 2371
Registered: April 2006
Location: Surrey, UK
Senior Member
I have told you what your mistake is - you have all the output in a single 'multi1' element which spans multiple lines, and sometimes one (or more) of those lines you want not to appear instead of being output as blank lines. You should have each line of output in its own 'multiN' element so that line 1 is 'multi1', line 2 is 'multi2', line 3 is 'multi3' et cetera. If you do not want a particular line to appear then output an empty row for that line.

Re: PDF - horizontal line in title zone [message #5722 is a reply to message #5721] Wed, 13 July 2016 06:42 Go to previous messageGo to next message
htManager is currently offline  htManager
Messages: 439
Registered: May 2014
Senior Member
Tony, I apologize for my not understanding what you want to explain to me. It comes part time from the logic and part time from my english knowledge.

I think it depends on your (right!) definition of the multiN area and my (fals) definition which I have in mind.

I have a main table and a detail table with n records and x columns.

The values of the main table record are displayed in the title area.

Now I think that the values of the (x) fields of the detail table are positioned in the multi1 area. Each record followed by a horizontal line. After displaying the n records I can insert a multi2 area with totals, subtotals etc. (That was the logic of Paradox Application Language, the program I worked with before. This area was called 'nultiRecord'.)

In this case I can set the position and the properties of a field in each (multi) record how I want it to look like. After all fields of each record are outputted, a horizontal line is displayed as an optical divider. Then the next record with its fields are displayed.

You say that I have to give each field a different multiN number. This is what I don't understand. Field f1 in record 1 would be multi1 and field f1 in record 2 would than be e.g. multi8 and so on. How do I know which specification multi8 has?
Re: PDF - horizontal line in title zone [message #5729 is a reply to message #5722] Thu, 14 July 2016 04:47 Go to previous messageGo to next message
AJM is currently offline  AJM
Messages: 2371
Registered: April 2006
Location: Surrey, UK
Senior Member
If you have to output multiple lines in the same 'multi1' zone then you should read the documentation which says that each line should have its own line number. You can do this with code similar to the following:
$structure['multi1']['fields'][1][] = .... data for first line
$structure['multi1']['fields'][2][] = .... data for second line
$structure['multi1']['fields'][3][] = .... data for third line

Note the use of "['fields'][N][]" instead of "['fields'][][]".

I have tried this in my development environment, and it successfully drops a line where all fields are empty.


Re: PDF - horizontal line in title zone [message #5730 is a reply to message #5729] Thu, 14 July 2016 06:02 Go to previous messageGo to next message
htManager is currently offline  htManager
Messages: 439
Registered: May 2014
Senior Member
I did it exactly how you described it. And everything works fine with one exception: The image field does not disappear. In the before last version of std.pdf.class.inc from Fri, 8 Juliy 2016 the image disappears if 'ignore_if_empty' otpion is set. But the horizontal line isn't at the right place. (left side of the attached picture)
In the last version of std.pdf.class.inc from Sun, 10 July 2016 the horizontal rule is set correctly but the image doesn't disappear.
Re: PDF - horizontal line in title zone [message #5731 is a reply to message #5730] Fri, 15 July 2016 04:13 Go to previous messageGo to next message
AJM is currently offline  AJM
Messages: 2371
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 #5732 is a reply to message #5731] Sat, 16 July 2016 08:30 Go to previous messageGo to next message
htManager is currently offline  htManager
Messages: 439
Registered: May 2014
Senior Member
Attached you find my output. I also re-installed the prototype example to be sure that I have the latest version.

Can it be something like a hidden byte order mark due to different collations as the output problem in text/en/language_text.inc?
Re: PDF - horizontal line in title zone [message #5733 is a reply to message #5732] Sun, 17 July 2016 04:15 Go to previous messageGo to next message
AJM is currently offline  AJM
Messages: 2371
Registered: April 2006
Location: Surrey, UK
Senior Member
Attached is the latest version of my PDF class which should solve your issues.

Re: PDF - horizontal line in title zone [message #5734 is a reply to message #5733] Sun, 17 July 2016 06:48 Go to previous messageGo to next message
htManager is currently offline  htManager
Messages: 439
Registered: May 2014
Senior Member
Thank you very much. My problem seems to be solved. Everything looks very good now. What did you change or what was the problem?
Re: PDF - horizontal line in title zone [message #5737 is a reply to message #5734] Mon, 18 July 2016 04:45 Go to previous message
AJM is currently offline  AJM
Messages: 2371
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

Previous Topic: MNU_ACCOUNT - Add new account
Next Topic: Radicore Forum 11th Birthday
Goto Forum:
  


Current Time: Tue Dec 03 12:54:00 EST 2024

Total time taken to generate the page: 0.02211 seconds