473,796 Members | 2,550 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to change dynamically an image in a report viewer ?

1 New Member
Hello,

I'am currently designing a reportviewer, and what i want to do is when the user click on a image, this image change. I know how to change dynamically the image on load but not on click.

Thanks for your help.
Oct 15 '07 #1
1 3008
ankurpatel
5 New Member
Hi,
i am give my code for change dynamically immage but not in report viewer.

private void openToolStripMe nuItem_Click(ob ject sender, EventArgs e)

{

string Backpath = null;

try

{

openFileDialog1 .Filter = "Jpg|*.jpg" ;

openFileDialog1 .ShowDialog();

Backpath = openFileDialog1 .FileName;

// calling Image background method

Change_Backgrou ndImage(Backpat h);

}

catch (Exception ex)

{

MessageBox.Show (ex.Message);

}

}

Change_Backgrou ndImage(Backpat h) Method
private void Change_Backgrou ndImage(string _path )

{

string imagepath = _path;

System.IO.FileS tream fs;

// MDI Form image background layout change here

//(Remember control imagebakground layout take default form background layount )

this.Background ImageLayout = ImageLayout.Str etch;

// Checking File exists if yes go --->

if (System.IO.File .Exists(imagepa th))

{

// Read Image file

fs = System.IO.File. OpenRead(imagep ath);

fs.Position = 0;

// Change MDI From back ground picture

foreach (Control ctl in this.Controls)

{

if (ctl is MdiClient)

{

//ctl.BackColor = Color.AntiqueWh ite;

ctl.BackgroundI mage = System.Drawing. Image.FromStrea m(fs);

break;

}

}

}

}

Conclusion

I am looking forward to receive any comments/suggestion you have for me.

Thank you for reading; I sincerely hope this article
Oct 15 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
1001
by: Alex Stevens | last post by:
Hi All, I have implemented my own toolbar on a form which houses the crystal reprot viewer. I would like to have a combobox to allow the user to change the zoom level to say 25 / 50 / 75 / 100 / 200% However the crystal report viewer only seems to allow two levels of zoom, using the .Zoom method, 1 for actual size, and 2 for fit to screen. Is there any way that I can manually set the zoom level to something else
4
8208
by: Sam Fisher | last post by:
Hi, I have a crystal reports hosted on the IIS as web service. Everything works fine except that I can not access the database other than the one on which the report originally created. I am using the LogOnInfo of the viewer to set the user name, password, database location and server names But the following kb article says 'When using the viewer's LogOnInfo collection, you are unable to change the database/table information for a report...
3
10276
by: Mark | last post by:
Hello all - I'm at wits end with trying to figure out why I'm having this problem since I followed the research, that I've dug up, to a "T". I'm trying to display a JPEG image from a path directory within a Crystal Report. I created a typed dataset that is not bound to the database called dsLogo and created one field within it that has a base64binary type for the image. Once I've incorporated the dataset into the report and dropped the...
4
5345
by: Connor T | last post by:
Hi, How do I setup a crystal report viewer which fills the Form, and resizes to fit the current window? At the moment it seems I have to give it an explicit size, which is nasty! I just want to say "Expand to fit" Thanks, Dan
1
7516
by: monskie | last post by:
Hello to all, I have a problem which could be trivial to you guys. This concerns opening several crystal reports on the a crystal viewer on an ASPX page by calling window.open. My application. 1.) 2 webforms - 1 main web form that filters that dataset - 1 reportviewer web form that displays the filtered dataset.
0
1986
by: Tumurbaatar S. | last post by:
It's my first project using the Crystal report. I created a report with the report designer and linked it to a web form as: 1. put CrystalReportViewer in my page (its ID: Viewer). 2. put ReportDocument component from Toolbox | Components (its Name: Report) and specified my existing report class (myproject.import.reports.shiporder). 3. in DataBinding of above viewer, I choosed Simple binding and selected my report. 4. on Page_Load event...
7
20732
by: Mark | last post by:
Hi, I am creating application in VB 2005. and when I print report it adds extra 0.45 cm margin on left and top, and the reason for this is physical margins of printer. Is it possible to change printer's physical margins using VB coding? Cheers -- Osmotion Blue
0
2979
by: John Smith | last post by:
Hello, I am developing a VB.NET 2003 application that will use lots of Crystal Reports. Sometimes the users will preview a report in a Crystal report viewer, and sometimes they will send the report directly to the printer bypassing the Crystal report viewer altogether. When sending the job directly to the printer I use the PrintToPrinter command CR.PrintToPrinter(1, False, 0, 0)
1
9913
by: =?Utf-8?B?U3RldmUgQmFya2Vy?= | last post by:
Hi guys, I’m having an interesting problem with Crystal Reports. Thankfully, it’s simple to explain! I’ve got a report, and have added a picture to it. I configured the picture to use a bitmap. When the report is viewed using the crystal report viewer, the image appears fine. However, when I send the report to a printer, the image comes out with a grey background. I’ve had a good look through all the relevant report and report...
0
9685
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10459
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10237
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10187
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9055
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5446
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4120
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3735
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2928
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.