Solved

Set Image resolution in Microsoft Report (RDLC in VS2008)

Posted on 2013-02-07
7
5,660 Views
Last Modified: 2013-02-15
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?
0
Comment
Question by:WestcountryBusiness
  • 4
  • 3
7 Comments
 
LVL 12

Accepted Solution

by:
Harish Varghese earned 500 total points
ID: 38868716
Hello,

Are you creating reports using Report Server Business Intelligence project? I am able to use high resolution images in the reports without any issue.

Or are you creating a web application using reportviewer control and displaying the image inside that? If so, I have not created such applications and do not have much idea about it. Please see if you find something useful ine below link:

http://stackoverflow.com/questions/7189674/rs2008-background-image-sizing

-Harish
0
 
LVL 1

Author Comment

by:WestcountryBusiness
ID: 38868797
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
0
 
LVL 12

Expert Comment

by:Harish Varghese
ID: 38870698
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.
Image-In-Report
Hope this helps. Good luck.

-Harish
0
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 
LVL 1

Author Comment

by:WestcountryBusiness
ID: 38875144
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
0
 
LVL 12

Expert Comment

by:Harish Varghese
ID: 38875686
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
0
 
LVL 12

Expert Comment

by:Harish Varghese
ID: 38875709
Yes, I tried in VS 2010 with images coming from database and it works perfect.
0
 
LVL 1

Author Closing Comment

by:WestcountryBusiness
ID: 38892219
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.
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question