This topic is locked

Hide empty fields in print view

3/17/2010 6:10:04 PM
PHPRunner General questions
A
albanfi author

Hi, there is away to hide a field (the <td> or <tr> tags of a table) if that field is empty or null?

Sorry for bad english

Thanks.

Sergey Kornilov admin 3/17/2010

Are you talking about View or Printer page? I'm not sure how you can hide one field on the Printer page as it's displayed int he table. You remove one cell and table will be broken.

A
albanfi author 3/18/2010



Are you talking about View or Printer page? I'm not sure how you can hide one field on the Printer page as it's displayed int he table. You remove one cell and table will be broken.


Thx for the answer, i'm talking about printer page, I will not remove the cell but the entire row (Print page has vertical layout).

J
Jane 3/19/2010

Hi,
you can edit HTML on the Visual Editor tab in HTML mode:

{BEGIN fieldname_show}

<TR>

<TD class=shade width="20%">{$label TableName FieldName}</TD>

<TD {$FieldName_style}>{$FieldName_value} </TD></TR>

{END fieldname_show}



Then show/hide this row use Print page: After record processed event:

if ($data["FieldName"])

$record["fieldname_show"] = true;

else

$record["fieldname_show"] = false;
A
albanfi author 3/23/2010



Hi,
you can edit HTML on the Visual Editor tab in HTML mode:

{BEGIN fieldname_show}

<TR>

<TD class=shade width="20%">{$label TableName FieldName}</TD>

<TD {$FieldName_style}>{$FieldName_value} </TD></TR>

{END fieldname_show}



Then show/hide this row use Print page: After record processed event:

if ($data["FieldName"])

$record["fieldname_show"] = true;

else

$record["fieldname_show"] = false;




Hi

thanks for the answer but I'm in trouble ...
I wrote this code and now the field is always hided ... what is wrong?

{BEGIN quotazione_show}<TR>

<TD style="BACKGROUND-COLOR: #ffffff" class=shade width="20%"

mywidth="188"><STRONG><FONT color=#0000ff size=4>Quotazione</FONT></STRONG></TD>

<TD {$quotazione_style} mywidth="750"><FONT size=4>{$quotazione_value}</FONT> </TD></TR>{END quotazione_show}


if ($data["Quotazione"])

$record["quotazione_show"] = true;

else

$record["quotazione_show"] = false;
Sergey Kornilov admin 3/23/2010

Your code looks correct. I suggest to post your application to demo account and contact support directly at http://support.xlinesoft.com sending your application URL.