applying style for odd /even row is not continuous

Request for help on DynamicReports

Moderator: ricardo

applying style for odd /even row is not continuous

Postby vinaysri » Wed Sep 27, 2017 3:41 pm

Hi,

Style are not continuous for odd / even row in grid with vertical list inside cell . please refer attachment

[img]
/home/vinay/Pictures/final.png
[/img]

Code: Select all
   @Override
    public ColumnBuilder<?, ?> getColumn() {
        return col.componentColumn(colName, getFlagIPCcolumnComponent());
    }

    public Collection<? extends FieldBuilder<?>> getFields() {
        ArrayList<FieldBuilder<?>> fields = new ArrayList<>();
        fields.add(field(colName, String.class));
        fields.add(field(imageName, String.class));
        return fields;
    }

    @Override
    public Collection<String> getFieldNames() {
        ArrayList<String> fieldNames = new ArrayList<>();
        fieldNames.add(colName);
        fieldNames.add(imageName);
        return fieldNames;
    }

    public VerticalListBuilder getFlagIPCcolumnComponent() {

        ImageExpression img = new ImageExpression(basePath, format,colName,imageName);
        ImageBuilder image = null;
        HorizontalListBuilder horizontalList =  cmp.horizontalList();
        VerticalListBuilder verticalListBuilder = cmp.verticalList();
       
        if (img != null) {
           image = cmp.image(img).setFixedDimension(width, height);
           horizontalList.add(image.setHyperLink(hyperLink().setTooltip(new TooltipExpression())));
        }
           
       horizontalList.add(cmp.text(new TooltipExpression()).setStyle(stl.style().setFontSize(7)));
     
       verticalListBuilder.add(cmp.text(new TextExpression(colName)).setStyle(stl.style().setTopPadding(20)));
       verticalListBuilder.add(horizontalList.setStyle(stl.style().setTopPadding(2).setBottomPadding(10)));
       
       // horizontalList = cmp.horizontalList(image.setHyperLink(hyperLink().setTooltip(new TooltipExpression())), cmp.text(new TooltipExpression()).setStyle(stl.style().setFontSize(7)));

        //DimensionComponentBuilder itemComponent = cmp.verticalList(cmp.text(new TextExpression(colName)).setStyle(stl.style().setTopPadding(20)),horizontalList.setStyle(stl.style().setTopPadding(2).setBottomPadding(10)));
        return verticalListBuilder;
    }




    public class TextExpression extends AbstractSimpleExpression<String> {

        private static final long serialVersionUID = 1L;
        private final String displayField;

        public TextExpression(String displayField) {
            this.displayField = displayField;
        }

        @Override

        public String evaluate(ReportParameters reportParameters) {

            return reportParameters.getValue(displayField);

        }
    }

    private class TooltipExpression extends AbstractSimpleExpression<String> {

        @Override
        public String evaluate(ReportParameters reportParameters) {
            return reportParameters.getValue(imageName);
        }
    }


cols.add(new Column("Attacker IP", new ImageTextColumn(16,11,"/var/mycompany/flags","png","Src Country Code",false)));
Attachments
final.png
snapshot
final.png (158.79 KiB) Viewed 211 times
vinaysri
 
Posts: 9
Joined: Tue Jan 19, 2016 11:01 am

Re: applying style for odd /even row is not continuous

Postby vinaysri » Fri Oct 13, 2017 4:07 am

Hi,

Can you please provide solution for this issue

Thx
Vin
vinaysri
 
Posts: 9
Joined: Tue Jan 19, 2016 11:01 am


Return to Help

Who is online

Users browsing this forum: No registered users and 3 guests

cron