Alternate row hightlighting

Options
cypherdj
edited February 11, 2022 in Analytics #1
Hi there,

I posted this in the designing BIRT reports forum a few days ago but did not get an answer, then I realised there was a more appropriate forum for it ;-)

I've applied some row highlighting rule on a table in my report design, which works fine in the preview within Eclipse.

row["__rownum"] % 2 equal to 0

However, this does not seem to be applied when I run the report using my own servlet.

Is there something I need to do to get the highlighting rule executed or is this possibly a bug?

I've attached the code for my servlet below.

Kind regards,
Cedric

Comments

  • Virgil Dodson
    Virgil Dodson E admin
    edited December 31, 1969 #2
    Options
    Hi Cedric,

    Is the highlighting depending on a CSS file? If so, you could try "Importing" the stylesheet versus "Using" the stylesheet. You may also need to set the resource path for the CSS file using something like:

    config.setResourcePath(sc.getRealPath("/WEB-INF/styles"))

    I don't think the syntax is the problem, but there are two ways to get the row number, and the other way is like below:

    row.__rownum % 2 equal to 0

    Hope this helps.
    Warning No formatter is installed for the format ipb
  • cypherdj
    edited December 31, 1969 #3
    Options
    Hi Virgil,

    thanks for the response. I'll give that a try later.

    What I found confusing is that I'm actually using a library, which redefines the default theme to use a specific stylesheet. I "use the library" in the report design and the theme is displayed in the outline, with the associated stylesheet. So I don't really understand why I would need to "use the stylesheet" or indeed import it.

    But then again, the styles defined were not standard Birt styles, like .table-footer or .table-header so maybe this had something to do with it at runtime.

    Regards,
    Cedric
  • Virgil Dodson
    Virgil Dodson E admin
    edited December 31, 1969 #4
    Options
    Even if you are referencing the style in a library there are 2 different ways to do it. If you "import" a stylesheet, then all the styles become BIRT styles and are defined directly in the XML rptdesign file. However, if you "use" a stylesheet, then that CSS file remains external and it must be made available at the Resource path defined by the BIRT engine. Only a reference to the style name is actually saved in the XML rptdesign file. This is done this way so you can change the CSS file and have the report automatically use the new style.
    Warning No formatter is installed for the format ipb