How to Resize Image in Crystal Report Visual Studio 2005

No.of Views3330
Bookmarked0 times
Downloads 
Votes0
By  dotnetfish   On  11 Nov 2010 09:11:54
Tag : Crystal Reports , How to
In this snippet, i'm going to show to How to Resize Image in Crystal Report Visual Studio 2005.
emailbookmarkadd commentsprint

Images in this article missing? We recently lost them in a site migration. We're working to restore these as you read this. Should you need an image in an emergency, please contact us at info@codegain.com

 

Introduction

In this snippet, i'm going to show to How to Resize Image in Crystal Report Visual Studio 2005.The crystal report is most powerful tool to create reports for all business application, at the same time, crystal report has few limitation or indirect way to achieve a function.

One of my project , i have created a report with client logo images. but its to big, so i decide to resize the image with few lines or of C# code.here i'm going to share that code for you all.

Note:1 pixel should be equal to 15 twips in Crystal Report.

Code

int LogoWidth = 100;
int LogoHeight = 80;
reportdocument.Load("abc.rpt");
reportdocument.SetDataSource(myDataTable);
reportdocument.Section2.ReportObjects["LogoImage1"].Width = LogoWidth * 15;
reportdocument.Section2.ReportObjects["LogoImage1"].Height = LogoHeight * 15;
CrystalReportViewer.ReportSource = reportdocument;

 In lines of code,i have declare my logo width and height. then set the data source to report(this is default). then i know what is section of the my logo.then read the object from the crystal report section collection and then width and height.

 Access Image object Code

reportdocument.Section2.ReportObjects["LogoImage1"].Width = LogoWidth * 15;
reportdocument.Section2.ReportObjects["LogoImage1"].Height = LogoHeight * 15;

That's all.i hope this is help to all.

 
Sign Up to vote for this article
 
About Author
 
dotnetfish
Occupation-
Company-
Member Type-Senior
Location-United States
Joined date-05 Sep 2010
Home Page-
Blog Page-dotnetfish.blogspot.com
 
 
Other popularSectionarticles
Comments
There is no comments for this articles.
Leave a Reply
Title:
Display Name:
Email:
(not display in page for the security purphase)
Website:
Message:
Please refresh your screen using Ctrl+F5
If you can't read this number refresh your screen
Please input the anti-spam code that you can read in the image.
^ Scroll to Top