Dashboard variables

Stimulsoft Dashboards.WEB discussion
Post Reply
r.bianco
Posts: 75
Joined: Thu Oct 27, 2016 2:06 pm

Dashboard variables

Post by r.bianco »

On Reports.Web I use some variables to print or filter data on the report.
I'm using 2019.1.1

On Page_Load event I have the following:

Code: Select all

StiReport myReport = new StiReport();
myReport.Load(strReportAbsolutePath);
myReport.Dictionary.Variables["MyVar"].Value = Session["var"].ToString();
The web demo code shows you just need to istantiate the StiReport and load the dashboard, but it generates an "object reference not set on object instance" on the myReport.Dictionary.Variables["MyVar"].Value

Do Dashboards support the variables?

Do I need to load the dashboard inside a report like this

Code: Select all

var report = new StiReport();
report.Pages.Clear();

var dashboard = new StiDashboard();
report.Pages.Add(dashboard);
and assign the variables to the report?

Thank you
Soft System srl
r.bianco
Posts: 75
Joined: Thu Oct 27, 2016 2:06 pm

Re: Dashboard variables

Post by r.bianco »

My bad, I should have used .Add() instead of accessing the array directly, I don't know how it even worked before ;)
Soft System srl
Lech Kulikowski
Posts: 6238
Joined: Tue Mar 20, 2018 5:34 am

Re: Dashboard variables

Post by Lech Kulikowski »

Hello,

Ok. Thank you for the information.
Post Reply