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
shravanshravan 

custom visualforce for Reports

 

Hi,

 

I am uploaded Image.

 

I developed Custom Visualforce for the Reports in this 4 fields

Name        Address       Phone       Role

aaa

                                         123             Manager

xxx               aaa             

 

 

 

I want  '--' like this when feilds are empty.

 

 

 

 

 

 

Please see and do the needful.

 

 

continue lines

Best Answer chosen by Admin (Salesforce Developers) 
Teach_me_howTeach_me_how

heres the other way around. this has been tested

 

<apex:page standardController="account" >
    <apex:form >
        <apex:pageBlock title="Contacts">
            <apex:pageBlockTable value="{!account.contacts}" var="item">
                <apex:column headerValue="Name">
                    <apex:outputText value="{!item.name}" rendered="{!!ISNULL(item.name)}"/>
                    <apex:outputText value="--" rendered="{!ISNULL(item.name)}"/>
                </apex:column>
                <apex:column headerValue="Phone" >
                    <apex:outputText value="{!item.name}" rendered="{!!ISNULL(item.phone)}"/>
                    <apex:outputText value="--" rendered="{!ISNULL(item.phone)}"/>
                </apex:column>
            </apex:pageBlockTable>
        </apex:pageBlock>
    </apex:form>
</apex:page>

All Answers

bob_buzzardbob_buzzard

How are you rendering the values?  i.e. are you using outputext, outputfield?

shravanshravan

Using below tags:

 

<apex:pageBlock title="Contacts">
<apex:pageBlockTable value="{! account.contacts}" var="item">
<apex:column value="{! item.name}"/>
<apex:column value="{! item.Phone}"/>
</apex:pageBlockTable>
</apex:pageBlock>

Teach_me_howTeach_me_how

try this

 

<apex:pageBlock title="Contacts">
<apex:pageBlockTable value="{! account.contacts}" var="item">
<apex:column value="{!IF(ISNULL(item.name),'--',item.name)}"/>
<apex:column value="{!IF(ISNULL(item.phone),'--',item.phone)}"/>
</apex:pageBlockTable>
</apex:pageBlock>

 


shravanshravan

Hi, I am getting Syntax error li"e this

"Error: Syntax error. Missing ')' "

Teach_me_howTeach_me_how

heres the other way around. this has been tested

 

<apex:page standardController="account" >
    <apex:form >
        <apex:pageBlock title="Contacts">
            <apex:pageBlockTable value="{!account.contacts}" var="item">
                <apex:column headerValue="Name">
                    <apex:outputText value="{!item.name}" rendered="{!!ISNULL(item.name)}"/>
                    <apex:outputText value="--" rendered="{!ISNULL(item.name)}"/>
                </apex:column>
                <apex:column headerValue="Phone" >
                    <apex:outputText value="{!item.name}" rendered="{!!ISNULL(item.phone)}"/>
                    <apex:outputText value="--" rendered="{!ISNULL(item.phone)}"/>
                </apex:column>
            </apex:pageBlockTable>
        </apex:pageBlock>
    </apex:form>
</apex:page>

This was selected as the best answer
shravanshravan

Ya its woriking thanks

Teach_me_howTeach_me_how

please mark this thread as solve.

bob_buzzardbob_buzzard

I'd also look at using a custom component to do this, otherwise if you decide you want to change the '-' to another value ('N/A, for example) you'd only have to make the change in one place, rather than on every column.

 

 

BobBob

Is there a workbook for Visulaforce reports? I need to create a report that shows account owners, events, customer types.

I need to view how many events does a account owner have for each customer type. Customer type is a custom field.

 

Is this possible? Any help would be appreciated.

bob_buzzardbob_buzzard

There isn't a workbook for Visualforce reports, rather reports are something you can build using visualforce.

 

There is a visualforce workbook at:

 

http://www.salesforce.com/us/developer/docs/workbook_vf/workbook_vf.pdf