WebViewer Export Problem

Stimulsoft Reports.NET discussion
Post Reply
jifriz
Posts: 4
Joined: Wed Mar 24, 2010 10:08 pm

WebViewer Export Problem

Post by jifriz »

Hi

using Stimulsoft Reports.Net 2010.1

I have a report and an asp.net web page

the report loads perfectly

and export goes fine

I have a drop down list that regenerate the report based on selection

every time I select another item from the list , the report renders fine based on selection

but if I clicked export as PDF it export the first initial created report


here is my code for generating the report:

Code: Select all

      void LoadReport()
        {

            DataSet ds = new DataSet();

            SqlDataAdapter ada = new SqlDataAdapter("select * from [vwTimeTable] where SEID=" + ddlSEID.SelectedValue, ConfigurationManager.ConnectionStrings["netTiersConnectionString"].ConnectionString);

            ada.Fill(ds);

            ds.DataSetName = "Connection";
            ds.Tables[0].TableName = "vwTimeTable";


            StiReport rtp = new StiReport();

            rtp.Load(Server.MapPath("~/Reports/rptTimeTable.mrt"));
       

            rtp.Dictionary.Databases.Clear();
            rtp.DataSources.Clear();

            rtp.RegData("vwTimeTable", ds.Tables["vwTimeTable"]);
            rtp.RegData("Connection", ds);



            rtp.Dictionary.Synchronize();
        
            StiWebViewer1.Report = rtp;


        }
Vladimir
Posts: 1462
Joined: Fri Apr 13, 2007 4:05 am
Location: Earth

WebViewer Export Problem

Post by Vladimir »

Hello,

Currently selected value of the combo box is saved into ViewState, but the ViewState is not saved when exporting in Ajax mode. For solving this problem, you can save selected value in other place: for example, in server cache or in url string.

Thank you.
jifriz
Posts: 4
Joined: Wed Mar 24, 2010 10:08 pm

WebViewer Export Problem

Post by jifriz »

The dropdownlist is set to autopostpack="true"
there are no updatepanels or ajax stuff on web page

also the new report is generated fine based on my dropdownlist selection
but the problem is in the exported report
because it always export to the first report generated

as if it export it from cache or something similar
Vladimir
Posts: 1462
Joined: Fri Apr 13, 2007 4:05 am
Location: Earth

WebViewer Export Problem

Post by Vladimir »

Hello,

Please try to set the RenderMode property to AjaxWithCache:
Thank you.
jifriz
Posts: 4
Joined: Wed Mar 24, 2010 10:08 pm

WebViewer Export Problem

Post by jifriz »

Thanks it worked
Andrew
Posts: 4109
Joined: Fri Jun 09, 2006 3:58 am

WebViewer Export Problem

Post by Andrew »

Great! :biggrin:
Post Reply