TCPDF use example in Scriptcase for understand avanced use.

thanks group.
i like uses all funcionallity the class TCPDF.

I create my first report for print sales quotation master and details products.
i use example step for step and not work http://www.scriptcase.net/scriptcase-ejemplos/tutoriais/pdf/pdf03.php

I not view label field, how to example url scriptcase pdf03.php

i like header for data master quotation and one page for line. and print data product in table and salesprice other table.
i like create report for equal a this example

http://www.fpdf.org/en/script/ex20.pdf for uses TCPDF. and not understand.
http://www.fpdf.org/en/script/script20.php

i search examples in google. http://huguidugui.wordpress.com/2013/11/15/fpdf-posiciones-x-y/

i not undertstan the block in report application. section 3

i download example TCPDF and not know running in scriptcase, for error the library // Include the main TCPDF library (search for installation path). require_once(‘tcpdf_include.php’);

/------------------ Page 1 -----------------/
sc_pdf_print($cell_QUOTATIONID);
sc_pdf_print($cell_QUOTATIONNAME);
sc_pdf_print($cell_DELIVERYNAME);
sc_pdf_print($cell_SALESRESPONSIBLE);
sc_pdf_print($cell_CURRENCYCODE);
sc_pdf_print($cell_DOCUTITLE);
sc_pdf_print($cell_SALESEXPENSESPCT);
sc_pdf_print($cell_PROFITMARGINCUST);
sc_pdf_print($cell_TAX);
sc_pdf_print($cell_EXCHRATECUST);
sc_pdf_set_y(5);
foreach ({orders_details} as $NM_ind => $Dados)
{
sc_pdf_print_sub_sel($cell_orders_details_LINENUM[$NM_ind]);
sc_pdf_print_sub_sel($cell_orders_details_CURRENCYCODE[$NM_ind]);
sc_pdf_print_sub_sel($cell_orders_details_ITEMID[$NM_ind]);
sc_pdf_print_sub_sel($cell_orders_details_NAME[$NM_ind]);
sc_pdf_print_sub_sel($cell_orders_details_SALESPRICE[$NM_ind]);
sc_pdf_print_sub_sel($cell_orders_details_SALESPRICEPVP[$NM_ind]);
sc_pdf_print_sub_sel($cell_orders_details_PROFITMARGINCUST[$NM_ind]);
sc_pdf_print_sub_sel($cell_orders_details_TAX[$NM_ind]);
sc_pdf_sub_sel_end(20);
}
/-------------------------------------------/

Espa?ol.
Buenas tardes amigos
quiero usar la generacion de reportes para tener dos tipos de reportes.
*Tengo una aplicacion maestro detalle de mis cotizaciones. quiero una hoja por linea del detalle en un formato como la imagen
*como el ejemplo que hay pero con la libreria fpdf, quiero hacer el formato de factura igual.
*he intentado usar la libreria tcpdf pero no todas las funciones estan incluidas

No logro entender como usar toda las funciones de TCPDF dentro de scriptcase.

Image6.png

i not work all function class TCPDF

Fatal error: Call to a member function setTextShadow() on a non-object in C:\Program Files (x86)\NetMake\v8\wwwroot\scriptcase\app\Quotations\app_pdfreport_quotationtable\app_pdfreport_quotationtable_grid.class.php on line 532

i like probe uses examples for understand uses report pdf avanced, i can?t add library for error clases
$pdf->setTextShadow(array(‘enabled’=>true, ‘depth_w’=>0.2, ‘depth_h’=>0.2, ‘color’=>array(196,196,196), ‘opacity’=>1, ‘blend_mode’=>‘Normal’));

Image7.png

Fatal error: Class ‘TCPDF’ not found in C:\Program Files (x86)\NetMake\v8\wwwroot\scriptcase\app\Quotations\blank\index.php on line 962

i create application blank for uses class all include in SC8.
i know how to add include, requiere etc.
in onexcute method i add
$pdf1 = new TCPDF( ‘P’, ‘mm’, ‘A4’ );
$pdf1->AddPage();
$pdf1->Output();

i are add include, i not understand path for devel and prod
include(‘tcpdf.php’);
$pdf1 = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, ‘UTF-8’, false);
$pdf1->AddPage();
$pdf1->Output();

Error
include(tcpdf.php): failed to open stream: No such file or directory
Error
include(tcpdf.php): failed to open stream: No such file or directory
Error
include(): Failed opening ‘tcpdf.php’ for inclusion (include_path=’.;C:\php\pear’)
Fatal error: Class ‘TCPDF’ not found in C:\Program Files (x86)\NetMake\v8\wwwroot\scriptcase\app\Quotations\blank\index.php on line 963

Image8.png

i found info in forum.
http://support.scriptcase.net/index.php?/Knowledgebase/Article/View/639/0/reportpdf-with-tcpdf-library

Yo de ti miraria este ejemplo,

Creo que te puede ser util ya que al tratarse de una factura se trata que el mismo concepto que un presupuesto

http://www.scriptcase.net/scriptcase-samples/tutoriais_es/pdf/pdf03.php

NOT (Manera incorrecta): include(tcpdf.php)
YES (Manera correcta): sc_include_lib(tcpdf);

Check out here: https://tcpdf.org/examples/
There are the complete tcpdf examples. Just understand that scriptcase uses prepended functions. So if it is called $pdf->AddPage(); that in scriptcase it is called sc_addpage (so for the other functions).
See also: http://www.scriptcase.net/forum/forum/applications/report-pdf/66834-how-can-i-print-more-lines-for-each-records-using-fields-one-under-the-other-one

The below code kept in blank application’s execute working for me

sc_include_lib(‘tcpdf’);
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, ‘UTF-8’, false);

$pdf->SetCreator(PDF_CREATOR);
$pdf->SetAuthor(‘Nicola Asuni’);
$pdf->SetTitle(‘TCPDF Example 50’);
$pdf->SetSubject(‘TCPDF Tutorial’);
$pdf->SetKeywords(‘TCPDF, PDF, example, test, guide’);
//$pdf->AddPage(‘P’,‘A4’); //A4 Portrait
$pdf->AddPage(‘L’,‘A4’); //A4 Landscape

// Nonbreaking Header Table

$tbl = <<<EOD
<table class = “roundedCorners” cellpadding=“2” cellspacing=“2”>
<tr>
<th style=“background-color:#87BBFF”;color:#0000FF; colspan=“5” align=“center”><b>XYZ SOCIETY</b><br>Regn. No. (78377282/2017)<br>Navi Mumbai-400709.
</th>
</tr>

<tr>
<td>Bill#</td>
<td>3412</td>
<td colspan=“2”>For the month of</td>
<td>01-May-2017</td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>

<tr>
<td>Flat No</td>
<td>101</td>
<td colspan=“2”>Mr.Raman</td>
<td>(In Rs.)</td>
</tr>

<tr>
<td width=“100%”> </td>
</tr>

<tr>
<td width=“10%”>1.</td>
<td width=“70%” colspan=“3”>Building Maintenance Charges</td>
<td width=“20%” align=“right”>1128</td>
</tr>

<tr>
<td width=“100%”> </td>
</tr>

<tr>
<td width=“10%”>2.</td>
<td width=“70%”>Sinking Fund</td>
<td width=“20%” align=“right”>57</td>
</tr>

<tr>
<td width=“100%”> </td>
</tr>

</table>
EOD;

$style=<<<EOD
<style>
table.roundedCorners {
border: 1px solid DarkOrange;
border-radius: 13px;
border-spacing: 0;
}
table.roundedCorners td,
table.roundedCorners th {
border-bottom: 1px solid DarkOrange;
padding: 10px;
}
table.roundedCorners tr:last-child > td {
border-bottom: none;
}
</style>
EOD;

//echo $tbl;

$pdf->writeHTML($style . $tbl, true, false, false, false, ‘’);

$pdf->Output(‘example_048.pdf’, ‘I’);