+ Start a Discussion
sfdeveloper9sfdeveloper9 

Printable View on visual force page

I am trying to put Printable View option on a VF page and I am using PrintUrl attribute in Apex:sectionheader tag. my code is similar to this. but if I click on the Printable View the popup window is not coming in the same format as we get for standard pages. Is there any working around or am I missing something. Please help me. Thanks in advance.

 

PK

 

<apex:sectionHeader title="Page Title" printUrl="/apex/SamplePage?Id={!companyId}"/>
WesNolte__cWesNolte__c

Hey

 

Can you post the code for "SamplePage" please.

 

Wes

sfdeveloper9sfdeveloper9
<apex:page controller="SampleController" tabStyle="Account" sidebar="false" showHeader="false">  
<apex:sectionHeader title="Sample Page" printUrl="/apex/CommonProspectClients?Id={!companyId}"/>
<apex:form >
    <apex:pageblock >
        <apex:pageblockSection title="Common Companies" columns="1" >
            <apex:pageblockTable value="{!commonCompaniesList}" var="cc">
                <apex:column value="{!cc.Relationship_Status__c}"/>
                <apex:column value="{!cc.Company__c}"/>
  <apex:column value="{!cc.Company__r.Category__c}"/> <apex:column value="{!cc.Company__r.Billing_City__c}"/> <apex:column value="{!cc.Company__r.Billing_State__c}"/> <apex:column value="{!cc.Company__r.Billing_Country__c}"/> <apex:column value="{!cc.Company__r.Website}"/>  </apex:pageblockTable> </apex:pageblockSection>
       </apex:pageblock>
    </apex:form>
</apex:page>

If I click on the printable view link on this VF page it should look like the standard printable view page, ie without sidebar and header, it should also have SFDC logo and print links.
WesNolte__cWesNolte__c

So is the page that you've detailed called "CommonPropectClients"? If not can you list that code too please.

sfdeveloper9sfdeveloper9

Yes, that is the same page I am trying to print. CommonProspectClients.

 

Thanks

PK

QuiqueprQuiquepr

Any input in how to get rid of the salesforce icon?  Greatly appreciate it....

 

Tks,

Qui


sfdeveloper9 wrote:
<apex:page controller="SampleController" tabStyle="Account" sidebar="false" showHeader="false">  
<apex:sectionHeader title="Sample Page" printUrl="/apex/CommonProspectClients?Id={!companyId}"/>
<apex:form >
    <apex:pageblock >
        <apex:pageblockSection title="Common Companies" columns="1" >
            <apex:pageblockTable value="{!commonCompaniesList}" var="cc">
                <apex:column value="{!cc.Relationship_Status__c}"/>
                <apex:column value="{!cc.Company__c}"/>
  <apex:column value="{!cc.Company__r.Category__c}"/> <apex:column value="{!cc.Company__r.Billing_City__c}"/> <apex:column value="{!cc.Company__r.Billing_State__c}"/> <apex:column value="{!cc.Company__r.Billing_Country__c}"/> <apex:column value="{!cc.Company__r.Website}"/>  </apex:pageblockTable> </apex:pageblockSection>
       </apex:pageblock>
    </apex:form>
</apex:page>

If I click on the printable view link on this VF page it should look like the standard printable view page, ie without sidebar and header, it should also have SFDC logo and print links.

que

 

VIP Condos TorontoVIP Condos Toronto
Hi there Qui, it seems you already added showHeader="false" and sidebar="false" so if you click on the "printable view" button next to the visual force element on your object (top right), you should have a view without any sidebars.