Page 2 of 2

image in web report

Posted: Mon May 18, 2009 3:01 am
by Jan
Hello,

Please add following method in your report code:

Code: Select all

public static Image LoadBitmap(string url)
{
	WebClient cl = new WebClient();
	cl.Credentials = CredentialCache.DefaultCredentials;
	byte [] bytes = cl.DownloadData(url);
        cl.Dispose();

	MemoryStream stream = new MemoryStream(bytes);
        return new Bitmap(stream);
}
Also you need add usings to:

Code: Select all

System.IO
System.Net
After then in BeforePrintEvent of image component:

Code: Select all

Image1.ImageToDraw = LoadBitmap("http://www.stimulsoft.com/Images/Logo/stimulsoft.logo.png");
Thank you.

image in web report

Posted: Sat May 23, 2009 5:49 am
by james
hi dear Jan
thank you very much. i appreciate your kindness.
this code solved my problem.