Custom Header - different images

Stimulsoft Reports.NET discussion
Post Reply
Cheguevara
Posts: 8
Joined: Wed Apr 16, 2014 10:25 am

Custom Header - different images

Post by Cheguevara »

Hello,

how can I show for different customers different images in a header? The report is the same for each customer, only the header is customized. I tried to pass the image path without success.
Can you explain me, what to do on call from programm and what to do in the stimulsoft report template, please?

Thank you,
Cheguevara
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Custom Header - different images

Post by HighAley »

Hello, Cheguevara.

As a way you could add a variable with type Image and pass the image to the variable.
Use the variable in the report.
Let us know if you need any additional help.

Thank you.
Cheguevara
Posts: 8
Joined: Wed Apr 16, 2014 10:25 am

Re: Custom Header - different images

Post by Cheguevara »

Hello,

I used following code:

Code: Select all

            FileStream fileStream = new FileStream("../../Icons/1.png", FileMode.Open, FileAccess.Read);
            BitmapImage image = new BitmapImage();
            image.BeginInit();
            image.StreamSource = fileStream;
            image.EndInit();
            report.Compile();
            report["Test"] = image;
In the Report Template, I added a variable of kind image, named it "Test". In the report header I added a Image with image data {Test}.
It doesn't work, can you tell me, what is wrong, please?

Cheguevara
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Custom Header - different images

Post by HighAley »

Hello.

What do you mean "doesn't work"?
Do you get any error?
Does your application is WinForms or WPF, because BitmapImage is a WPF class.
You should use System.Drawing.Image class.

Thank you.
Cheguevara
Posts: 8
Joined: Wed Apr 16, 2014 10:25 am

Re: Custom Header - different images

Post by Cheguevara »

Hello,

no, there is no error. I just can not see the image on the report. I think, I do something wrong in the report template.

The Application is a wpf application. I will try the System.Drawing.Image class, too.

Cheguevara
Cheguevara
Posts: 8
Joined: Wed Apr 16, 2014 10:25 am

Re: Custom Header - different images

Post by Cheguevara »

Hello,

I found my fault. I forgot report.Load().

Thank you for your help.

Cheguevara
Ivan
Posts: 960
Joined: Thu Aug 10, 2006 1:37 am

Re: Custom Header - different images

Post by Ivan »

Hello,

We are always glad to help you.
Let us know if you need any additional help.

Thank you.
Post Reply