Click here to Skip to main content
16,018,202 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have a problem getting my reportviewer image once i publish to production, my error message was "An error occurred during local report processing". Everything was pretty good at development but it was the production server that counts. Anw i have a image named MemoryStreamImage.png in my image folder. Can any one please help me?

mycode:

C#
Chart1.Series.Clear();
Chart1.ChartAreas[0].AxisX.MajorGrid.LineColor = System.Drawing.Color.LightGray;
Chart1.ChartAreas[0].AxisY.MajorGrid.LineColor = System.Drawing.Color.LightGray;
MultiView1.Visible = true;
DataTable table = new DataTable();
table.Columns.Add("FunctionGroup");
table.Columns.Add("AverageGrading");
table.Columns.Add("Date");
ArrayList listofdates = dbmanager.GetListofDatesViaSection(section);
string[] functionsplit = functionlist.Split(',');

foreach (DateTime date in listofdates)
{
    foreach (string function in functionsplit)
    {
        double gradingresult = dbmanager.GetAverageAppraisalForFunction(section, function, date);

        string monthname = System.Globalization.CultureInfo.CurrentCulture.DateTimeFormat.GetMonthName(date.Month);
        table.Rows.Add(function, gradingresult, monthname.Substring(0, 3) + "/" + date.Year.ToString().Substring(2, 2));
    }
}
DataTableReader datareader = table.CreateDataReader();
Chart1.DataBindCrossTable(datareader, "FunctionGroup", "Date", "AverageGrading", "");
Chart1.Legends.Add("Legend");
Chart1.Legends[0].Enabled = true;
Chart1.Legends[0].BackColor = System.Drawing.Color.Transparent;
Chart1.Width = 500;
Chart1.Height = 500;
Chart1.SaveImage(Server.MapPath("./Image/MemoryStreamImage.png"));

Microsoft.Reporting.WebForms.ReportParameter[] ReportParameters = new Microsoft.Reporting.WebForms.ReportParameter[1];
ReportParameters[0] = new Microsoft.Reporting.WebForms.ReportParameter("ReportParameter1", "file:///" + Server.MapPath("./Image/MemoryStreamImage.png"));
ReportViewer1.LocalReport.SetParameters(ReportParameters);
MultiView1.ActiveViewIndex = 0;
Posted
Updated 25-Apr-12 20:01pm
v2
Comments
Herman<T>.Instance 26-Apr-12 5:33am    
have you tried changing ./Image to ~/Image?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900