This topic is locked

How to hide a Row in the Printer friendly page depending on some value

6/22/2011 3:45:21 PM
ASPRunnerPro General questions
C
chingupt author

Hi,
I have a table "Student Course Details" and "Student Personal Information". The Table "Student Personal Information" contains State and City information of the user.
Now i have formatted the Printer Friendly Page of "Student Course Details" which also displays the City and State from the "Student Personal Information" Table.
The Page displays like this:
----------------------------------------------------------------
Student Details:
Name: chingupt

Age: xxx

City: aaa

State: bbb
---

---

---
------------------------------------------------------------------
Now i want that if the "City" is not populated for a student in the table, this particular row should not get displayed instead of showing a blank field.
The code of the "Printer Page" which displays the City is as follows:
<TR>

<TD class=shade width="20%"><STRONG>City:</STRONG></TD>

<TD

{$Perm_Addr_City_style}>{$Perm_Addr_City_value} </TD></TR>

<TR>
I tried formatting it to
if({$Perm_Addr_City_value})

{

echo "<TR>";

echo "<TD class=shade width=\"20%\"><STRONG>City:</STRONG></TD>";

echo "<TD {$Perm_Addr_City_style}>{$Perm_Addr_City_value} </TD></TR>";

echo "<TR>";

}
but it does not work.
I also tried the php code snippet but it did not work.
Ill be very grateful to anyone who can help me out in this.
Regards

Sergey Kornilov admin 6/22/2011

I would suggest to use 'Before record processed' process event to hide certain rows on Printer-friendly page.
More info:

http://xlinesoft.com/phprunner/docs/before_record_processed.htm

C
chingupt author 6/22/2011

Thanks.
Sergey, can you or someone please paste a small code snippet here for reference.

How this event can help in deciding which field to show or not?
I will be extremely grateful for the same.
Regards

Sachin

Sergey Kornilov admin 6/23/2011

My post answers 'How to hide a Row?' question.
If you hide a certain field this will break the table structure, right?