Use of Image Variables

Stimulsoft Reports.Flex discussion
evanl
Posts: 6
Joined: Tue Mar 24, 2015 10:36 am

Use of Image Variables

Post by evanl »

Hello,
I am attempting to place an image into a report that is generated dynamically within the local flex client (by another flex component).

Sti reports allows for the use of image type variables, so it seems that this the logical approach as it would allow the image data to be passed into the report directly.

To test the use of image variables I have setup a test that uses an encoded image string copied from another report:

1. Created a report (Report1) and added a static image to the report, then saved that report and grabbed the encoded image data from the <Image></Image> block in that report definition.
2. I've edited a blank report (Report2) and added an image type Variable called ImageVariable1 to the report.
3. I've then edited the Report2.mrt by hand, and added the base64 image string from Report1 to the ImageVariable1 image variable in Report2 (please see the resulting definition of this below).
4. I then re-opened Report2 in the designer, and added an image control to the report definition.
5. I then attempt to configure the 'Image/Image Data' property page of the image object by selecting the ImageVariable1 var from the 'Variables' list. This resulted in {ImageVariable1} appearing in the main configuration editing space.
6. When I save the Image property panel, back in design mode the image control shows 'Image Data: {ImageVariable1}' in the top left corner, but does not display the image (the light green background remains visible).
7. When I open the report in preview mode, nothing is shown in the location where the image is defined

If I could get this simple test working, I would then advance to using an image generated from the other component I mentioned earlier.

I'm wondering if I am using the correct approach, or if there is something else I should be doing instead?

Thank you,
Evan



<Variables count="1" isList="true">
<value>,ImageVariable1,ImageVariable1,System.Drawing.Image,iVBORw0KGgoAAAANSUhEUgAAAMEAAAAtCAIAAACYppgyAAAAAXNSR0IArs4c6QAAAARnQU1BAACx
jwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAVISURBVHhe7ZnNax5VFMb9M9wIgks3gqv8BcGF
uyxFkICLbsxG0E0EXRQkFUEQ3oVCUYlUUdBsxAo2KqUtWgOKH61B+2ptTUys/aC+K5/Mc3K4OXPm
zkzuO8W3nh+XMucjd+4997l3Zt7eMwmCMkJDQSmhoaCU0FBQSmgoKCU0FJQSGgpKCQ0FpYSGglJC
Q0EpoaGglNBQUEpoKCglNBSUEhoKSgkNBaUcXkP3Hr/U1N7+8RoStnZvPPHy+iPP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wSdpgcDoqB1pnqL
VCv6LqUfBAQdMlnsLL2SXQbUENoHP+29XIMnX/ncCAiNoTooKEuDf1G7qsgj/X4xe53kC+FG607c
C4jRoADd9xgbRoIoVpoe8xsPoB99Vk+SAzCh+0w1E+COSEO+eox2EaVf7Cy9kl2G1dBr3/7F5Kdf
P2MEhMZQHTwysB6cmAFVM1uW5AvhRltrxyjSxN4Hi8dQCgaWnkxEYh5M6DVTPXUM6clEesmiV7LL
HTqHHjv2qREQGkNNoDS6xQkWz/0wAflCuNHW2jGKNLETsO91bHiOYGCuspngIhkV3WeKu+Bw0ucp
Tqy6cEEvWfRKdhlQQ/jC5/vQ2e+vGPWwsZ9WUDh3he4+ZnSmA2romdNSjqdGp4162BgNZp2hNPTQ
O/L70IdnfjbS0cZ+gllnEA3hKXb2973fqb/75c9Hn//YSEcb+wlmncNrKAhIaCgoJTQUlBIaCkoJ
DQWlhIaCUkJDQRmTyb+DOdQGxBcrRQAAAABJRU5ErkJggg==,False,False</value>
</Variables>
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Use of Image Variables

Post by Alex K. »

Hello,

Unfortunately, it will not work in flex version, since the image in the report and the image in the variables stored in a bit different format.
Can you please describe your task in more details.

Thank you.
Vladimir
Posts: 1462
Joined: Fri Apr 13, 2007 4:05 am
Location: Earth

Re: Use of Image Variables

Post by Vladimir »

Hello,

Also in the next prerelease build the open image dialog for variables will be available.

Thank you.
evanl
Posts: 6
Joined: Tue Mar 24, 2015 10:36 am

Re: Use of Image Variables

Post by evanl »

Hi Aleksey and Vladimir,
Thanks for your answers back, that helps to give me some further bearings.

My task is that I am wanting to place an image into a report dynamically.

This is because I'm working with a Flex diagram component that can produce an image representation of the user's UI drawing space that it is managing.

I would like to embed images produced by this component into a Stimulsoft report page, so that the user can print the current contents of their diagram, also with text attributes relevant to the drawing displayed on the same report page.

To do this I would like to be able to design an appropriate report using the Stimulsoft Designer, in which an Image element is defined that describes the size/location of the image. The report design would also include Text objects for the relevant items such as diagram name, user name, date etc.

At runtime, I need some way to supply the current image of the diagram to the report during report generation.

Could you please let me know what you think the best approach to achieve this would be?

Thank you - Evan
Vladimir
Posts: 1462
Joined: Fri Apr 13, 2007 4:05 am
Location: Earth

Re: Use of Image Variables

Post by Vladimir »

Hello Evan,

If you need to change the image in the report using Flex code, you can use variables (as you already do) and just use the following code:

Code: Select all

var var1: StiVariable = report.dictionary.variables.getByName("ImageVariable1");
var1.value = // base64 string
// or
var1.valueObject = // image ByteArray (png, gif, jpeg, bmp)
This code will only work in the latest prerelease build because, in this build, we fixed the error with images and we added loading images functionality for variables in the designer.

FXFLEX_2016.04.26_Trial.zip

Please try to use libraries from the attached archive.

Thank you.
evanl
Posts: 6
Joined: Tue Mar 24, 2015 10:36 am

Re: Use of Image Variables

Post by evanl »

Hi Vladimir,
Thanks a lot for sending through the instructions and updated libraries.

I've set up a test application and everything is working very well so that's fantastic, I really appreciate your fast turn-around on this.

My license is for full source code - is there a way to get hold of this latest prerelease source code please?

How would you describe the stability of changes made in the prerelease code - are they mainly minor fixes?

Can I ask how long do you think until a formal release with these changes comes through?
Thanks Evan
Jan
Posts: 1265
Joined: Thu Feb 19, 2009 8:19 am

Re: Use of Image Variables

Post by Jan »

Hello Evan!,
evanl wrote: Thanks a lot for sending through the instructions and updated libraries.

I've set up a test application and everything is working very well so that's fantastic, I really appreciate your fast turn-around on this.
Glad to help you!
My license is for full source code - is there a way to get hold of this latest prerelease source code please?
Please, send the request to support@stimulsoft.com. In your Email add the link to this topic.
How would you describe the stability of changes made in the prerelease code - are they mainly minor fixes?
Can I ask how long do you think until a formal release with these changes comes through?
I can describe it as very stable because we provide only fixes for the Reports.Flex latest time. So, you can use it in production.

Thank you.
evanl
Posts: 6
Joined: Tue Mar 24, 2015 10:36 am

Re: Use of Image Variables

Post by evanl »

Hello Jan,
Thanks for your quick response quick - much appreciated.

Just to let you know that overnight I think I've found a couple of additional small issues with image handling.

When I add an image to a report design and select either Horizontal Alignment or Vertical Alignment as 'Center', the setting change does not seem to be reflected in the report when produced.

My understanding of what should happen is that if an image object is added to a report, and the image source material displayed within that object is smaller in width or height than the image report object itself, then that the image source material would be centered within the area of the image report object.

Could you please let me know if I am doing something wrong, or if there is a need to make a fix in the product?

If a fix is needed I'll just wait contacting support for the source code update (it's great to hear that code is very stable).

Thanks for your help!

Regards Evan
Vladimir
Posts: 1462
Joined: Fri Apr 13, 2007 4:05 am
Location: Earth

Re: Use of Image Variables

Post by Vladimir »

Hello Evan,

The problem with the alignment of the images is solved.

Thank you for detailed bugreports.
evanl
Posts: 6
Joined: Tue Mar 24, 2015 10:36 am

Re: Use of Image Variables

Post by evanl »

Thanks Vladimir - much appreciated!
- Evan
Locked