Export - Always turn on 'Use Page Headers & Footers'

Stimulsoft Reports.NET discussion
Post Reply
RossAFaneuf
Posts: 28
Joined: Thu Jul 28, 2011 9:16 am
Location: USA

Export - Always turn on 'Use Page Headers & Footers'

Post by RossAFaneuf »

We have a set of reports which are available to users of our Web application. The users have the option to save (export) reports in a limited number of formats. For MS Word 2007/2010 (docx), we need to set the 'Use Page Headers & Footers' to always be on. How do we do this in either the saved report MRT or the StiWebViewer configuration?
Ivan
Posts: 960
Joined: Thu Aug 10, 2006 1:37 am

Export - Always turn on 'Use Page Headers & Footers'

Post by Ivan »

Hello,

You need to add your own method, for example:

Code: Select all

        public void SetExportProperty(object sender, StiExportDataEventArgs args)
        {
            if (args.Settings is StiWord2007ExportSettings)
            {
                (args.Settings as StiWord2007ExportSettings).UsePageHeadersAndFooters = true;
            }
        }
Then you can use this method in the PageLoad event:

Code: Select all

StiWebViewer1.ReportExport += new Stimulsoft.Report.Web.StiExportDataEventHandler(SetExportProperty);
or add property for the StiWebViewer on the aspx-page:

Code: Select all

        
Thank you.
Post Reply