Page 1 of 1

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

Posted: Tue Oct 27, 2020 9:17 pm
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)
{
}
}

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

Posted: Tue Oct 27, 2020 9:46 pm
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.

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

Posted: Tue Oct 27, 2020 11:25 pm
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)

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

Posted: Fri Oct 30, 2020 7:54 am
by Lech Kulikowski
Hello,

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

Thank you.