Report with variable number of images in databand

Stimulsoft Reports.JS discussion
Post Reply
pobber1
Posts: 19
Joined: Fri Jun 28, 2019 8:39 am

Report with variable number of images in databand

Post by pobber1 »

Hi,

I have a report with a databand that displays some groups, each group can have multiple questions and answers.

So report looks like this:

Group1
Q1 A1

Group2
Q2 A2

This works fine, however is some cases the answer can be an array of base64 images and I would like have the report display these images under the question text.
For example:

Group1
Q1 A1

Group2
Q2
Image1 Image2 Image3


Is this possible?

My JSON looks like this (but can be altered):
{
Groups: [
{
Id: 1,
Name: "Group 1"
},
{
Id: 2,
Name: "Group 2"
}
],
Checks: [
{
GroupId: 1,
QuestionText: "Q1",
Answer: "A1"
},
{
GroupId: 2,
QuestionText: "Q2",
Answer: "A2"
// Could potentially be Answer: [image1, image2, image3 ]
}
]
}
Lech Kulikowski
Posts: 7291
Joined: Tue Mar 20, 2018 5:34 am

Re: Report with variable number of images in databand

Post by Lech Kulikowski »

Hello,

Unfortunately, in the JS version, it is not possible.

All Image components should be added in the designer before rendering.

Thank you.
pobber1
Posts: 19
Joined: Fri Jun 28, 2019 8:39 am

Re: Report with variable number of images in databand

Post by pobber1 »

Hi,

Thanks for the reply. I did manage to pass a base64 string into an existing image control from JSON and it did render.

Is the image list something I can do from my Angular component code by calling the Stimulsoft API to add the image components to my report template at runtime?
Lech Kulikowski
Posts: 7291
Joined: Tue Mar 20, 2018 5:34 am

Re: Report with variable number of images in databand

Post by Lech Kulikowski »

Hello,

Please try to check the following topic:
viewtopic.php?t=55583

Thank you.
pobber1
Posts: 19
Joined: Fri Jun 28, 2019 8:39 am

Re: Report with variable number of images in databand

Post by pobber1 »

Thanks, that's good to know.

I ended up creating a new data source for my images and then creating a relationship to my questions and then passed that data source to a data band.

Thanks again.
Lech Kulikowski
Posts: 7291
Joined: Tue Mar 20, 2018 5:34 am

Re: Report with variable number of images in databand

Post by Lech Kulikowski »

Hello

We are always glad to help you!
Please let us know if you need any additional help.

Thank you.
Post Reply