Option stopped working - StiWebViewer1.ViewMode

Stimulsoft Reports.WEB discussion
Post Reply
agent005
Posts: 24
Joined: Mon Dec 22, 2014 3:05 pm

Option stopped working - StiWebViewer1.ViewMode

Post by agent005 »

Hello,

It looks like in couple of latest builds (tested on UL_2016.07.15) code below stopped working

Code: Select all

StiWebViewer1.ViewMode = Stimulsoft.Report.Web.StiWebViewMode.WholeReport;
Viewer shows option One Page selected and not the Whole report as I specify in backpage. It used to work just fine for years and stopped last month or so.

Is there a new option to handle this or is it just a bug that needs to be fixed?
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Option stopped working - StiWebViewer1.ViewMode

Post by Alex K. »

Hello,

We couldn't reproduce this bug.
Can you please send us a simple project which reproduces the issue for analysis.

Thank you.
agent005
Posts: 24
Joined: Mon Dec 22, 2014 3:05 pm

Re: Option stopped working - StiWebViewer1.ViewMode

Post by agent005 »

Here is sample project. It's not a huge deal, but I think the issue is a follows - prior to last couple builds if I set ViewMode to WholeReport, load the page, show run button, and when user clicks run - it would not set ViewMode again, but viewer would remember the option set on page load. Now it seems like viewer no longer remembers that option, I have to set it right before showing the report.

Sample project attached, but I think that's check for IsPostBack causing the issue

Code: Select all

    protected void Page_Load(object sender, EventArgs e)
    {
    	if (!IsPostBack)
    	{
	        StiWebViewer1.ViewMode = Stimulsoft.Report.Web.StiWebViewMode.WholeReport;
    	}
    }

    protected void btnRender_Click(object sender, EventArgs e)
    {
        String missingFields = "";
        string appDirectory = HttpContext.Current.Server.MapPath(string.Empty);

        // Prepare data
        DataSet dataSet = new DataSet();
        dataSet.ReadXml(appDirectory + "\\Data\\Demo.xml");
        dataSet.ReadXmlSchema(appDirectory + "\\Data\\Demo.xsd");

        // Load report
        StiReport report = new StiReport();
        report.Load(appDirectory + "\\Reports\\SimpleList.mrt");
        report.RegData(dataSet);

        // View report
        StiWebViewer1.Report = report;
    }

Attachments
Demo.zip
sample project
(1.52 MiB) Downloaded 244 times
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Option stopped working - StiWebViewer1.ViewMode

Post by Alex K. »

Hello,

Need some additional time for investigating the issue.
At the current moment, please try to remove (!IsPostBack) check:

Code: Select all

protected void Page_Load(object sender, EventArgs e)
{
    StiWebViewer1.ViewMode = Stimulsoft.Report.Web.StiWebViewMode.WholeReport;
}
Thank you.
agent005
Posts: 24
Joined: Mon Dec 22, 2014 3:05 pm

Re: Option stopped working - StiWebViewer1.ViewMode

Post by agent005 »

OK, I've made the change already, so this issue is solved for me. My main concern is that some other users may see unexpected behavior change so it may be worth to correcting it, but this is not a big deal.
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Option stopped working - StiWebViewer1.ViewMode

Post by Alex K. »

Hello,

Ok. We understood the issue.
Need some additional time for investigating the issue.

Thank you.
Post Reply