When using StiVariables, report is null in Designer Preview

Stimulsoft Reports.Silverlight discussion
Locked
bobsov
Posts: 115
Joined: Sun Jan 27, 2013 12:10 am

When using StiVariables, report is null in Designer Preview

Post by bobsov »

In my silverlight designer, I am loading data in page load event.

Code: Select all

report.RegData(pd.ReportData());
        StiWebDesignerSL1.Report = report;
Also I have preview_dataset event to load data again for preview purpose.

Code: Select all

protected void PreviewDataSet_Event(object sender, StiWebDesignerSL.StiPreviewDataSetEventArgs e)
    {
        var report = GetReport();
        var pd = new ProcessData(report, "/api/reporting/run");
        e.PreviewDataSet = pd.ReportData();
       
    }
This works great if I don't have any variables defined. As soon as I define variable, in the preview dataset event, e.Report is null. In StiWebDesignerSL.cs file, it calls a different method (ServerPrepareRequestFromUserVariables) to process which invokes previewdataset event first. Any idea why report is null and how can I make sure it works when variable is declared.

The variable is trying to load values from data column in the dropdownlist. In silverlight preview screen, because of report being null, the variable is disabled and do not show dropdown list.

By the way, if I save this report as is and go to my html5 viewer, this variable is shown as dropdownlist with values from data column and works as expected. It just does not work when in silverlight designer preview.

Any help would be appreciated.
bobsov
Posts: 115
Joined: Sun Jan 27, 2013 12:10 am

Re: When using StiVariables, report is null in Designer Prev

Post by bobsov »

I did further digging on this and found that when variable is used, the report string does not contain databand info. I am not sure why databand is missing.
HighAley
Posts: 8431
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: When using StiVariables, report is null in Designer Prev

Post by HighAley »

Hello.

There were several improvements.
Please, check the latest prerelease build that is available on our site.
If it will not help, send us a sample project which reproduces the issue.

Thank you.
bobsov
Posts: 115
Joined: Sun Jan 27, 2013 12:10 am

Re: When using StiVariables, report is null in Designer Prev

Post by bobsov »

This is found using both 2013.1 and latest pre-build. I think I have discovered why this is an issue and will run by you guys if I am able to resolve this.
bobsov
Posts: 115
Joined: Sun Jan 27, 2013 12:10 am

Re: When using StiVariables, report is null in Designer Prev

Post by bobsov »

I figured this out. I had to modify some parts of the source code to make it to work. Basically, when encoded string is received for stimulsoft_viewer1 query string, I had to process it, and create report first, then call InvokePreviewDataset method. This trick worked for me and now I am able to see variables and preview report working together fine.

Thanks Aleskey for looking into it.
HighAley
Posts: 8431
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: When using StiVariables, report is null in Designer Prev

Post by HighAley »

Hello.

We are glad to work with such costumers.
Let us know if you will need any additional help.

Thank you.
Locked