• Lukas Razim 17
  • NEWBIE
  • 10 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 0
    Replies
Hi. I found some articles how to generate header/footer in your pdf. However I cannot use renderas=pdf (as there are special characters in my language which are not generated properly, but it's just fine if I dont use renderas=pdf) and I would like to have footer and header generated on my pages to be printed later. It does work properly with the code below if I add renderas=pdf but like I said I cannot and when the page is generated without renderas=pdf, the footer text is placed right after the signature, not at the bottom of the page.
Can anyone tell me please where Im doing the mistake? Thank you very much
<apex:page standardController="Campaign" showHeader="false" applyBodyTag="false">

<head>
<style type="text/css" media="print">
@page {
@top-center {
content: element(header);
}
@bottom-left {
 content: element(footer);
}
}
 
div.header {
padding: 10px;
position: running(header);
}
div.footer {
display: block;
padding: 5px;
position: running(footer);
}
 
.pagenumber:before {
content: counter(page);
}
.pagecount:before {
content: counter(pages);
}
</style>
</head>


<apex:repeat value="{!Campaign.CampaignMembers}" var="line">
  
<div class="header"><div>My Header Text</div></div>

<div class="content">  
  
  <div style="page-break-after:always;">
  
  <apex:outputText value="{!line.Contact.Oslovujeme__c}," rendered="{!line.Status='Letter to Send'}" escape="false"/><br/>
  <apex:outputText value="{!Campaign.Hard_copy_invitation__c}" rendered="{!line.Status='Letter to Send'}" escape="false"/><br/>
  <apex:outputText value="Kind regards," rendered="{!line.Status='Letter to Send'}" escape="false"/><br/>
  <apex:outputText value="A-Team" rendered="{!line.Status='Letter to Send'}" escape="false"/><br/>
  
  <div class="footer"><div>My footer Text</div></div>
  
  </div>

 </div>  
          
  </apex:repeat>

</apex:page>
Hi,
I need to print out stickers(addresses) for envelopes to be sent out for campaign members who registered for my campaign (means they have status Registered), so the code below with custom button on campaign generates such list to be printed. However I kind of struggle with "rendered", the bold part of the code causes me troubles, Im getting error Generate_Stickers line 12, column 23: The element type "apex:pageBlockSectionItem" must be terminated by the matching end-tag "</apex:pageBlockSectionItem>"  
What am I doing wrong? Many thanks
<apex:page standardController="Campaign" showHeader="false" applyBodyTag="false" >
      <apex:pageBlock >
          <apex:pageBlockSection columns="3" showHeader="false">
                <apex:repeat value="{!Campaign.CampaignMembers}" var="line" >   
                    <apex:pageBlockSectionItem rendered="{!line.Status="Registered"}" dataStyle="width:33%" labelStyle="width:33%" >
    
                    {!line.Contact.Name}<BR/>
                    {!line.Contact.MailingStreet}<BR/>
                    {!line.Contact.MailingPostalCode} {!line.Contact.MailingCity}<BR/>
                    {!line.Contact.MailingCountry}<BR/>  
                    
                    </apex:pageBlockSectionItem>
                </apex:repeat>
          </apex:pageBlockSection>
      </apex:pageBlock> 
</apex:page>

 
Hi. I found some articles how to generate header/footer in your pdf. However I cannot use renderas=pdf (as there are special characters in my language which are not generated properly, but it's just fine if I dont use renderas=pdf) and I would like to have footer and header generated on my pages to be printed later. It does work properly with the code below if I add renderas=pdf but like I said I cannot and when the page is generated without renderas=pdf, the footer text is placed right after the signature, not at the bottom of the page.
Can anyone tell me please where Im doing the mistake? Thank you very much
<apex:page standardController="Campaign" showHeader="false" applyBodyTag="false">

<head>
<style type="text/css" media="print">
@page {
@top-center {
content: element(header);
}
@bottom-left {
 content: element(footer);
}
}
 
div.header {
padding: 10px;
position: running(header);
}
div.footer {
display: block;
padding: 5px;
position: running(footer);
}
 
.pagenumber:before {
content: counter(page);
}
.pagecount:before {
content: counter(pages);
}
</style>
</head>


<apex:repeat value="{!Campaign.CampaignMembers}" var="line">
  
<div class="header"><div>My Header Text</div></div>

<div class="content">  
  
  <div style="page-break-after:always;">
  
  <apex:outputText value="{!line.Contact.Oslovujeme__c}," rendered="{!line.Status='Letter to Send'}" escape="false"/><br/>
  <apex:outputText value="{!Campaign.Hard_copy_invitation__c}" rendered="{!line.Status='Letter to Send'}" escape="false"/><br/>
  <apex:outputText value="Kind regards," rendered="{!line.Status='Letter to Send'}" escape="false"/><br/>
  <apex:outputText value="A-Team" rendered="{!line.Status='Letter to Send'}" escape="false"/><br/>
  
  <div class="footer"><div>My footer Text</div></div>
  
  </div>

 </div>  
          
  </apex:repeat>

</apex:page>