+ Start a Discussion
Binayak28Binayak28 

Get correct browser version in apex controller

I have a requirement:

I am trying to show a unsupported browser pagemessage to all users, who all are using IE7 or IE8. I am trying to get the user-agent parameters from my controller, to show the error message, but it is not fetching the correct IE versions all the time.
ny suggestions?
Thanks in advance.
Prabhat Kumar12Prabhat Kumar12
Hi you can use Javascript in VF page to get the browser name and version.

Please see below link.

http://www.echoecho.com/jsbrowserdetection02.htm
William TranWilliam Tran
You might want to look at: whichbrowser.net

If that seems to get you what you want then here's a detailed description on how you would call/use it

https://github.com/WhichBrowser/WhichBrowser

Thx
Vaib ParaVaib Para
Hi William can you help me with this, It is really important for me..

Visualforce to XML workbook declaration error.. Pls helpHi all, I am getting an error when i use xmlns="urn:schemas-microsoft-com:office:excel" in two worksheetoptions, like it works for only sheet3 and not for sheet1 and sheet2.

It says cannot load content when i add xmlns tag in other two sheets...Pls Help

<apex:page controller="ExportToExcelMultipleSheets" contentType="application/vnd.ms-excel#Candidate.xls" cache="true">
 <apex:outputText value="{!xlsHeader}"/>
  <Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet" xmlns:html="http://www.w3.org/TR/REC-html40" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" xmlns:x="urn:schemas-microsoft-com:office:excel">
<Styles>
      <Style ss:ID="Default" ss:Name="Normal">
         <Alignment ss:Vertical="Bottom" />
         <Borders />
         <Font />
         <Interior />
         <NumberFormat />
         <Protection />
      </Style>
   </Styles>
   <Worksheet ss:Name="Sheet1">
      <Table ss:ExpandedColumnCount="100">
         <Row>
            <Cell>
               <Data ss:Type="String">cell a1</Data>
            </Cell>
            <Cell>
               <Data ss:Type="String">cell b2</Data>
            </Cell>
         </Row>
         <Row>
            <Cell>
               <Data ss:Type="String">cell a2</Data>
            </Cell>
            <Cell>
               <Data ss:Type="String">cell b3</Data>
            </Cell>
         </Row>
      </Table>
      <WorksheetOptions xmlns="urn:schemas-microsoft-com:office:excel">
   <PageSetup>
    <Layout x:Orientation="Landscape"/>
    <Header x:Data="&amp;A"/>
    <Footer x:Data="Page &amp;P of &amp;N"/>
   </PageSetup>
   <FitToPage/>
   <Print>
    <FitHeight>50</FitHeight>
    <ValidPrinterInfo/>
    <PaperSizeIndex>9</PaperSizeIndex>
    <Scale>35</Scale>
    <HorizontalResolution>600</HorizontalResolution>
    <VerticalResolution>600</VerticalResolution>
   </Print>
   <ShowPageBreakZoom/>
   <PageBreakZoom>100</PageBreakZoom>
   <FreezePanes/>
   <FrozenNoSplit/>
   <SplitHorizontal>1</SplitHorizontal>
   <TopRowBottomPane>1</TopRowBottomPane>
   <SplitVertical>2</SplitVertical>
   <LeftColumnRightPane>2</LeftColumnRightPane>
   <ActivePane>0</ActivePane>
   <Panes>
    <Pane>
     <Number>3</Number>
    </Pane>
    <Pane>
     <Number>1</Number>
    </Pane>
    <Pane>
     <Number>2</Number>
    </Pane>
    <Pane>
     <Number>0</Number>
    </Pane>
   </Panes>
   <ProtectObjects>False</ProtectObjects>
   <ProtectScenarios>False</ProtectScenarios>
  </WorksheetOptions>
   </Worksheet>
   <Worksheet ss:Name="Sheet2">
      <Table ss:ExpandedColumnCount="100">
         <Row>
            <Cell>
               <Data ss:Type="String">cell a1</Data>
            </Cell>
            <Cell>
               <Data ss:Type="String">cell b2</Data>
            </Cell>
         </Row>
         <Row>
            <Cell>
               <Data ss:Type="String">cell a2</Data>
            </Cell>
            <Cell>
               <Data ss:Type="String">cell b3</Data>
            </Cell>
         </Row>
      </Table>
      <WorksheetOptions xmlns="urn:schemas-microsoft-com:office:excel">
   
  </WorksheetOptions>
   </Worksheet>
<Worksheet ss:Name="Sheet3">
      <Table ss:ExpandedColumnCount="100">
<Row>
            <Cell>
               <Data ss:Type="String"></Data>
            </Cell>
            <Cell>
               <Data ss:Type="String">cell b2</Data>
            </Cell>
         </Row>
         
         <Row>
            <Cell>
               <Data ss:Type="String">cell a2</Data>
            </Cell>
            <Cell>
               <Data ss:Type="String">cell b3</Data>
            </Cell>
         </Row>
      </Table>
      <WorksheetOptions xmlns="urn:schemas-microsoft-com:office:excel">
   
  </WorksheetOptions>
   </Worksheet>
</Workbook>
</apex:page>