• dbalke1.3880741030651309E12
  • NEWBIE
  • 0 Points
  • Member since 2013

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 1
    Replies
The code below has been modified from this solution: http://salesforce.stackexchange.com/questions/34261/how-to-generate-excel-files-with-the-multiple-sheets-in-visualforce which does work but I was looking to add extra functionality such as freezing the top row pane, changing tab color, and filtering.....Can anyone point me in the right direction on how I can do this? I don't really know much about XML.  I have tried this to freeze the panes but it keeps saying the excel file is corrupt and won't open

    <WorksheetOptions xmlns="urn:schemas-microsoft-com:office:excel">
     <Selected/>
       <FreezePanes/>
       <FrozenNoSplit/>
       <SplitHorizontal>1</SplitHorizontal>
       <TopRowBottomPane>1</TopRowBottomPane>
       <SplitVertical>1</SplitVertical>
       <LeftColumnRightPane>1</LeftColumnRightPane>
       <ActiveRow>2</ActiveRow>
       <Panes>
        <Pane>
         <Number>1</Number>
        </Pane>
        <Pane>
         <Number>2</Number>
        </Pane>
       </Panes>
       <ProtectObjects>False</ProtectObjects>
       <ProtectScenarios>False</ProtectScenarios>
      </WorksheetOptions>

Actual Code   
    
    <apex:page controller="CustomPBListController" contentType="txt/xml#myTest.xls" cache="true">
     <apex:outputText value="{!xlsHeader}"/>
     <Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet"
     xmlns:o="urn:schemas-microsoft-com:office:office"
     xmlns:x="urn:schemas-microsoft-com:office:excel"
     xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"
     xmlns:html="http://www.w3.org/TR/REC-html40">
      <Styles>
      <Style ss:ID="s1">
      <Alignment/>
      <Borders/>
      <Font ss:Bold="1"/>
      <Interior/>
     <NumberFormat/>
    <Protection/>
     </Style>
     </Styles>
     <Worksheet ss:Name="Standard Price Book" >
     <Table x:FullColumns="1" x:FullRows="1">
     <Column ss:Width="80"/>
     <Row>
     <Cell ss:StyleID="s1"><Data ss:Type="String" >Standard Price Book</Data>    </Cell>
      </Row>
     <apex:repeat value="{!standard}" var="stpb">
      <Row>
     <Cell><Data ss:Type="String">{!stpb.ProductCode}</Data></Cell>
     </Row>
     </apex:repeat>
     </Table>
     </Worksheet>
     <Worksheet ss:Name="Test Price Book">
     <Table x:FullColumns="1" x:FullRows="1">
     <Column ss:Width="100"/>
     <Column ss:Width="80"/>
      <Column ss:Width="80"/>
     <Row>
 

    <Cell ss:StyleID="s1"><Data ss:Type="String" >Product Code</Data></Cell>
     <Cell ss:StyleID="s1"><Data ss:Type="String" >Unit Price</Data></Cell>
     </Row>
     <apex:repeat value="{!pb3}" var="test">
     <Row>
     <Cell><Data ss:Type="String">{!test.ProductCode}</Data></Cell>
     <Cell><Data ss:Type="String">{!test.UnitPrice}</Data></Cell>
     </Row>
     </apex:repeat>
     </Table>
     </Worksheet>
      <Worksheet ss:Name="Novation Tier - 1">
     <Table x:FullColumns="1" x:FullRows="1">
     <Column ss:Width="100"/>
     <Column ss:Width="80"/>
     <Column ss:Width="80"/>
     <Row>
     <Cell ss:StyleID="s1"><Data ss:Type="String" >Product Code</Data></Cell>
     <Cell ss:StyleID="s1"><Data ss:Type="String" >Unit Price</Data></Cell>
     </Row>
     <apex:repeat value="{!pb4}" var="novation1">
     <Row>
     <Cell><Data ss:Type="String">{!novation1.ProductCode}</Data></Cell>
     <Cell><Data ss:Type="String">{!novation1.UnitPrice}</Data></Cell>
     </Row>
     </apex:repeat>
     </Table>
     </Worksheet>
     <Worksheet ss:Name="MedAssets">
     <Table x:FullColumns="1" x:FullRows="1">
     <Column ss:Width="100"/>
     <Column ss:Width="80"/>
     <Column ss:Width="80"/>
     <Row>
     <Cell ss:StyleID="s1"><Data ss:Type="String" >Product Code</Data></Cell>
     <Cell ss:StyleID="s1"><Data ss:Type="String" >Unit Price</Data></Cell>
     </Row>
     <apex:repeat value="{!pb5}" var="medassets">
     <Row>
     <Cell><Data ss:Type="String">{!medassets.ProductCode}</Data></Cell>
     <Cell><Data ss:Type="String">{!medassets.UnitPrice}</Data></Cell>
     </Row>
     </apex:repeat>
     </Table>
    <WorksheetOptions xmlns="urn:schemas-microsoft-com:office:excel">
       <TabColorIndex>51</TabColorIndex>
       <Panes>
        <Pane>
         <Number>3</Number>
         <ActiveRow>27</ActiveRow>
         <ActiveCol>3</ActiveCol>
        </Pane>
       </Panes>
       <ProtectObjects>False</ProtectObjects>
       <ProtectScenarios>False</ProtectScenarios>
      </WorksheetOptions>
     </Worksheet>
    </Workbook>
    </apex:page>
Hello!

I am trying to create a visual force page for the primary sidebar on the salesforce console for the accounts page. I would like Opportunities to show up within the account on the side of the console. This is what I have so far and it appears that when I go to the console, the tab is blank:

<apex:page StandardController="Account">  
      <script type="application/javascript">
        window.location = '/{!account.Opportunities};
    </script>
</apex:page>

I was trying to follow this guide, but it did not work. http://blogs.salesforce.com/product/2013/05/the-service-cloud-console-0-click-data-with-custom-console-components.html 

Can anyone help me to get the right coding in for my visualforce page or point me in the right direction where I can find customizable code for the salesforce console. Any help would be great. Thank you!

Dawn
The code below has been modified from this solution: http://salesforce.stackexchange.com/questions/34261/how-to-generate-excel-files-with-the-multiple-sheets-in-visualforce which does work but I was looking to add extra functionality such as freezing the top row pane, changing tab color, and filtering.....Can anyone point me in the right direction on how I can do this? I don't really know much about XML.  I have tried this to freeze the panes but it keeps saying the excel file is corrupt and won't open

    <WorksheetOptions xmlns="urn:schemas-microsoft-com:office:excel">
     <Selected/>
       <FreezePanes/>
       <FrozenNoSplit/>
       <SplitHorizontal>1</SplitHorizontal>
       <TopRowBottomPane>1</TopRowBottomPane>
       <SplitVertical>1</SplitVertical>
       <LeftColumnRightPane>1</LeftColumnRightPane>
       <ActiveRow>2</ActiveRow>
       <Panes>
        <Pane>
         <Number>1</Number>
        </Pane>
        <Pane>
         <Number>2</Number>
        </Pane>
       </Panes>
       <ProtectObjects>False</ProtectObjects>
       <ProtectScenarios>False</ProtectScenarios>
      </WorksheetOptions>

Actual Code   
    
    <apex:page controller="CustomPBListController" contentType="txt/xml#myTest.xls" cache="true">
     <apex:outputText value="{!xlsHeader}"/>
     <Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet"
     xmlns:o="urn:schemas-microsoft-com:office:office"
     xmlns:x="urn:schemas-microsoft-com:office:excel"
     xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"
     xmlns:html="http://www.w3.org/TR/REC-html40">
      <Styles>
      <Style ss:ID="s1">
      <Alignment/>
      <Borders/>
      <Font ss:Bold="1"/>
      <Interior/>
     <NumberFormat/>
    <Protection/>
     </Style>
     </Styles>
     <Worksheet ss:Name="Standard Price Book" >
     <Table x:FullColumns="1" x:FullRows="1">
     <Column ss:Width="80"/>
     <Row>
     <Cell ss:StyleID="s1"><Data ss:Type="String" >Standard Price Book</Data>    </Cell>
      </Row>
     <apex:repeat value="{!standard}" var="stpb">
      <Row>
     <Cell><Data ss:Type="String">{!stpb.ProductCode}</Data></Cell>
     </Row>
     </apex:repeat>
     </Table>
     </Worksheet>
     <Worksheet ss:Name="Test Price Book">
     <Table x:FullColumns="1" x:FullRows="1">
     <Column ss:Width="100"/>
     <Column ss:Width="80"/>
      <Column ss:Width="80"/>
     <Row>
 

    <Cell ss:StyleID="s1"><Data ss:Type="String" >Product Code</Data></Cell>
     <Cell ss:StyleID="s1"><Data ss:Type="String" >Unit Price</Data></Cell>
     </Row>
     <apex:repeat value="{!pb3}" var="test">
     <Row>
     <Cell><Data ss:Type="String">{!test.ProductCode}</Data></Cell>
     <Cell><Data ss:Type="String">{!test.UnitPrice}</Data></Cell>
     </Row>
     </apex:repeat>
     </Table>
     </Worksheet>
      <Worksheet ss:Name="Novation Tier - 1">
     <Table x:FullColumns="1" x:FullRows="1">
     <Column ss:Width="100"/>
     <Column ss:Width="80"/>
     <Column ss:Width="80"/>
     <Row>
     <Cell ss:StyleID="s1"><Data ss:Type="String" >Product Code</Data></Cell>
     <Cell ss:StyleID="s1"><Data ss:Type="String" >Unit Price</Data></Cell>
     </Row>
     <apex:repeat value="{!pb4}" var="novation1">
     <Row>
     <Cell><Data ss:Type="String">{!novation1.ProductCode}</Data></Cell>
     <Cell><Data ss:Type="String">{!novation1.UnitPrice}</Data></Cell>
     </Row>
     </apex:repeat>
     </Table>
     </Worksheet>
     <Worksheet ss:Name="MedAssets">
     <Table x:FullColumns="1" x:FullRows="1">
     <Column ss:Width="100"/>
     <Column ss:Width="80"/>
     <Column ss:Width="80"/>
     <Row>
     <Cell ss:StyleID="s1"><Data ss:Type="String" >Product Code</Data></Cell>
     <Cell ss:StyleID="s1"><Data ss:Type="String" >Unit Price</Data></Cell>
     </Row>
     <apex:repeat value="{!pb5}" var="medassets">
     <Row>
     <Cell><Data ss:Type="String">{!medassets.ProductCode}</Data></Cell>
     <Cell><Data ss:Type="String">{!medassets.UnitPrice}</Data></Cell>
     </Row>
     </apex:repeat>
     </Table>
    <WorksheetOptions xmlns="urn:schemas-microsoft-com:office:excel">
       <TabColorIndex>51</TabColorIndex>
       <Panes>
        <Pane>
         <Number>3</Number>
         <ActiveRow>27</ActiveRow>
         <ActiveCol>3</ActiveCol>
        </Pane>
       </Panes>
       <ProtectObjects>False</ProtectObjects>
       <ProtectScenarios>False</ProtectScenarios>
      </WorksheetOptions>
     </Worksheet>
    </Workbook>
    </apex:page>