https://issues.apache.org/bugzilla/show_bug.cgi?id=46033

           Summary: HSLF setFontSize in TableCell gets ignored
           Product: POI
           Version: 3.5-dev
          Platform: PC
        OS/Version: Windows Vista
            Status: NEW
          Severity: major
          Priority: P2
         Component: HSLF
        AssignedTo: [email protected]
        ReportedBy: [EMAIL PROTECTED]


>From the example on "How to create tables", when I run the example in either
POI-3.2 or POI-3.5, the table ignores "setFontSize".

The PowerPoint generated has the table, but with a font size of 28.

     //table data              
      String[][] data = {
          {"INPUT FILE", "NUMBER OF RECORDS"},
          {"Item File", "11,559"},
          {"Vendor File", "300"},
          {"Purchase History File", "10,000"},
          {"Total # of requisitions", "10,200,038"}
      };

      SlideShow ppt = new SlideShow();

      Slide slide = ppt.createSlide();
      //create a table of 5 rows and 2 columns
      Table table = new Table(5, 2);
      for (int i = 0; i < data.length; i++) {
          for (int j = 0; j < data[i].length; j++) {
              TableCell cell = table.getCell(i, j);
              cell.setText(data[i][j]);

              RichTextRun rt = cell.getTextRun().getRichTextRuns()[0];
              rt.setFontName("Arial");
              rt.setFontSize(10);

              cell.setVerticalAlignment(TextBox.AnchorMiddle);
              cell.setHorizontalAlignment(TextBox.AlignCenter);
          }
      }

      //set table borders
      Line border = table.createBorder();
      border.setLineColor(Color.black);
      border.setLineWidth(1.0);
      table.setAllBorders(border);

      //set width of the 1st column
      table.setColumnWidth(0, 300);
      //set width of the 2nd column
      table.setColumnWidth(1, 150);

      slide.addShape(table);
      table.moveTo(100, 100);

      FileOutputStream out = new FileOutputStream("hslf-table.ppt");
      ppt.write(out);
      out.close();


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to