StiWebDesigner - Object reference not set to an instance of an object

Stimulsoft Reports.WEB discussion
Post Reply
kamberkar
Posts: 6
Joined: Thu Mar 29, 2012 3:56 am

StiWebDesigner - Object reference not set to an instance of an object

Post by kamberkar »

Hello There,

I'm converting from older version of report designer to Stimulsoft.Reports.Web.2020.4.2\lib\net45\Stimulsoft.Report.WebDesign.dll. The main reason is to come out of flash version of Stimulsoft. I also added my license key in the startup. I'm getting following error. Really appreciate any help.

Exception information:
Exception type: NullReferenceException
Exception message: Object reference not set to an instance of an object.
at Stimulsoft.Report.Web.StiWebDesigner.RegisterClientScriptBlockIntoHeader(String key, String script) in D:\Stimulsoft\Stimulsoft.Reports\Stimulsoft.Report.WebDesign\Designer\StiWebDesigner.cs:line 94
at Stimulsoft.Report.Web.StiWebDesigner.OnPreRender(EventArgs e) in D:\Stimulsoft\Stimulsoft.Reports\Stimulsoft.Report.WebDesign\Designer\StiWebDesigner.Render.cs:line 604
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

My aspx code.

<%@ Register Assembly="Stimulsoft.Report.WebDesign" Namespace="Stimulsoft.Report.Web" TagPrefix="cc1" %>
<%@ Page Language="C#" AutoEventWireup="true" EnableEventValidation="false" Codebehind="ReportDesigner.aspx.cs" Inherits="Learnsoft.LSGLM.UI.Controls.ReportDesigner" enableViewState="True" %>
<!-- Contents of this control is rendered in code. See the Render method. -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>User Defined Report Designer</title>
</head>
<body>
<form id="formUDR" runat="server">
<input id="CustomReportID" type="hidden" name="CustomReportID" runat="server">
<div id="designerContainer" runat="server">
<cc1:StiWebDesigner ID="oReportDesigner" onsavereport="oReportDesigner_SaveReport" runat="server" Visible="true"></cc1:StiWebDesigner>
</div>
</form>
</body>
</html>

My code behind
protected void Page_Load(object sender, EventArgs e)
{
InitializeCulture();
try
{
if (!this.IsPostBack)
{
if (this.Request.QueryString["rid"] != null)
{
this.CustomReportID.Value = this.Request.QueryString["rid"];
LoadBaseReport();
}
}
}
catch (Exception oEx)
{
}
}

protected void LoadBaseReport()
{
string sErrorMsg = string.Empty;
try
{
StiReport oReport = new StiReport();
oReport.ReportAlias = "Report123";
sFilePath = ((System.Collections.Specialized.NameValueCollection)System.Configuration.ConfigurationSettings.GetConfig("ZZ/XX"))[UPLOAD_IMAGE_FILE_SERVER].ToString();
sFilePath += "\\Report\\";
string sUDXMLSchema = sFilePath + "UserDefinedReport.xsd";
string sUDXMLData = sFilePath + "UserDefinedReport.xml";
sFilePath += "Report123.MRT";
if (File.Exists(sFilePath))
{
oReport.Load(sFilePath);
oReportDesigner.Report = oReport;//.Design(oReport);
}
else
{
DataSet dsLMSData = new DataSet();
dsLMSData.ReadXmlSchema(sUDXMLSchema);
dsLMSData.ReadXml(sUDXMLData);
oReport.RegData(dsLMSData);
oReport.Dictionary.Synchronize();
oReportDesigner.Report = oReport;//.Design(oReport);
}
}
catch (Exception oEx)
{
}
}
Lech Kulikowski
Posts: 7336
Joined: Tue Mar 20, 2018 5:34 am

Re: StiWebDesigner - Object reference not set to an instance of an object

Post by Lech Kulikowski »

Hello,

You can find samples here:
https://github.com/stimulsoft?utf8=%E2% ... &language=

iff the issue still present, please send us a sample report with test data that reproduces the issue for analysis.

Thank you.
kamberkar
Posts: 6
Joined: Thu Mar 29, 2012 3:56 am

Re: StiWebDesigner - Object reference not set to an instance of an object

Post by kamberkar »

I'm attaching my schema and data files. I want to create a brand new report(MRT) via my attached code. But its giving me following error

Exception information:
Exception type: NullReferenceException
Exception message: Object reference not set to an instance of an object.
at Stimulsoft.Report.Web.StiWebDesigner.RegisterClientScriptBlockIntoHeader(String key, String script) in D:\Stimulsoft\Stimulsoft.Reports\Stimulsoft.Report.WebDesign\Designer\StiWebDesigner.cs:line 94
at Stimulsoft.Report.Web.StiWebDesigner.OnPreRender(EventArgs e) in D:\Stimulsoft\Stimulsoft.Reports\Stimulsoft.Report.WebDesign\Designer\StiWebDesigner.Render.cs:line 604
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
Attachments
LSGLMUserDefinedReport.xsd
(144.62 KiB) Downloaded 154 times
LSGLMUserDefinedReport.xml
(6.69 KiB) Downloaded 167 times
Lech Kulikowski
Posts: 7336
Joined: Tue Mar 20, 2018 5:34 am

Re: StiWebDesigner - Object reference not set to an instance of an object

Post by Lech Kulikowski »

Hello,

Please send us a sample project that reproduces the issue for analysis.

Thank you.
Post Reply