[SalesForce] Report build using the VF page

I would like to design the custom report (Exact report view) using visualforce page and also trying to provide the inline edit feature in the report.

Any one have the idea for that?

Best Answer

If your report is simple table then you can use component to enable inline Editing Support.

Here is sample code for your reference.

<apex:page standardController="Account" recordSetVar="records" id="thePage"> 
<apex:form id="theForm"> 
    <apex:pageBlock id="thePageBlock"> 
        <apex:pageBlockTable value="{!records}" var="record" id="thePageBlockTable"> 
            <apex:column >
                <apex:outputField value="{!record.Name}" id="AccountNameDOM" /> 
                <apex:facet name="header">Name</apex:facet>
            </apex:column>
            <apex:column >
                <apex:outputField value="{!record.Type}" id="AccountTypeDOM" /> 
                <apex:facet name="header">Type</apex:facet>
            </apex:column>
            <apex:column >
                <apex:outputField value="{!record.Industry}" 
                    id="AccountIndustryDOM" />  
                    <apex:facet name="header">Industry</apex:facet>
            </apex:column>
            <apex:inlineEditSupport event="ondblClick" 
                    showOnEdit="saveButton,cancelButton" hideOnEdit="editButton" /> 
        </apex:pageBlockTable> 
        <apex:pageBlockButtons > 
            <apex:commandButton value="Edit" action="{!save}" id="editButton" />
            <apex:commandButton value="Save" action="{!save}" id="saveButton" />
            <apex:commandButton value="Cancel" action="{!cancel}" id="cancelButton" />
        </apex:pageBlockButtons> 
    </apex:pageBlock> 
</apex:form>
</apex:page>

This code is copied from manual and here is the link for same for more details.

If your report is not in simple table format and contains grouping and aggregation then you will have to use JQuery or other Javscript code for this.

Here is example for same.

onchange with Outputfield and inline editing

Related Topic