Link to home
Start Free TrialLog in
Avatar of WestcountryBusiness
WestcountryBusiness

asked on

Set Image resolution in Microsoft Report (RDLC in VS2008)

I am using Microsoft Reporting in VS 2008 (using VB.NET).  My application is used to produce a number of printed documents.  Each report uses an image as the Page Header.  These images are stored in the database but the issue I'm describing also happens if I embed the image in the design and use it directly that way.

The problem is that these images, correctly sized to print 18cm wide x 2.5cm high, do not fit on the report.  They are too big.  

I have worked out that the problem is because they are being treated as 96dpi, regardless of their actual resolution.  So a 300dpi image appears over 3 times the size it should as it is being treated as 96dpi. (source: http://social.msdn.microsoft.com/Forums/en-US/sqlreportingservices/thread/baef4771-2c30-42ed-bc97-90745cc4c280/)

If I create an image of the correct size at 96dpi then this works but 96dpi is too low a resolution for printed output.  In researching this, there seems to be a solution by setting the resolution once the image is loaded into the report but I can't find details to make this work.

Any idea how I can create an A4 page header (18cm x 2.5cm @ 300dpi) and get it to fit correctly on my documents without reducing the resolution, so lowering the quality?
ASKER CERTIFIED SOLUTION
Avatar of Harish Varghese
Harish Varghese
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of WestcountryBusiness
WestcountryBusiness

ASKER

Hi Harish,

It is a Windows Forms application using the Microsoft Report Viewer control to view the reports.  I design the report from within Visual Studio 2008 which creates an RDLC file within my application.  I call report as an embedded resource.

Thanks for the link.  I'm just finishing work for the weekend now, but I'll take a look through it as soon as I get chance to see if it offers a solution.

Thanks for your help.

Jon
Hi Jon,

I created my first forms application with ReportViewer control.
What I found is that when you use the image as background image of the report, then there is no control over the size of the image.
But when I used the image in an image control, then the image takes the exact size of the image control. Though I could not find any option to maintain the width-height proportion of the image while resizing the image control, I think that would not be a problem for you since your image has a fixed size (18cm wide x 2.5cm high).

Please see screenshot of the report below. The big image is used as background image. The small one is an image control. The overlapping table is to show that you can keep other controls on top of the image.
User generated image
Hope this helps. Good luck.

-Harish
Moring Harish,

Thanks for your help.  In the application I am working on I want to give the end user the option of customising their reports by adding their own header.  I was hoping to create it so the user can create an image or whatever size & shape they want to offer flexibility.

Originally I had a very small image element positioned top left of the page with the idea that it would just print the user's selected image in it's original size & resolution.  It now seems this may not possible.

My work around was to create a fixed size image.  I see that if I do this and set the properties of this to fit proportional then I can use a high quality image and have it print correctly.  This means that I must specifiy that the end user's own images for page heading have to be of a specific proportion, which reduces flexibilty but I can probably live with that.  

However the tip about using a scanned image of a standard from as a background image is helpful for another job I have to do, so thanks for that.

I'm going to leave this question open a little longer in case anyone comes up with a method to solve my original problem.  If I don't get it, then I will go ahead with this compromise solution.

Many thanks for your support.

Jon
Jon,

I just found that the Image control to use in RDLC in VS 2010 has "Fit Proportional" property. So that may help you, if you can use VS 2010 instead of VS2008.

-Harish
Yes, I tried in VS 2010 with images coming from database and it works perfect.
so it looks like there's no way to do exactly what I wanted to (use 300dpi images as image objects in a report & get the to size correctly automatically), so the work around solution of setting the image object as a fixed size and using the size proportional option will have to suffice as the best alternative.

Thanks for your help, Harish.