Solved

Set Image resolution in Microsoft Report (RDLC in VS2008)

Posted on 2013-02-07
7
5,480 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 
LVL 1

Author Comment

by:WestcountryBusiness
Comment Utility
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
Comment Utility
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
Comment Utility
Yes, I tried in VS 2010 with images coming from database and it works perfect.
0
 
LVL 1

Author Closing Comment

by:WestcountryBusiness
Comment Utility
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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

763 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

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now