A generic error occurred in GDI+ error
I'm having a problem with running a report from a workflow using the TemplateReport activity. All of it works until I try to load an image from either disk or a url.
I need to dynamically select what image appears in the report, so selecting an image at design time is out.
I have had the workflow downloading an image and putting it into a datatable in a dataset and providing that to the template report.
I have also tried having the report itself load an image using script.
On my development VM both approaches work perfectly, but on the production server I keep getting the error 'A generic error occurred in GDI+'
Here's a simplified version of the report script:
public void Detail1_Format()
{
string pictureUrl ="http://upload.wikimedia.org/wikipedia/commons/thumb/5/55/Potok_pod_jezerom_1.jpg/220px-Potok_pod_jezerom_1.jpg";
//Setting up the image to retrieve webrequest
System.Drawing.Image pinImage = null;
System.Net.WebRequest req = System.Net.WebRequest.Create( pictureUrl );
using( System.Net.WebResponse response = req.GetResponse() )
using( System.IO.Stream stream = response.GetResponseStream() )
{
pinImage = System.Drawing.Image.FromStream( stream );
}
Picture PictureProperty = rpt.Sections["Detail1"].Controls["Picture1"] as Picture;
PictureProperty.HyperLink = pictureUrl;
PictureProperty.DataField = pictureUrl;
PictureProperty.Image = pinImage;
}
Has anyone seen this? Is there a work around?
Thanks,
Luke.
Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.
Kommentare
0 Kommentare