has anybody experience with POI GWT? iterating more than one Cell infos(color, value, font...etc) and load them to a GXT Grid...

I

imad

Neues Mitglied
i want to read excelfile and than load all the data in a grid via GWT RPC....


to initialize a grid we have to define a namemodel of this. so it has a fix strukture.


how to get all cellinfo (backgroundcolor, font color, cellvalues etc...) using iteration or for loop??


and saving all this in a namemodel.
NameModel nm = new NameModel (i,a, b ,c, d, s_color, s_font, s_fontname, s_fontheight); a,b,c,d : for cellvalues etc : anyway hier is a snipet of what i am trying to do:

for the first row of the excel file:


Java:
    ArrayList<NameModel> stocks = new ArrayList<NameModel>();

    String a = "";
    String b = "";
    String c = "";
    Double d = 0.0;
    String col_a = "";
    String color_b = "";
    String color_c = "";
    String color_d = "";

            ArrayList<String> s_color = new ArrayList<>();
            ArrayList<String> s_font = new ArrayList<>();
            ArrayList<String> s_fontname = new ArrayList<>();
            ArrayList<Short> s_fontheight = new ArrayList<>();

            // Getting cellvalue
            a = row.getCell(0).getStringCellValue();
            CellStyle style_a = row.getCell(0).getCellStyle();
            // Getting foregroundcolor
            color_a = renderColor(style_a.getFillForegroundColorColor());
            s_color.add(0, color_a.replaceFirst("FF", "#"));
            // Getting Font color
            XSSFFont font_a = ((XSSFCellStyle) style_a).getFont();
            XSSFColor color_fa = font_a.getXSSFColor();
            s_font.add(0, (color_fa.getARGBHex().replaceFirst("FF", "#")));
            // Getting Font name
            s_fontname.add(0, (font_a.getFontName()));
            // Getting Font height
            s_fontheight.add(0, (font_a.getFontHeightInPoints()));

            stocks.add(new NameModel (i,a, b ,c, d, s_color, s_font,
                    s_fontname, s_fontheight));
 
Zuletzt bearbeitet von einem Moderator:
Anzeige

Neue Themen


Oben