I have a requirement to preview excel files in browser. I am currently trying to convert excel file to html using the OpenXML SDK and OpenXml Power tool. Using the SmlDataRetriever I could retrieve the XElement data from the excel sheet but I am unable to proceed further. Please find below the format which I receive from SmlDataRetriever
- <Data>
- <DataProps>
- <sheetFormatPr defaultColWidth="9.25" defaultRowHeight="15" dyDescent="0.25" />
- </DataProps>
- <Row RowNumber="1">
- <Cell Ref="A1" ColumnId="A" ColumnNumber="0" Type="s">
- <CellProps />
- <Value>Make </Value>
- <DisplayValue>Make </DisplayValue>
- </Cell>
- <Cell Ref="B1" ColumnId="B" ColumnNumber="1" Type="s">
- <CellProps />
- <Value>Miles </Value>
- <DisplayValue>Miles </DisplayValue>
- </Cell>
- <Cell Ref="C1" ColumnId="C" ColumnNumber="2" Type="s">
- <CellProps />
- <Value>Cost</Value>
- <DisplayValue>Cost</DisplayValue>
- </Cell>
- </Row>
- <Row RowNumber="2">
- <Cell Ref="A2" ColumnId="A" ColumnNumber="0" Type="s">
- <CellProps />
- <Value>Ford</Value>
- <DisplayValue>Ford</DisplayValue>
- </Cell>
- <Cell Ref="B2" ColumnId="B" ColumnNumber="1">
- <CellProps />
- <Value>40000</Value>
- <DisplayValue>40000</DisplayValue>
- </Cell>
- <Cell Ref="C2" ColumnId="C" ColumnNumber="2" Style="1">
- <CellProps numFmtId="6" formatCode=""$"#,##0_);[Red]\("$"#,##0\)" applyNumberFormat="1">
- <font>
- <sz val="11" />
- <color theme="1" />
- <name val="Calibri" />
- <family val="Swiss" />
- <scheme val="minor" />
- </font>
- </CellProps>
- <Value>3500</Value>
- <DisplayValue>$3,500</DisplayValue>
- </Cell>
- </Row>
- <Row RowNumber="3">
- <Cell Ref="A3" ColumnId="A" ColumnNumber="0" Type="s">
- <CellProps />
- <Value>Chevi</Value>
- <DisplayValue>Chevi</DisplayValue>
- </Cell>
- <Cell Ref="B3" ColumnId="B" ColumnNumber="1">
- <CellProps />
- <Value>55000</Value>
- <DisplayValue>55000</DisplayValue>
- </Cell>
- <Cell Ref="C3" ColumnId="C" ColumnNumber="2" Style="1">
- <CellProps numFmtId="6" formatCode=""$"#,##0_);[Red]\("$"#,##0\)" applyNumberFormat="1">
- <font>
- <sz val="11" />
- <color theme="1" />
- <name val="Calibri" />
- <family val="Swiss" />
- <scheme val="minor" />
- </font>
- </CellProps>
- <Value>4200</Value>
- <DisplayValue>$4,200</DisplayValue>
- </Cell>
- </Row>
- <Row RowNumber="4">
- <Cell Ref="A4" ColumnId="A" ColumnNumber="0" Type="s">
- <CellProps />
- <Value>Tata</Value>
- <DisplayValue>Tata</DisplayValue>
- </Cell>
- <Cell Ref="B4" ColumnId="B" ColumnNumber="1">
- <CellProps />
- <Value>51000</Value>
- <DisplayValue>51000</DisplayValue>
- </Cell>
- <Cell Ref="C4" ColumnId="C" ColumnNumber="2" Style="1">
- <CellProps numFmtId="6" formatCode=""$"#,##0_);[Red]\("$"#,##0\)" applyNumberFormat="1">
- <font>
- <sz val="11" />
- <color theme="1" />
- <name val="Calibri" />
- <family val="Swiss" />
- <scheme val="minor" />
- </font>
- </CellProps>
- <Value>3800</Value>
- <DisplayValue>$3,800</DisplayValue>
- </Cell>
- </Row>
- </Data>
Is there any possible ways to convert this into a valid HTML so that it can be previewed. Is there any other methods in which this can be achieved. I cannot use the paid libraries for this work. I could not find any examples in the XSLT transformation of excel XML to HTML. Any help in this area is appreciated. TIA