0

I'm trying to implement a function that can paste excel rows into a spreadsheetview object (controlsfx). Right now, I managed to get a string representing the xml associated with my clipboard :

<?xml version="1.0"?>
<?mso-application progid="Excel.Sheet"?>
<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="Default" ss:Name="Normal">
   <Alignment ss:Vertical="Bottom"/>
   <Borders/>
   <Font ss:FontName="Calibri" x:Family="Swiss" ss:Size="11" ss:Color="#000000"/>
   <Interior/>
   <NumberFormat/>
   <Protection/>
  </Style>
  <Style ss:ID="s113">
   <Alignment ss:Horizontal="Center" ss:Vertical="Top"/>
   <Borders>
    <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/>
    <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/>
    <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/>
    <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/>
   </Borders>
  </Style>
 </Styles>
 <Worksheet ss:Name="Nouvelle feuille">
  <Table ss:ExpandedColumnCount="16384" ss:ExpandedRowCount="1" x:FullRows="1"
   ss:DefaultRowHeight="15">
   <Column ss:Width="86.25"/>
   <Column ss:Width="96"/>
   <Column ss:Width="54.75"/>
   <Column ss:Width="51.75"/>
   <Column ss:Width="53.25"/>
   <Column ss:Width="69.75"/>
   <Column ss:Width="27.75"/>
   <Column ss:Width="56.25"/>
   <Column ss:Width="58.5"/>
   <Column ss:Width="23.25"/>
   <Column ss:Width="163.5"/>
   <Column ss:Index="13" ss:Width="77.25"/>
   <Row>
    <Cell ss:StyleID="s113"><Data ss:Type="Number">1</Data></Cell>
    <Cell ss:StyleID="s113"><Data ss:Type="String">10</Data></Cell>
    <Cell ss:StyleID="s113"><Data ss:Type="String">101</Data></Cell>
    <Cell ss:StyleID="s113"><Data ss:Type="String">1</Data></Cell>
    <Cell ss:StyleID="s113"><Data ss:Type="String">010</Data></Cell>
    <Cell ss:StyleID="s113"><Data ss:Type="String">10</Data></Cell>
    <Cell ss:StyleID="s113"><Data ss:Type="String">B</Data></Cell>
    <Cell ss:StyleID="s113"><Data ss:Type="Number">1</Data></Cell>
    <Cell ss:StyleID="s113"><Data ss:Type="Number">101</Data></Cell>
    <Cell ss:StyleID="s113"><Data ss:Type="Number">103</Data></Cell>
    <Cell ss:StyleID="s113"><Data ss:Type="String">test</Data></Cell>
    <Cell ss:Index="13" ss:StyleID="s113"><Data ss:Type="String">13</Data></Cell>
   </Row>
  </Table>
 </Worksheet>
</Workbook>

I want to somehow create an XSSFWorkbook from that string so I can easily manipulate the data. Is it possible ?

Thank you in advance !

Luca170598
  • 23
  • 8

0 Answers0