• Mark Potten
  • NEWBIE
  • 0 Points
  • Member since 2019

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 5
    Replies
HI All

I am trying to add a page break to stop my parts and labour charge tables from spreeding across the page 1 and page 2 boundry . I am very new to coding so not overly familiar with things as I am self taught.

What happens is that sometimes the actions taken section (the work that was carried out on a repair) is long and the parts and labour tables run over the pages with the header on page 1 and the items uses on page 2. I would like to have a page break so that the tabel stays together and not runs over the page but this only has to happen if the report goes across multpile pages.

here is the code section that relates to the area on the PDF i am refering too
 
</tr>
            <tr style="{!IF(TRIM(Case.Description) = '', 'display:none', '')}">
                <td colspan="2"><br /><b>Description:</b><br />{!Case.Description}</td>
            </tr>
            <tr>
                <td colspan="2"><br /><b>Actions Taken:</b><apex:outputText escape="false" value="{!Case.Actions_Taken__c}" /></td>
            </tr>
            <tr>
                <th style="{!IF(Case.Hardware_Modification_Upgrade__c, '', 'display:none')}">
                    Hardware Upgrade Details:
                </th>
                <th style="{!IF(Case.Software_Update__c, '', 'display:none')}">
                    Software Upgrade Details:
                </th>
            </tr>
            <tr>
                <td style="{!IF(Case.Hardware_Modification_Upgrade__c, '', 'display:none')}">
                    {!case.Hardware_Modification_Upgrade_Details__c}    
                </td>
                <td style="{!IF(Case.Software_Update__c, '', 'display:none')}">
                    {!case.Software_Update_Details__c}!
                </td>
            </tr>
            <tr style="{!IF(Case.Parts_Used__r.size > 0, '', 'display:none')}">
                <td colspan="2">
                    <br />
                    <b>Parts Used:</b>
                    
                    <table class="itemTable">
                        <tr>
                            <th>Part Code</th>
                            <th>Description</th>
                            <th class="text-right">QTY</th>
                            <th class="text-right">Total Price</th>
                        </tr>
                        
                        <apex:repeat value="{!Case.Parts_Used__r}" var="part">
                            <tr>
                                <td>{!part.Product__r.Code__c}</td>
                                <td>{!part.Product__r.Name}</td>
                                <td class="text-right">{!part.Quantity__c}</td>
                                <td class="text-right"><span style="{!IF(part.Total_Price__c = 0, 'display:none', '')}">${!part.Total_Price__c}</span></td>
                            </tr>
                        </apex:repeat>
                        
                    </table>
                    
                </td>
            </tr>
            
            <tr style="{!IF(Case.Labour_Charges__r.size > 0, '', 'display:none')}">
                <td colspan="2">
                    <br />
                    <b>Labour:</b>
                    
                    <table class="itemTable">
                        <tr>
                            <th>Date</th>
                            <th>Start Time</th>
                            <th>Finish Time</th>
                            <th>Travel Hours</th>
                            <th>Total Hours</th>
                        </tr>
                        
                        <apex:repeat value="{!Case.Labour_Charges__r}" var="l">
                            <tr>
                                <td>
                                    <apex:outputText value="{0,date,dd'/'MM'/'yyyy}">
                                        <apex:param value="{!l.Date__c}" /> 
                                    </apex:outputText>
                                </td>
                                <td class="text-right">{!HOUR(l.Start_Time__c)}:{!lpad(TEXT(Minute(l.Start_Time__c)), 2, '0')}</td>
                                <td class="text-right">{!HOUR(l.Finish_Time__c)}:{!lpad(TEXT(Minute(l.Finish_Time__c)), 2, '0')}</td>
                                <td class="text-right">{!l.Total_Travel_Hours__c}</td>
                                <td class="text-right">{!l.Total_Combined_Hours__c}</td>
                            </tr>
                        </apex:repeat>
                        
                    </table>
                    
                </td>
            </tr>
example of the issue
example of the issue above

many thansk

mark


 
HI All

I am trying to add a page break to stop my parts and labour charge tables from spreeding across the page 1 and page 2 boundry . I am very new to coding so not overly familiar with things as I am self taught.

What happens is that sometimes the actions taken section (the work that was carried out on a repair) is long and the parts and labour tables run over the pages with the header on page 1 and the items uses on page 2. I would like to have a page break so that the tabel stays together and not runs over the page but this only has to happen if the report goes across multpile pages.

here is the code section that relates to the area on the PDF i am refering too
 
</tr>
            <tr style="{!IF(TRIM(Case.Description) = '', 'display:none', '')}">
                <td colspan="2"><br /><b>Description:</b><br />{!Case.Description}</td>
            </tr>
            <tr>
                <td colspan="2"><br /><b>Actions Taken:</b><apex:outputText escape="false" value="{!Case.Actions_Taken__c}" /></td>
            </tr>
            <tr>
                <th style="{!IF(Case.Hardware_Modification_Upgrade__c, '', 'display:none')}">
                    Hardware Upgrade Details:
                </th>
                <th style="{!IF(Case.Software_Update__c, '', 'display:none')}">
                    Software Upgrade Details:
                </th>
            </tr>
            <tr>
                <td style="{!IF(Case.Hardware_Modification_Upgrade__c, '', 'display:none')}">
                    {!case.Hardware_Modification_Upgrade_Details__c}    
                </td>
                <td style="{!IF(Case.Software_Update__c, '', 'display:none')}">
                    {!case.Software_Update_Details__c}!
                </td>
            </tr>
            <tr style="{!IF(Case.Parts_Used__r.size > 0, '', 'display:none')}">
                <td colspan="2">
                    <br />
                    <b>Parts Used:</b>
                    
                    <table class="itemTable">
                        <tr>
                            <th>Part Code</th>
                            <th>Description</th>
                            <th class="text-right">QTY</th>
                            <th class="text-right">Total Price</th>
                        </tr>
                        
                        <apex:repeat value="{!Case.Parts_Used__r}" var="part">
                            <tr>
                                <td>{!part.Product__r.Code__c}</td>
                                <td>{!part.Product__r.Name}</td>
                                <td class="text-right">{!part.Quantity__c}</td>
                                <td class="text-right"><span style="{!IF(part.Total_Price__c = 0, 'display:none', '')}">${!part.Total_Price__c}</span></td>
                            </tr>
                        </apex:repeat>
                        
                    </table>
                    
                </td>
            </tr>
            
            <tr style="{!IF(Case.Labour_Charges__r.size > 0, '', 'display:none')}">
                <td colspan="2">
                    <br />
                    <b>Labour:</b>
                    
                    <table class="itemTable">
                        <tr>
                            <th>Date</th>
                            <th>Start Time</th>
                            <th>Finish Time</th>
                            <th>Travel Hours</th>
                            <th>Total Hours</th>
                        </tr>
                        
                        <apex:repeat value="{!Case.Labour_Charges__r}" var="l">
                            <tr>
                                <td>
                                    <apex:outputText value="{0,date,dd'/'MM'/'yyyy}">
                                        <apex:param value="{!l.Date__c}" /> 
                                    </apex:outputText>
                                </td>
                                <td class="text-right">{!HOUR(l.Start_Time__c)}:{!lpad(TEXT(Minute(l.Start_Time__c)), 2, '0')}</td>
                                <td class="text-right">{!HOUR(l.Finish_Time__c)}:{!lpad(TEXT(Minute(l.Finish_Time__c)), 2, '0')}</td>
                                <td class="text-right">{!l.Total_Travel_Hours__c}</td>
                                <td class="text-right">{!l.Total_Combined_Hours__c}</td>
                            </tr>
                        </apex:repeat>
                        
                    </table>
                    
                </td>
            </tr>
example of the issue
example of the issue above

many thansk

mark


 

Hi,

 

I have a visualforce page rendered as PDF. Multiple records Information is repeated with the help of <apex:repeat> tags. If I have three records, currently all the three records information is displayed in a single page. My requirement is, if I have three records, information should be in three pages (based on the number of records), i.e., 1st record information in first page, 2nd in second page and 3rd in third page.

 

Which style tag will be helpful for this?

 

Can anyone suggest a solution? Any help is highly appreciated.

 

Regards,

Deepa

  • February 22, 2010
  • Like
  • 0