Weird Error on Deployed Report System.Drawing.dll
Posted: Sun Feb 07, 2016 1:01 am
I have a web application which generates a report into a PDF format.
On my development machine, it runs properly, the report is being generated as expected.
On the deployed machine, the report is throwing an error:

When I run the application on debug, there was a Stack Overflow exception which happens on System.Drawing.dll.
In my code, the application would specifically hang at this line:
Sample code as below..
I thought that the System.Drawing.dll is corrupted, hence, I tried to copy the file into the bin folder and make the reference from there, but still I am getting an error.
Anyone encountered this issue?
On my development machine, it runs properly, the report is being generated as expected.
On the deployed machine, the report is throwing an error:
When I run the application on debug, there was a Stack Overflow exception which happens on System.Drawing.dll.
In my code, the application would specifically hang at this line:
Code: Select all
StiReport appReport = new StiReport();
Code: Select all
private void PreviewReport(int FromMonthID, int FromYear,
int ToMonthID, int ToYear,
int ProvinceID, string ReportObject)
{
string generatedDate = String.Format("{0:MMMM d, yyyy}", DateTime.Today);
string dbServer = System.Configuration.ConfigurationManager.AppSettings["DBServer"];
dbServer = dbServer.Replace(@"\\", @"\");
string dbDatabase = "Valid Values Here.";
string dbUser = "Valid Values Here.";
string dbPassword = "Valid Values Here.";
string connectionString = "User ID=" + dbUser + ";Initial Catalog=" + dbDatabase + ";Password=" + dbPassword + ";Integrated Security=False;Data Source=" + dbServer;
string reportMapPath = string.Empty;
switch (ReportObject.ToUpper())
{
case "A":
reportMapPath = "reports\\A.mrt";
break;
case "B":
reportMapPath = "reports\\B.mrt";
break;
case "C":
reportMapPath = "reports\\C.mrt";
break;
case "D":
reportMapPath = "reports\\D.mrt";
break;
case "RBYLP":
reportMapPath = "reports\\E.mrt";
break;
}
StiReport appReport = new StiReport();
appReport.Load(Server.MapPath(reportMapPath));
appReport.Dictionary.Databases.Clear();
appReport.Dictionary.Databases.Add(new StiSqlDatabase("WineTracker", connectionString));
appReport.Compile();
}
Anyone encountered this issue?