Page 4 of 6
New Problem
Posted: Fri May 14, 2010 12:35 pm
by MikeD
I think I figured it out.
But still getting the 2032 error.
Here's example of my code.
///
/// Default page load.
///
///
///
private void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
bool reportLoaded = SessionManager.ReportLoaded;
if (!reportLoaded)
{
int reportId = 0;
reportId = Convert.ToInt32(UIUtil.FetchEncodedInputString(Request, UIConstants.URLPARAM_REPORT_ID));
SessionManager.CurrentReportID = reportId;
Stimulsoft.Report.StiReport stiReport = new Stimulsoft.Report.StiReport();
LoadReport(stiReport);
}
else
{
Response.Redirect("ConfigureReports.aspx");
}
}
}
///
/// Set the report options and load the report.
///
///
private void LoadReport(Stimulsoft.Report.StiReport report)
{
ReportDesigner.UseCache = true;
Stimulsoft.Report.Web.StiWebDesignerOptions.ModifyDictionary = true;
Stimulsoft.Report.Web.StiWebDesignerOptions.ModifyConnections = true;
Stimulsoft.Report.Web.StiWebDesignerOptions.ModifyVariables = true;
ReportDesigner.Design(report);
}
///
/// Event called to load a report. The report is fetched from the database. Then loaded into the Stimulsoft report.
///
///
///
protected void WebReportDesigner_GetReport(object sender, Stimulsoft.Report.Web.StiWebDesigner.StiGetReportEventArgs e)
{
Stimulsoft.Report.StiReport stiReport = e.Report;
int reportId = SessionManager.CurrentReportID;
if (reportId > 0)
{
// ----------------------------------------------------------------------------------------------------------
// Get the PrestoReport content item and build the report.
// ----------------------------------------------------------------------------------------------------------
SessionManager.ReportLoaded = true;
PrestoReport report = PrestoReportsManager.Instance.GetReport(reportId);
if (report != null)
{
SessionManager.ReportName = report.Name;
SessionManager.ReportSQL = report.SQL;
SessionManager.ReportStoredProc = report.StoredProc;
stiReport.Load(report.ReportFile);
}
}
}
I'm getting the following error.
Object reference not set to an instance of an object.
body {font-family:"Verdana";font-weight:normal;font-size: .7em;color:black;}
p {font-family:"Verdana";font-weight:normal;color:black;margin-top: -5px}
b {font-family:"Verdana";font-weight:bold;color:black;margin-top: -5px}
H1 { font-family:"Verdana";font-weight:normal;font-size:18pt;color:red }
H2 { font-family:"Verdana";font-weight:normal;font-size:14pt;color:maroon }
pre {font-family:"Lucida Console";font-size: .9em}
.marker {font-weight: bold; color: black;text-decoration: none;}
.version {color: gray;}
.error {margin-bottom: 10px;}
.expandable { text-decoration:underline; font-weight:bold; color:navy; cursor:hand; }
Server Error in '/Presto3_1' Application.
Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
Source Error:
Line 158: SessionManager.ReportStoredProc = report.StoredProc;
Line 159:
Line 160: stiReport.Load(report.ReportFile);
Line 161:
Line 162: }
Source File: C:\Presto3_1\WebApps\Mercury\configure\Reports\EditReports.aspx.cs Line: 160
Stack Trace:
[NullReferenceException: Object reference not set to an instance of an object.]
Inmagic.Mercury.WebApps.Mercury.configure.reports.EditReports.WebReportDesigner_GetReport(Object sender, StiGetReportEventArgs e) in C:\Presto3_1\WebApps\Mercury\configure\Reports\EditReports.aspx.cs:160
Stimulsoft.Report.Web.StiWebDesigner.OnGetReport(StiGetReportEventArgs e) +28
Stimulsoft.Report.Web.StiWebDesigner.InvokeGetReport() +40
Stimulsoft.Report.Web.StiWebDesigner.OnInit(EventArgs e) +724
System.Web.UI.Control.InitRecursive(Control namingContainer) +333
System.Web.UI.Control.InitRecursive(Control namingContainer) +210
System.Web.UI.Control.InitRecursive(Control namingContainer) +210
System.Web.UI.Control.InitRecursive(Control namingContainer) +210
System.Web.UI.Control.InitRecursive(Control namingContainer) +210
System.Web.UI.Control.InitRecursive(Control namingContainer) +210
System.Web.UI.Control.InitRecursive(Control namingContainer) +210
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +378
Version Information: Microsoft .NET Framework Version:2.0.50727.3607; ASP.NET Version:2.0.50727.3082
Now here's the weird thing....After I get the error I click OK....A blank report is loaded. I then Exit out of the report...only it doesn't exit...Instead the loads the report just fine.
Mike
New Problem
Posted: Fri May 14, 2010 12:46 pm
by MikeD
Just wanted to emphasize. This does NOT happen ALL the time. About 50% of the time.
New Problem
Posted: Mon May 17, 2010 12:21 am
by Vladimir
Hello, Mike
Please try the following code:
Code: Select all
protected void WebReportDesigner_GetReport(object sender, Stimulsoft.Report.Web.StiWebDesigner.StiGetReportEventArgs e)
{
Stimulsoft.Report.StiReport stiReport = new Stimulsoft.Report.StiReport();
int reportId = SessionManager.CurrentReportID;
if (reportId > 0)
{
// ----------------------------------------------------------------------------------------------------------
// Get the PrestoReport content item and build the report.
// ----------------------------------------------------------------------------------------------------------
SessionManager.ReportLoaded = true;
PrestoReport report = PrestoReportsManager.Instance.GetReport(reportId);
if (report != null)
{
SessionManager.ReportName = report.Name;
SessionManager.ReportSQL = report.SQL;
SessionManager.ReportStoredProc = report.StoredProc;
stiReport.Load(report.ReportFile);
e.Report = stiReport;
}
}
}
Thank you.
New Problem
Posted: Mon May 17, 2010 7:54 am
by MikeD
Well it seems to be working. Been testing for two days now.
THANK YOU.
I would also like to say..I've been very impressed with the product and with the support I've been getting. It's a nice change to work with a very responsible company who seems to actually be concerned with their customer satisfaction. Unfortunately many software companies I've dealt with have not been this responsive.
Thank you again...This is truly an excellent product.
New Problem
Posted: Mon May 17, 2010 8:21 am
by Vladimir
Hello, Mike
Thank you very much for the feedback. Our company is very carefully tries to help our customers. And will keep on doing this. Customer satisfaction is our priority.
Thank you!
New Problem
Posted: Wed May 19, 2010 8:34 am
by MikeD
New twist with this problem.
First off...it runs PERFECTLY on my machine. Just now having problems when we deployed it to testing.
No error is ever thrown...but the same symptoms as the 2032 error....can't load an existing report from code or create a new report and preloading a dataset.
And the problem ONLY OCCURS WITH IE. Works perfectly well with Firefox.
I installed the release version on my computer and getting the same error problem. But if someone connects to development version...it works GREAT...no matter what browser you use.
Any ideas what may be causing this problem. Our IT guys and I are stumped.
One last thing...I was able to prove that the Get_Report event is NEVER being called with IE.
New Problem
Posted: Thu May 20, 2010 12:13 am
by Vladimir
Hello, Mike
One last thing...I was able to prove that the Get_Report event is NEVER being called with IE.
Do you set the UseCache property to false?
Thank you.
New Problem
Posted: Thu May 20, 2010 7:39 am
by MikeD
NO..I set UseCache = true.
New Problem
Posted: Thu May 20, 2010 9:06 am
by Vladimir
Hello, Mike
Please set the UseCache property to false. Does the GetReport event is called in this case? Does the error disappear with loading a report?
Thank you.
New Problem
Posted: Thu May 20, 2010 10:38 am
by MikeD
UseCache = false didn't help.
I did rewrite my code...to ensure that the GetReport method was in fact being called.
I also added some Logging.
The Logging shows that GetReport is being called.
Here the GetReport Code.
///
/// Event called to load a report. The report is fetched from the database. Then loaded into the Stimulsoft report.
///
///
///
protected void WebReportDesigner_GetReport(object sender, Stimulsoft.Report.Web.StiWebDesigner.StiGetReportEventArgs e)
{
try
{
StringBuilder msg = new StringBuilder();
msg.AppendLine("GetReport");
LoggingFacade.WriteDebugTrace(msg);
Stimulsoft.Report.StiReport stiReport = new Stimulsoft.Report.StiReport();
int reportId = SessionManager.CurrentReportID;
if (reportId > 0)
{
// ----------------------------------------------------------------------------------------------------------
// Get the PrestoReport content item and build the report.
// ----------------------------------------------------------------------------------------------------------
SessionManager.ReportLoaded = true;
PrestoReport report = PrestoReportsManager.Instance.GetReport(reportId);
if (report != null)
{
SessionManager.ReportName = report.Name;
string sql = ReportHelper.Instance.ReformatSQLCommand(report.SQL);
SessionManager.ReportSQL = sql;
SessionManager.ReportStoredProc = report.StoredProc;
msg = new StringBuilder();
msg.AppendLine("Report.Load");
LoggingFacade.WriteDebugTrace(msg);
msg = new StringBuilder();
msg.AppendLine("Reportfile Size : " + report.ReportFile.Count().ToString());
LoggingFacade.WriteDebugTrace(msg);
stiReport.Load(report.ReportFile);
e.Report = stiReport;
}
}
}
catch (Exception ex)
{
string msg = String.Format("Failed to save Report");
throw new InmagicSystemException(msg, ex);
}
}
Here is what was logged.
Presto user: admin
--------------------------------------------------------
Timestamp: Thu, 20 May 2010 15:31:58 GMT (05/20/2010 11:31:58)
Category: Debug Trace; Priority: 1; Severity: Information Process: c:\windows\system32\inetsrv\w3wp.exe
Message: GetReport
Presto user: admin
--------------------------------------------------------
Timestamp: Thu, 20 May 2010 15:31:58 GMT (05/20/2010 11:31:58)
Category: Debug Trace; Priority: 1; Severity: Information Process: c:\windows\system32\inetsrv\w3wp.exe
Message: Report.Load
Presto user: admin
--------------------------------------------------------
Timestamp: Thu, 20 May 2010 15:31:58 GMT (05/20/2010 11:31:58)
Category: Debug Trace; Priority: 1; Severity: Information Process: c:\windows\system32\inetsrv\w3wp.exe
Message: Reportfile Size : 10087
The file size of the report is correct.
Mike