hi steve
thanks for your help
Version 2 (external file) works already so my problem is already solved.
but ... this version has a little flaw , as you already mentioned, this action can be proceeded from every table.
to do it the proper way from within Dataface I now try to build version one.
Here is what I have done so far: (extended version, because this might be interresting for others too)
1.the class fpdf.php lives in the main dataface folder
for those who are interrested,get it here:
http://www.fpdf.org/2.next I put a folder with font files in the main directory as well
3. I created a file named print_this_action.php and saved this in the main actions folder
it loks like this:
----------------------------snip----------------------------------------
Image('../images/logo_header.png',2,1,0);
//Arial bold 15
$this->SetFont('Arial','B',15);
$this->Ln(20);
$this->Ln(20);
//to the right
$this->Cell(-135);
//Title
$this->Cell(0,10,'the TITLE',0,0,'C');
$this->SetX(45);
//pagebreak
$this->Ln(20);
}
//Footer
function Footer()
{
//Position 1,5 cm from bottom
$this->SetY(-15);
//Arial kursiv 8
$this->SetFont('Arial','I',8);
//page number
$this->Cell(0,10,'Seite '.$this->PageNo().'/{nb}',0,0,'C');
}
}
$app =& Dataface_Application::getInstance();
$record =& $app->getRecord();
$query =& $app->getQuery();
//----------------------------------------?????-----did I call the params correctly????--------
$sql = "SELECT
druck
FROM
". $query=>('-table') ."
WHERE
id LIKE " . $query=>('-record'). ";";
$result = mysql_query($sql) OR die(mysql_error());
$pdftext = mysql_fetch_assoc($result);
$pdfoutput = $pdftext['druck'];
$pdf=new PDF();
$pdf->AliasNbPages();
$pdf->AddPage();
$pdf->SetFont('arial','',10);
$pdf->SetLeftMargin(15);
$pdf->MultiCell(0,5,$pdfoutput,0,1);
$pdf->Output();
}
?>
---------------------------snap-----------------------------------------
then I created the print action and put it in the table folder (neu_fragen)
---------------------------snip-----------------------------------------
[print_this_action]
label = print
description = print this record
url = "{$this->url('-action=print_this_action')}&-table={$table}&-record={$record->val('id')"
accessKey = p
category = table_actions
icon = "{$dataface_url}/images/printer-orange.gif"
mode = print
;;template = HelloWorld.html<--------------------------do I need a template for this action???
permission = view
order=5
condition = "$query['-table'] == 'neu_fragen'"
---------------------------snap-----------------------------------------
unfortunately this produces the following error:
Fatal error: Fehler bei der Analyse des Ausdrucks '{$this->url('-action=print_this_action')}&-table={$table}&-record={$record->val('id')'.On line 1110 of file /data/my_server/my_url/www/html/dataface-0.7.1/Dataface/Application.php in function printStackTrace()
On line 234 of file /data/my_server/my_url/www/html/dataface-0.7.1/Dataface/ActionTool.php in function parseString({$this->url('-action=print_this_action')}&-table={$table}&-record={$record->val('id'),array(neu_fragen))
On line 1583 of file /data/my_server/my_url/www/html/dataface-0.7.1/Dataface/Table.php in function getActions(array(neu_fragen))
On line 79 of file /data/my_server/my_url/www/html/dataface-0.7.1/Dataface/ActionTool.php in function getActions(array(neu_fragen))
On line 92 of file /data/my_server/my_url/www/html/dataface-0.7.1/Dataface/ActionTool.php in function _loadTableActions(neu_fragen)
On line 776 of file /data/my_server/my_url/www/html/dataface-0.7.1/Dataface/Applica in /data/my_server/my_url/www/html/dataface-0.7.1/Dataface/Application.php on line 1110
----------------------------------------end error--------------------------------
so .. here i got stuck