cuba-platform / yarg

Yet Another Report Generator - CUBA Platform reporting engine
https://www.cuba-platform.com
Apache License 2.0
239 stars 75 forks source link

Yarg tries to parse the UUID of the document from the link inside formula and fails. #161

Open reloadall opened 2 years ago

reloadall commented 2 years ago

When passing an url to a hyperlink inside a formula, yarg thinks that cell numbers are being passed to it inside the formula.

How to repeat:

  1. Create single cell xlsx template with value

=ГИПЕРССЫЛКА("${url}";"${caption}")

  1. Add groove script in the report

    def result = []
    result.add([
    'url' : 'http://localhost:8080/app/open?screen=Doc.edit&item=Doc-0cba74d6-678b-7a60-8952-1d8497714784',
    'caption' : 'Random'
    ])    
    return result
  2. When you run the report, you will get

    java.lang.NumberFormatException: For input string: "8497714784"
    at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
    at java.lang.Integer.parseInt(Integer.java:583)
    at java.lang.Integer.valueOf(Integer.java:766)
    at com.haulmont.yarg.formatters.impl.xlsx.CellReference.<init>(CellReference.java:40)
    at com.haulmont.yarg.formatters.impl.xlsx.Range.fromCells(Range.java:51)

    Test project with example test.zip