function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
immaimma 

"Syntax error" when I try to display just the variable != NULL with the condition IF

Hello everybody,
I have a custom object 'Stagiaire__c' having few fields:Name,CNE,e-mail,date_de_naissance,Téléphone
 
I want to create a PDF documents whish display just the fields are not NULL
if for exemple,"CNE == null" , <p> CNE: </p> will not display in my PDF
 
Here is my code:

<apex:page standardController="Stagiaire__c" renderas="pdf" showheader="false" applyhtmltag="false" >
  <apex:pageBlock title="Fiche Stagiaire">
       <apex:pageblockTable value="{!Stagiaire__c}" var="s">
            <apex:outputpanel rendered="{!IF(ISBLANK(s.Name),false,true)}">
              <p>Nom & Prénom: </p>   <apex:column value="{!s.Name}"/>
              </apex:outputpanel>
          <apex:outputpanel rendered="{!IF(ISBLANK(s.CNE__c),false,true)}">
             <p>CNE:</p>                  <apex:column value="{!s.CNE__c}"/>
             </apex:outputpanel>
             <apex:outputpanel rendered="{!IF(ISBLANK(s.Téléphone__c),false,true)}">
                <p>Téléphone! </p>          <apex:column value="{!s.Téléphone__c}"/>
            </apex:outputpanel>
             <apex:outputpanel rendered="{!IF(ISBLANK(s.e-mail__c),false,true)}">
               <p>E-mail: </p>               <apex:column value="{!s.e-mail__c}"/>
              </apex:outputpanel>
           </apex:pageblockTable>
   </apex:pageblock>
  </apex:page>

But I get this error : syntax error !!!! please help meeee !!!!
ManojjenaManojjena
Hey Imma,
You can try with below code
<apex:page standardController="Stagiaire__c" renderas="pdf" showheader="false"  >
  <apex:pageBlock title="Fiche Stagiaire">
       <apex:pageblockTable value="{!Stagiaire__c}" var="s">
            <apex:outputpanel rendered="{!IF(s.Name != null ,true,false)}">
              <p>Nom & Prénom: </p>   <apex:column value="{!s.Name}"/>
              </apex:outputpanel>
          <apex:outputpanel rendered="{!IF(s.CNE__c != null ,true,false)}">
             <p>CNE:</p>                  <apex:column value="{!s.CNE__c}"/>
             </apex:outputpanel>
             <apex:outputpanel rendered="{!IFs.Téléphone__c != null ,true,false)}">
                <p>Téléphone! </p>          <apex:column value="{!s.Téléphone__c}"/>
            </apex:outputpanel>
             <apex:outputpanel rendered="{!IF(s.e-mail__c != null ,true,false)}">
               <p>E-mail: </p>               <apex:column value="{!s.e-mail__c}"/>
              </apex:outputpanel>
           </apex:pageblockTable>
   </apex:pageblock>
  </apex:page>

 
immaimma
Thank you Manoj Kumar jena for your replay
I get this error :
Error: <apex:column> must be the direct child of either <apex:dataTable> or <apex:pageBlockTable>
Waqar Hussain SFWaqar Hussain SF
<apex:outputpanel Style="{!IF(ISBLANK(s.CNE__c),'display: none;','display: block;')}">
Waqar Hussain SFWaqar Hussain SF
<apex:outputpanel Style="{!IF(ISBLANK(s.CNE__c),'display: none;','display: block;')}">