image resolution in a report

Stimulsoft Reports.WEB discussion
Post Reply
cbrydon
Posts: 176
Joined: Fri May 30, 2014 4:37 pm

image resolution in a report

Post by cbrydon »

Hello,

I am generating a report in which there could be hundreds of images with varying sizes and resolutions. On disk, the images could be as large as 3MB - or even larger.
The report is a master detail report listing work orders and associated images. For each work order, there could be 0 or more images related to that work order.

I know there are compression options when exporting a report, but is there a way to reduce the size or resolution of an image when previewing or creating a report?
Perhaps using the GetImageData event and an expression similar to (sender as StiImage).Resolution = 100 ?

I am using Stimulsoft Report.Web with Flash Player 26.

Thanks,
Carl
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: image resolution in a report

Post by Alex K. »

Hello Carl,

There are two ways:
- check and decrease size in the GetImageData event or
- use two version of images - original and min size.

Thank you.
cbrydon
Posts: 176
Joined: Fri May 30, 2014 4:37 pm

Re: image resolution in a report

Post by cbrydon »

Thanks for the suggestions Aleksey.

Is the proper syntax for decreasing the image size in the GetImageData event the following...
(sender as StiImage).Resolution = 100 (or whatever number I need)?

If I use that expression, I get the following error when trying to preview the report.

'Stimulsoft.Report.Components.StiImage' does not contain a definition for 'Resolution' and no extension method 'Resolution' accepting a first argument of type 'Stimulsoft.Report.Components.StiImage' could be found (are you missing a using directive or an assembly reference?)

What expression should I use for checking the image resolution?

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

Re: image resolution in a report

Post by HighAley »

Hello, Carl.

There is no our methods that will help you.
But the good news is that we are using the .Net Framework.
You could add there any C# or VB.NET code (depending on selected language) to decrease a size of the images.
I think you could find many solutions for your task on the Internet.

Thank you.
cbrydon
Posts: 176
Joined: Fri May 30, 2014 4:37 pm

Re: image resolution in a report

Post by cbrydon »

OK- Thank You. I will search the internet to see what I can come up with.
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: image resolution in a report

Post by Alex K. »

Hello

Please let us know if you need any additional help.

Thank you.
cbrydon
Posts: 176
Joined: Fri May 30, 2014 4:37 pm

Re: image resolution in a report

Post by cbrydon »

Hi,

I'm still trying to figure out how to reduce the size/resolution of images that get displayed in the report. I've tried
each of the code snippets below in the GetImageData event of the Image control, but neither seem to do anything.
Perhaps I need to somehow apply the bmp_new to the Image control, but I don't really know how to do that. Would
someone be able to point me in the right direction?

Thanks,
Carl

Bitmap bmp_new = (Bitmap)(sender as Image);
bmp_new.SetResolution(20,20);

Bitmap bmp = (Bitmap)(sender as Image);
Bitmap bmp_new = new Bitmap(bmp, new Size(bmp.Width/8,bmp.Height/8));
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: image resolution in a report

Post by HighAley »

Hello, Carl.

You don't need to apply this. This is already the necessary image.
Do you get the necessary result or not?

Thank you.
Post Reply