1. leonate NA
  2. jxls
  3. Issues

Issues

Issue #9 resolved

No obvious behavior using Each-Command

Alexander Komarov
created an issue

I expect to see that the lines with total sum of the city and the municipality shift down, but this not happening. Test-case attached.

Comments (6)

  1. leonate NA repo owner

    In fact it functions as designed.

    The cell with municipality sum has no way to know it should be shifted down when cities are added.

    But overall I agree that it would be good to control this behavior to allow shifting of such cells when needed.

    So give me some time to analyze possible solutions.

    If I can not come up with an easy way to change the template to achieve what is needed then I will implement a way to control this behavior to allow such cell shifting.

  2. leonate NA repo owner

    A new attribute shiftMode was added to Command class. It defines how cells are shifted when the Command is being processed.

    There are two possible values:

    • inner - means the current behaviour where only cells below or at the right of the command area are shifted
    • adjacent - all cells below or at the right side of the command are shifted.

    To achieve what you want in your case you should set shiftMode attribute to adjacent value for Each-Command for cities and houses.

    Possibly it make sense to set it as default behavior. But since no one else complained on this I have decided to keep the original behavior (inner shiftMode is the default one). But it may change in future. Also there is an option to make it configurable via transformer to avoid setting it for every command. But for now you should set it for every command where you need this behavior.

    The fix is planned to be released with Jxls-2.2.3 version.

  3. leonate NA repo owner

    I have also added one more example org.jxls.demo.ShiftStrategyDemo to jxls-demo project which demonstrates the usage of the shiftMode for adjacent setting.

  4. Dmitry Podlipniy

    adjacent shifting works fine when it goes down, but shifting at the right side is not working. Cell which must be shifted stays untoched. And value from list item, which must be in that cell, is missing. Same is true for inner.

    jxls_template.png

    jxls_result.png

  5. Log in to comment