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
someguy.ax1382someguy.ax1382 

Attachment Body not formatted

Im pulling out the body of the attachment and changing some data, I'am able to display it on a VF page but it doesn't have any formating to it. When i look at the source of the page its formated. Is there something in VF page to tell it to use the formating.

 

atdata = [SELECT Body FROM Attachment WHERE id =: attachID LIMIT 1];
     
     Blob abody = atdata[0].Body;
     String displayScore = abody.toString();

 

<apex:page controller="WCS" showHeader="false" sidebar="false">
  {!WScore}
  <apex:outputText value="{!displayScore}" escape="false"/>
  
</apex:page>

 

SRKSRK

Try this

 

public Attachment att{get;set;}
att = new Attachment();
atdata = [SELECT Body FROM Attachment WHERE id =: attachID LIMIT 1];
     
     att.Body =  atdata[0].Body +"WHat ever changes u want";
 

<apex:page controller="WCS" showHeader="false" sidebar="false">
  {!WScore}
  <apex:outputfield value="{!att.Body}" escape="false"/>
 
</apex:page>