expression in picture dose`t work
expression in picture dose`t work
hello,I user reports.java to render my reports.
i have a picture component in my report,when i use "datacolumn" in my picture it works well.
but when i use "expression " in my picture it does`t works.
Does the picture component support expressions??
The screenshot is as follows
here is the "datacolumn" it works here is the "expression " it not works here is the results
i have a picture component in my report,when i use "datacolumn" in my picture it works well.
but when i use "expression " in my picture it does`t works.
Does the picture component support expressions??
The screenshot is as follows
here is the "datacolumn" it works here is the "expression " it not works here is the results
-
- Posts: 6263
- Joined: Tue Mar 20, 2018 5:34 am
Re: expression in picture dose`t work
Hello,
Please send us a sample report with test data that reproduces the issue for analysis.
Thank yuo.
Please send us a sample report with test data that reproduces the issue for analysis.
Thank yuo.
Re: expression in picture dose`t work
here is the mrt and test dataLech Kulikowski wrote: ↑Mon Jan 25, 2021 9:41 pm Hello,
Please send us a sample report with test data that reproduces the issue for analysis.
Thank yuo.
Re: expression in picture dose`t work
Hello,
The expression should return an Image object.
But inside the column we see the Base64 string.
You should use the Data Column in this case.
Thank you.
The expression should return an Image object.
But inside the column we see the Base64 string.
You should use the Data Column in this case.
Thank you.
Re: expression in picture dose`t work
thanks,
i tried use Data Column is ok,but In my business scenario,i need use expression to do some conditional judgment。
you mean that if i use expression like '{cmp2.pic}',then the column ‘pic’ in my datasource must a java Image Objcet not a string?
-
- Posts: 6263
- Joined: Tue Mar 20, 2018 5:34 am
Re: expression in picture dose`t work
Hello,
Yes. Or you can use the Data Column in this case.
Thank you.
Yes. Or you can use the Data Column in this case.
Thank you.
Re: expression in picture dose`t work
thanks, i tried set my picture column as a BufferedImage,but it doesn`t work.Lech Kulikowski wrote: ↑Mon Feb 01, 2021 8:38 pm Hello,
Yes. Or you can use the Data Column in this case.
Thank you.
like this.
Code: Select all
byte[] bytes1 = new BASE64Decoder().decodeBuffer(ds.tables.get(11).getRows().get(0).getValue("Pic").toString());
ByteArrayInputStream bais = new ByteArrayInputStream(bytes1);
BufferedImage bi1 = ImageIO.read(bais);
ds.tables.get(11).getRows().get(0).setValue("Pic",bi1);
Re: expression in picture dose`t work
thanks, i tried set my picture column as a BufferedImage,but it doesn`t work.
like this.
Code: Select all
byte[] bytes1 = new BASE64Decoder().decodeBuffer(ds.tables.get(11).getRows().get(0).getValue("Pic").toString());
ByteArrayInputStream bais = new ByteArrayInputStream(bytes1);
BufferedImage bi1 = ImageIO.read(bais);
ds.tables.get(11).getRows().get(0).setValue("Pic",bi1);
Re: expression in picture dose`t work
Hello.
ds.tables.get(11).getRows().get(0).setValue("Pic",bi1); is data column, so you need string base64 image here.
ds.tables.get(11).getRows().get(0).setValue("Pic",bi1); is data column, so you need string base64 image here.