Page 1 of 1
Custom Header - different images
Posted: Mon Jul 13, 2015 5:39 am
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
Re: Custom Header - different images
Posted: Mon Jul 13, 2015 1:25 pm
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.
Re: Custom Header - different images
Posted: Tue Jul 14, 2015 6:35 am
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
Re: Custom Header - different images
Posted: Tue Jul 14, 2015 7:04 am
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.
Re: Custom Header - different images
Posted: Tue Jul 14, 2015 7:30 am
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
Re: Custom Header - different images
Posted: Tue Jul 14, 2015 8:09 am
by Cheguevara
Hello,
I found my fault. I forgot report.Load().
Thank you for your help.
Cheguevara
Re: Custom Header - different images
Posted: Tue Jul 14, 2015 10:04 am
by Ivan
Hello,
We are always glad to help you.
Let us know if you need any additional help.
Thank you.