admin管理员组文章数量:1404604
I have a sample here some data here that i want to render. The problem is that it is not showing the grand total section and is just a big blank row.
What am i doing wrong that is causing the issue:
<apex:component id="CPQQuoteLines" controller="CPQQuoteLinesEmailTemplateController" access="global">
<style type="text/css">
.bordered-table {
border: 1px solid black;
border-collapse: collapse;
width: 100%;
}
.bordered-table th, .bordered-table td {
border: 1px solid black;
padding: 8px;
text-align: left;
background-color: #f2f2f2; /* Light gray background for header */
white-space: nowrap;
}
.bordered-table th {
background-color: #90d5ff; /* Blue background for header */
color: black; /* White text for header */
}
/* Footer Row Styling */
.footer-row td {
font-weight: bold;
background-color: #f9f9f9;
}
</style>
<apex:attribute name="quoteIdAttr" description="CPQ Quote Id" type="ID" assignTo="{!srcQuoteId}" />
<!-- Render the table -->
<apex:dataTable value="{!quoteLines}" var="line" id="theTable" rowClasses="odd,even" width="100%" styleClass="bordered-table">
<apex:column headerValue="Items">
<apex:outputText value="{!line.SBQQ__Product__r.Name}" />
</apex:column>
<apex:column headerValue="Contractual Delivery Date">
<apex:outputText value="{!line.SBQQ__Quote__r.SBQQ__Opportunity2__r.Contract_Delivery_Date__c}" />
</apex:column>
<apex:column headerValue="Market Share Type">
<apex:outputText value="{!line.SBQQ__Quote__r.SBQQ__Opportunity2__r.Market_Share_Type__c}" />
</apex:column>
<apex:column headerValue="Sales Price">
<apex:outputText value="{0, number, currency}">
<apex:param value="{!line.SBQQ__PackageListTotal__c}" />
</apex:outputText>
</apex:column>
<apex:column headerValue="Share of Deal">
<apex:outputText value="{0, number, percent}">
<apex:param value="{!line.SBQQ__PackageListTotal__c / totalSalesPrice}" />
</apex:outputText>
</apex:column>
<apex:column headerValue="Target Price">
<apex:outputText value="{0, number, currency}">
<apex:param value="{!line.Component_Target_Price__c}" />
</apex:outputText>
</apex:column>
<apex:column headerValue="Price Performance">
<apex:outputText value="{0, number, percent}">
<apex:param value="{!line.SBQQ__PackageListTotal__c / line.Component_Target_Price__c}" />
</apex:outputText>
</apex:column>
<apex:column headerValue="RAM Value">
<apex:outputText value="{0, number, currency}">
<apex:param value="{!line.Rev_Total__c}" />
</apex:outputText>
</apex:column>
<apex:column headerValue="Ram Margin %">
<apex:outputText value="{0, number, percent}">
<apex:param value="{!(line.Rev_Total__c - line.SBQQ__PackageCost__c) / line.Rev_Total__c}" />
</apex:outputText>
</apex:column>
<!-- Footer Row -->
<apex:facet name="footer">
<tr>
<td><strong>Grand Total</strong></td>
<td></td>
<td></td>
<td>
<apex:outputText value="{0, number, currency}">
<apex:param value="{!totalSalesPrice}" />
</apex:outputText>
</td>
<td>
<apex:outputText value="{0, number, percent}">
<apex:param value="{!totalShareOfDeal}" />
</apex:outputText>
</td>
<td>
<apex:outputText value="{0, number, currency}">
<apex:param value="{!totalTargetPrice}" />
</apex:outputText>
</td>
<td>
<apex:outputText value="{0, number, percent}">
<apex:param value="{!totalPackagePerformance}" />
</apex:outputText>
</td>
<td>
<apex:outputText value="{0, number, currency}">
<apex:param value="{!totalRAMValue}" />
</apex:outputText>
</td>
<td>
<apex:outputText value="{0, number, percent}">
<apex:param value="{!totalRamMargin}" />
</apex:outputText>
</td>
</tr>
</apex:facet>
</apex:dataTable>
</apex:component>
I've tried to do it various ways like moving the footer section or doing it without footer but its either comes as another table or it does not print since its not part of the table group.
I have a sample here some data here that i want to render. The problem is that it is not showing the grand total section and is just a big blank row.
What am i doing wrong that is causing the issue:
<apex:component id="CPQQuoteLines" controller="CPQQuoteLinesEmailTemplateController" access="global">
<style type="text/css">
.bordered-table {
border: 1px solid black;
border-collapse: collapse;
width: 100%;
}
.bordered-table th, .bordered-table td {
border: 1px solid black;
padding: 8px;
text-align: left;
background-color: #f2f2f2; /* Light gray background for header */
white-space: nowrap;
}
.bordered-table th {
background-color: #90d5ff; /* Blue background for header */
color: black; /* White text for header */
}
/* Footer Row Styling */
.footer-row td {
font-weight: bold;
background-color: #f9f9f9;
}
</style>
<apex:attribute name="quoteIdAttr" description="CPQ Quote Id" type="ID" assignTo="{!srcQuoteId}" />
<!-- Render the table -->
<apex:dataTable value="{!quoteLines}" var="line" id="theTable" rowClasses="odd,even" width="100%" styleClass="bordered-table">
<apex:column headerValue="Items">
<apex:outputText value="{!line.SBQQ__Product__r.Name}" />
</apex:column>
<apex:column headerValue="Contractual Delivery Date">
<apex:outputText value="{!line.SBQQ__Quote__r.SBQQ__Opportunity2__r.Contract_Delivery_Date__c}" />
</apex:column>
<apex:column headerValue="Market Share Type">
<apex:outputText value="{!line.SBQQ__Quote__r.SBQQ__Opportunity2__r.Market_Share_Type__c}" />
</apex:column>
<apex:column headerValue="Sales Price">
<apex:outputText value="{0, number, currency}">
<apex:param value="{!line.SBQQ__PackageListTotal__c}" />
</apex:outputText>
</apex:column>
<apex:column headerValue="Share of Deal">
<apex:outputText value="{0, number, percent}">
<apex:param value="{!line.SBQQ__PackageListTotal__c / totalSalesPrice}" />
</apex:outputText>
</apex:column>
<apex:column headerValue="Target Price">
<apex:outputText value="{0, number, currency}">
<apex:param value="{!line.Component_Target_Price__c}" />
</apex:outputText>
</apex:column>
<apex:column headerValue="Price Performance">
<apex:outputText value="{0, number, percent}">
<apex:param value="{!line.SBQQ__PackageListTotal__c / line.Component_Target_Price__c}" />
</apex:outputText>
</apex:column>
<apex:column headerValue="RAM Value">
<apex:outputText value="{0, number, currency}">
<apex:param value="{!line.Rev_Total__c}" />
</apex:outputText>
</apex:column>
<apex:column headerValue="Ram Margin %">
<apex:outputText value="{0, number, percent}">
<apex:param value="{!(line.Rev_Total__c - line.SBQQ__PackageCost__c) / line.Rev_Total__c}" />
</apex:outputText>
</apex:column>
<!-- Footer Row -->
<apex:facet name="footer">
<tr>
<td><strong>Grand Total</strong></td>
<td></td>
<td></td>
<td>
<apex:outputText value="{0, number, currency}">
<apex:param value="{!totalSalesPrice}" />
</apex:outputText>
</td>
<td>
<apex:outputText value="{0, number, percent}">
<apex:param value="{!totalShareOfDeal}" />
</apex:outputText>
</td>
<td>
<apex:outputText value="{0, number, currency}">
<apex:param value="{!totalTargetPrice}" />
</apex:outputText>
</td>
<td>
<apex:outputText value="{0, number, percent}">
<apex:param value="{!totalPackagePerformance}" />
</apex:outputText>
</td>
<td>
<apex:outputText value="{0, number, currency}">
<apex:param value="{!totalRAMValue}" />
</apex:outputText>
</td>
<td>
<apex:outputText value="{0, number, percent}">
<apex:param value="{!totalRamMargin}" />
</apex:outputText>
</td>
</tr>
</apex:facet>
</apex:dataTable>
</apex:component>
I've tried to do it various ways like moving the footer section or doing it without footer but its either comes as another table or it does not print since its not part of the table group.
Share Improve this question asked Mar 10 at 15:34 Symbiote ScornsSymbiote Scorns 487 bronze badges1 Answer
Reset to default 1Your footer code starts with '<tr>'. I'm sure this is the problem. Because the parent for the '<tr>' tag should be '<table>' and you don't have the '<table>' before '<tr>'. Either build normal table inside the
<apex:facet name="footer">
or use this example to build what you need
<apex:page controller="dataTableCon" id="thePage">
<apex:dataTable value="{!accounts}" var="account" id="theTable"
rowClasses="odd,even" styleClass="tableClass">
<apex:facet name="caption">table caption</apex:facet>
<apex:facet name="header">table header</apex:facet>
<apex:facet name="footer">table footer</apex:facet>
<apex:column>
<apex:facet name="header">Name</apex:facet>
<apex:facet name="footer">column footer</apex:facet>
<apex:outputText value="{!account.name}"/>
</apex:column>
<apex:column>
<apex:facet name="header">Owner</apex:facet>
<apex:facet name="footer">column footer</apex:facet>
<apex:outputText value="{!account.owner.name}"/>
</apex:column>
</apex:dataTable>
</apex:page>
https://developer.salesforce/docs/atlas.en-us.pages.meta/pages/pages_compref_dataTable.htm
本文标签: html tableVisualforce component not printing footerStack Overflow
版权声明:本文标题:html table - Visualforce component not printing footer - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744837708a2627733.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论