How can I print more lines for each records using fields one under the other one

Hello all,

Is it possible to print a record using more lines for each singular record on the same page ?

for istance 3 records on the same page split like that (more rows for each record)

CODE_ID_01 PRODUCT_DESCRIPTION_01
DATE_01 OTHER_FIELD_01
FIELD00_01 OTHER_FIELD_0001

CODE_ID_02 PRODUCT_DESCRIPTION_02
DATE_02 OTHER_FIELD_02
FIELD00_02 OTHER_FIELD_0002

CODE_ID_03 PRODUCT_DESCRIPTION_03
DATE_03 OTHER_FIELD_03
FIELD00_03 OTHER_FIELD_0003

Many thanks

For whom could be interested I did a little improvement and now I did more or less the job entering on code the following lines:

sc_pdf_multi_cell(0,5,{products_demo_product_code}." “. {products_demo_product_desc}.”
“.
{demo_booking_Prospect}.”
Data presentazione: “.
{demo_booking_demo_date}.” Ore: “.{demo_booking_demo_hours}.”
Luogo: “.
{demo_booking_demo_address}.”
Note 1:".
{products_demo_note}."
Note 2:".
{demo_booking_demo_note} ."
");

The problem now is how to set left margin to start printing on right place .
See image attached

Anyone can help me about the way to set it ??

aaa.jpg

Check here: http://www.tcpdf.org/examples.php there are examples on multi column printing.
Then replace $this->xxx functions in the code with sc_pdf_xxx functions. Or you can choose to use $this->pdf (should also work).

Thanks rr,
more or less I’m almost at a good point
This is what I did to obtain the result on image attached.

Body:
sc_pdf_set_left_margin(25);
sc_pdf_multi_cell(0,5,{demo_booking_Prospect}."
".
"Data presentazione: “. {demo_booking_demo_date}.” Ore: “.{demo_booking_demo_hours} .”

" .
{products_demo_product_code}." “. {products_demo_product_desc} .”
Note 1:".
{products_demo_note}."
Note 2:".
{demo_booking_demo_note} ."
");

The problem I have now is on the header
Do you know why the last line is not printed ? Seems that Header do not like multi cell but in my ignorance do not make sense.

Header:
sc_pdf_print($cell_demo_booking_demo_bookingID);
sc_pdf_print($cell_demo_booking_SalesmanID);
sc_pdf_print($cell_demo_booking_CustomerID);
sc_pdf_print($cell_customers_CompanyName);
sc_pdf_print($cell_customers_Address);
sc_pdf_print($cell_customers_PostalCode);
sc_pdf_print($cell_customers_City);
sc_pdf_print($cell_customers_Region);
sc_pdf_print($cell_customers_Country);
sc_pdf_print($cell_customers_VatCode);
sc_pdf_print($cell_customers_CodFisc);
sc_pdf_print($Flag_Rich_Demo);
sc_pdf_multi_cell(0,5,{demo_booking_demo_address}."
");

[ATTACH=CONFIG]n66876[/ATTACH]

aaa.jpg

See: http://www.tcpdf.org/doc/code/classTCPDF.html cIick open MultiCell . I guess that you have to enlarge the height… I havent tried this but I did do some customised pdf work…
For tc_pdf you need to test and try sometimes to get it right… :slight_smile:
[SIZE=16px] [TABLE=“class: memname”]
[TR]
[TD]TCPDF::MultiCell[/TD]
[TD]([/TD]
[TD=“class: paramtype”] [/TD]
[TD=“class: paramname”]$w,[/TD]
[/TR]
[TR]
[TD=“class: paramkey”] [/TD]
[TD] [/TD]
[TD=“class: paramtype”] [/TD]
[TD=“class: paramname”]$h,[/TD]
[/TR]
[TR]
[TD=“class: paramkey”] [/TD]
[TD] [/TD]
[TD=“class: paramtype”] [/TD]
[TD=“class: paramname”]$txt,[/TD]
[/TR]
[TR]
[TD=“class: paramkey”] [/TD]
[TD] [/TD]
[TD=“class: paramtype”] [/TD]
[TD=“class: paramname”]$border = 0,[/TD]
[/TR]
[TR]
[TD=“class: paramkey”] [/TD]
[TD] [/TD]
[TD=“class: paramtype”] [/TD]
[TD=“class: paramname”]$align = ‘J’,[/TD]
[/TR]
[TR]
[TD=“class: paramkey”] [/TD]
[TD] [/TD]
[TD=“class: paramtype”] [/TD]
[TD=“class: paramname”]$fill = false,[/TD]
[/TR]
[TR]
[TD=“class: paramkey”] [/TD]
[TD] [/TD]
[TD=“class: paramtype”] [/TD]
[TD=“class: paramname”]$ln = 1,[/TD]
[/TR]
[TR]
[TD=“class: paramkey”] [/TD]
[TD] [/TD]
[TD=“class: paramtype”] [/TD]
[TD=“class: paramname”]$x = ‘’,[/TD]
[/TR]
[TR]
[TD=“class: paramkey”] [/TD]
[TD] [/TD]
[TD=“class: paramtype”] [/TD]
[TD=“class: paramname”]$y = ‘’,[/TD]
[/TR]
[TR]
[TD=“class: paramkey”] [/TD]
[TD] [/TD]
[TD=“class: paramtype”] [/TD]
[TD=“class: paramname”]$reseth = true,[/TD]
[/TR]
[TR]
[TD=“class: paramkey”] [/TD]
[TD] [/TD]
[TD=“class: paramtype”] [/TD]
[TD=“class: paramname”]$stretch = 0,[/TD]
[/TR]
[TR]
[TD=“class: paramkey”] [/TD]
[TD] [/TD]
[TD=“class: paramtype”] [/TD]
[TD=“class: paramname”]$ishtml = false,[/TD]
[/TR]
[TR]
[TD=“class: paramkey”] [/TD]
[TD] [/TD]
[TD=“class: paramtype”] [/TD]
[TD=“class: paramname”]$autopadding = true,[/TD]
[/TR]
[TR]
[TD=“class: paramkey”] [/TD]
[TD] [/TD]
[TD=“class: paramtype”] [/TD]
[TD=“class: paramname”]$maxh = 0,[/TD]
[/TR]
[TR]
[TD=“class: paramkey”] [/TD]
[TD] [/TD]
[TD=“class: paramtype”] [/TD]
[TD=“class: paramname”]$valign = ‘T’,[/TD]
[/TR]
[TR]
[TD=“class: paramkey”] [/TD]
[TD] [/TD]
[TD=“class: paramtype”] [/TD]
[TD=“class: paramname”]$fitcell = false [/TD]
[/TR]
[TR]
[TD] [/TD]
[TD])[/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
[/TABLE]
[/SIZE]

[SIZE=16px] This method allows printing text with line breaks. They can be automatic (as soon as the text reaches the right border of the cell) or explicit (via the
character). As many cells as necessary are output, one below the other.
Text can be aligned, centered or justified. The cell block can be framed and the background painted.
Parameters [TABLE=“class: params”]
[TR]
[TD=“class: paramname”]$w[/TD]
TD Width of cells. If 0, they extend up to the right margin of the page.[/TD]
[/TR]
[TR]
[TD=“class: paramname”]$h[/TD]
TD Cell minimum height. The cell extends automatically if needed.[/TD]
[/TR]
[TR]
[TD=“class: paramname”]$txt[/TD]
TD String to print[/TD]
[/TR]
[TR]
[TD=“class: paramname”]$border[/TD]
TD Indicates if borders must be drawn around the cell. The value can be a number:

  • 0: no border (default)
  • 1: frame
or a string containing some or all of the following characters (in any order):
  • L: left
  • T: top
  • R: right
  • B: bottom
or an array of line styles for each border group - for example: array('LTRB' => array('width' => 2, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0)))[/TD] [/TR] [TR] [TD="class: paramname"]$align[/TD] [TD](string) Allows to center or align the text. Possible values are:
  • L or empty string: left align
  • C: center
  • R: right align
  • J: justification (default value when $ishtml=false)
[/TD] [/TR] [TR] [TD="class: paramname"]$fill[/TD] [TD](boolean) Indicates if the cell background must be painted (true) or transparent (false).[/TD] [/TR] [TR] [TD="class: paramname"]$ln[/TD] [TD](int) Indicates where the current position should go after the call. Possible values are:
  • 0: to the right
  • 1: to the beginning of the next line [DEFAULT]
  • 2: below
[/TD] [/TR] [TR] [TD="class: paramname"]$x[/TD] [TD](float) x position in user units[/TD] [/TR] [TR] [TD="class: paramname"]$y[/TD] [TD](float) y position in user units[/TD] [/TR] [TR] [TD="class: paramname"]$reseth[/TD] [TD](boolean) if true reset the last cell height (default true).[/TD] [/TR] [TR] [TD="class: paramname"]$stretch[/TD] [TD](int) font stretch mode:
  • 0 = disabled
  • 1 = horizontal scaling only if text is larger than cell width
  • 2 = forced horizontal scaling to fit cell width
  • 3 = character spacing only if text is larger than cell width
  • 4 = forced character spacing to fit cell width
General font stretching and scaling values will be preserved when possible.[/TD] [/TR] [TR] [TD="class: paramname"]$ishtml[/TD] [TD](boolean) INTERNAL USE ONLY ? set to true if $txt is HTML content (default = false). Never set this parameter to true, use instead writeHTMLCell() or writeHTML() methods.[/TD] [/TR] [TR] [TD="class: paramname"]$autopadding[/TD] [TD](boolean) if true, uses internal padding and automatically adjust it to account for line width.[/TD] [/TR] [TR] [TD="class: paramname"]$maxh[/TD] [TD](float) maximum height. It should be >= $h and less then remaining space to the bottom of the page, or 0 for disable this feature. This feature works only when $ishtml=false.[/TD] [/TR] [TR] [TD="class: paramname"]$valign[/TD] [TD](string) Vertical alignment of text (requires $maxh = $h > 0). Possible values are:
  • T: TOP
  • M: middle
  • B: bottom
. This feature works only when $ishtml=false and the cell must fit in a single page.[/TD] [/TR] [TR] [TD="class: paramname"]$fitcell[/TD] [TD](boolean) if true attempt to fit all the text within the cell by reducing the font size (do not work in HTML mode). $maxh must be greater than 0 and equal to $h.[/TD] [/TR] [/TABLE] Returns int Return the number of cells or 1 for html mode. Since 1.3 See Also SetFont(), SetDrawColor(), SetFillColor(), SetTextColor(), SetLineWidth(), Cell(), Write(), SetAutoPageBreak() [/SIZE]

I modified a bit the code as follow
The header is standar as SC does while the body I did a customization in order to have single record fields split into several lines.
Now I got the problem that the next record page is correct about header but about the body, on second page (2nd record) , it starts NOT correctly as expected.
I got a A4 sheet . Need I to add within code something about page lenght or something similar ??
I added for testing sc_pdf_set_top_margin(113) as the setting heigh of PDF Report but it makes a…mess.
Thanks

BODY CODE
SC created Code commented
/------------------ Page 1 -----------------
sc_pdf_print($cell_products_demo_product_code);
sc_pdf_print($cell_products_demo_product_desc);
sc_pdf_print($cell_demo_booking_Prospect);
sc_pdf_print($cell_demo_booking_demo_date);
sc_pdf_print($cell_demo_booking_demo_hours);
sc_pdf_print($cell_demo_booking_product_demoID);
sc_pdf_print($cell_products_demo_note);
sc_pdf_print($cell_demo_booking_demo_note);
-------------------------------------------
/
Custom code

sc_pdf_set_left_margin(25);
sc_pdf_multi_cell(0,5,{demo_booking_Prospect}."
" .
"Data presentazione: “. {demo_booking_demo_date}.” Ore: “.{demo_booking_demo_hours} .”

" .
{products_demo_product_code}." “. {products_demo_product_desc} .”
Note 1:".
{products_demo_note}."
Note 2:".
{demo_booking_demo_note} ."
");

aaa.jpg

bbb.jpg