Object reference not set to an instance
Posted: Thu Aug 17, 2017 10:16 am
Hi,
I am using the StiMobileDesigner component inside an aspx page,
code behind:
sometimes I get the error below (not always and for the same template):

I am using the StiMobileDesigner component inside an aspx page,
Code: Select all
<cc2:StiMobileDesigner ID="StiMobileDesigner1" runat="server"
onsavereport="StiMobileDesigner1_SaveReport" Visible="true"
/>
Code: Select all
protected void Page_Load(object sender, EventArgs e)
{
if (Page != null && !Page.IsPostBack)
{
var templateId = Request.QueryString["templateId"];
if (!string.IsNullOrEmpty(templateId))
{
TemplayesQuery tQuery = new TemplatesQuery();
byte[] templateBody = tQuery.GetTemplateBody(templateId);
StiReport report = new StiReport();
if (templateBody != null)
{
report.Load(templateBody);
}
StiMobileDesigner1.Report = report;
}
}
}