• Lukas Razim 29
  • NEWBIE
  • 10 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 4
    Replies
Hi everyone,

Im trying to generate table of all campaign members with their names and addresses, render as pdf (or html or whatever) but with fixed number of rows and columns per page. The idea is that I need this table to be printed on paper with stickers that could be used on envelopes and sent to those members.
I added custom button on Campaign layout generating the pdf, but Im struggling with the code (Im really no coder btw:). See below code, what I just started but got stuck, this only generates cells in one row... I just used Account and Email fields instead of address otherwise it is same. Could please somebody tell me how to modify to make grid 3x10 fixed? Many thanks

<apex:page standardController="Campaign" showHeader="false" renderAs="pdf" applyBodyTag="false">
  <span style="font-family: Arial Unicode MS">
     <table border="0" width="100%" id="table4">
           <apex:repeat value="{!Campaign.CampaignMembers}" var="line">         
           <td>{!line.Contact.Name}<br/>{!line.Contact.Account}<br/>{!line.Contact.Email}<br/></td>            
        </apex:repeat> 
    </table> 
  </span>  
</apex:page>
Hi All,

I need to generate letter (in paper form) for all campaign members (we use campaigns more like events, so those letters are supposed to be invitations). I added custom button on the campaign layout that should generate letters for all of them to print. I also added rich text field on campaign object where the text is stored (text would be same for all letters, just the beginning "Dear Mr. xxx" would differ and I have Oslovujeme__c custom field for this on contact object). See below code:

apex:page standardController="Campaign" showHeader="false" renderAs="pdf" applyBodyTag="false">
  <apex:repeat value="{!Campaign.CampaignMembers}" var="line">
    <div style="page-break-after:always;">
  <span style="font-family: Arial Unicode MS">
  {!line.Contact.Oslovujeme__c}, <br/><br/>
    <apex:outputText value="{!Campaign.Campaign_Letter_Rich__c}" escape="false"/>
    </span>
  </div>
    </apex:repeat>
</apex:page> 

The problem is.. that we have special characters in my language, such as ř,ě,ň, etc. These characters are generated correctly on pdf only for my custom field on contact Oslovujeme__c. But if any of these characters are in Campaign_Letter_Rich__c, they are missing on final pdf. Maybe it has something to do with "escape" attribute? If I dont use this escape=false, characters are rendered fine but with all the code around of course..
Check the sample output below in case I input same value "ěščřžýáíéúů" into both fields Oslovujeme__c and Campaign_Letter_Rich__c (assuming I have only one contact as campaign member). Some of the characters are missing then.. Can anyone help please? Many thanks

ěščřžýáíéúů,

šžýáíéú
 
Hi All,

I have requirement to generate letter(in paper form) for all campaign members (we use campaigns more like events, so those letters are supposed to be invitations). So I added custom button on the layout that should render the information as pdf. I also added rich text field where the text for the letter is stored. See below code:

apex:page standardController="Campaign" showHeader="false" renderAs="pdf" applyBodyTag="false">
  <apex:repeat value="{!Campaign.CampaignMembers}" var="line">
    <div style="page-break-after:always;">
  <span style="font-family: Arial Unicode MS">
  {!line.Contact.Oslovujeme__c}, <br/><br/>
    <apex:outputText value="{!Campaign.Campaign_Letter_Rich__c}" escape="false"/>
    </span>
  </div>
    </apex:repeat>
</apex:page> 

The problem is.. that we have special characters in my language, such as ř,ě,ň, etc. These characters are generated correctly on pdf only for my custom field on contact Oslovujeme__c. But if any of these characters are in Campaign_Letter_Rich__c, they are missing on pdf. I suppose it has something to do with "escape" attribute. If I dont use it characters are rendered fine but with all the code around.. Can anyone help me please?
Thank you very much
Hi everyone,

Im trying to generate table of all campaign members with their names and addresses, render as pdf (or html or whatever) but with fixed number of rows and columns per page. The idea is that I need this table to be printed on paper with stickers that could be used on envelopes and sent to those members.
I added custom button on Campaign layout generating the pdf, but Im struggling with the code (Im really no coder btw:). See below code, what I just started but got stuck, this only generates cells in one row... I just used Account and Email fields instead of address otherwise it is same. Could please somebody tell me how to modify to make grid 3x10 fixed? Many thanks

<apex:page standardController="Campaign" showHeader="false" renderAs="pdf" applyBodyTag="false">
  <span style="font-family: Arial Unicode MS">
     <table border="0" width="100%" id="table4">
           <apex:repeat value="{!Campaign.CampaignMembers}" var="line">         
           <td>{!line.Contact.Name}<br/>{!line.Contact.Account}<br/>{!line.Contact.Email}<br/></td>            
        </apex:repeat> 
    </table> 
  </span>  
</apex:page>
Hi All,

I have requirement to generate letter(in paper form) for all campaign members (we use campaigns more like events, so those letters are supposed to be invitations). So I added custom button on the layout that should render the information as pdf. I also added rich text field where the text for the letter is stored. See below code:

apex:page standardController="Campaign" showHeader="false" renderAs="pdf" applyBodyTag="false">
  <apex:repeat value="{!Campaign.CampaignMembers}" var="line">
    <div style="page-break-after:always;">
  <span style="font-family: Arial Unicode MS">
  {!line.Contact.Oslovujeme__c}, <br/><br/>
    <apex:outputText value="{!Campaign.Campaign_Letter_Rich__c}" escape="false"/>
    </span>
  </div>
    </apex:repeat>
</apex:page> 

The problem is.. that we have special characters in my language, such as ř,ě,ň, etc. These characters are generated correctly on pdf only for my custom field on contact Oslovujeme__c. But if any of these characters are in Campaign_Letter_Rich__c, they are missing on pdf. I suppose it has something to do with "escape" attribute. If I dont use it characters are rendered fine but with all the code around.. Can anyone help me please?
Thank you very much