Urgent question - StiExcelExportSettings in code behind

Stimulsoft Reports.Silverlight discussion
Locked
jalal_logitude
Posts: 13
Joined: Wed Dec 18, 2013 1:03 pm

Urgent question - StiExcelExportSettings in code behind

Post by jalal_logitude »

I am trying to set
UseOnePageHeaderAndFooter = true

so each time, when user click on export to excel, this option will be checked by default.

I am using :

StiExcelExportSettings d = new StiExcelExportSettings();
d.UseOnePageHeaderAndFooter = true;

but it doesn't work.

How i should do that ??

Thanks
Jalal
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Urgent question - StiExcelExportSettings in code behind

Post by Alex K. »

Hello,

We couldn't reproduce this bug.
Please check the last prerelease build and let us know about the result.

Thank you.
jalal_logitude
Posts: 13
Joined: Wed Dec 18, 2013 1:03 pm

Re: Urgent question - StiExcelExportSettings in code behind

Post by jalal_logitude »

Hello,

it is not a bug.

I am just asking how i can set UseOnePageHeaderAndFooter = true from code behind ?

Thanks
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Urgent question - StiExcelExportSettings in code behind

Post by Alex K. »

Hello,

Please try to use the following code:

Code: Select all

var sf = new System.Windows.Controls.SaveFileDialog();
            if (sf.ShowDialog() == true)
            {
                var stream = sf.OpenFile();

                var settings = new StiExcelExportSettings();
                settings.UseOnePageHeaderAndFooter = true;
                report.ExportDocument(StiExportFormat.Excel, stream, settings);
            }
jalal_logitude
Posts: 13
Joined: Wed Dec 18, 2013 1:03 pm

Re: Urgent question - StiExcelExportSettings in code behind

Post by jalal_logitude »

Thanks Aleksey,

your code is ok and it works fine since i tried it before. But I don't want to use SaveFileDialog, i just want to use stimulsoft window that opens when press export to excel with UseOnePageHeaderAndFooter checked by default.

any way to do that ?

Jalal
HighAley
Posts: 8431
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Urgent question - StiExcelExportSettings in code behind

Post by HighAley »

Hello.

In this case you could try to use next code:

Code: Select all

StiSettings.Set("StiExcelSetupForm", "UseOnePageHeaderAndFooter", false);
But it there will be any changes in our export forms this code may stop working.

Thank you.
jalal_logitude
Posts: 13
Joined: Wed Dec 18, 2013 1:03 pm

Re: Urgent question - StiExcelExportSettings in code behind

Post by jalal_logitude »

Hello,

What you sent me doesn't work !
but the following code works fine :
StiSettings.Set("StiExcelExportSetupForm", "UseOnePageHeaderAndFooter", true);

Thanks
Jalal
Andrew
Posts: 4104
Joined: Fri Jun 09, 2006 3:58 am

Re: Urgent question - StiExcelExportSettings in code behind

Post by Andrew »

Hello,

From your last post I understand the issue is closed, right?

Thank you.
jalal_logitude
Posts: 13
Joined: Wed Dec 18, 2013 1:03 pm

Re: Urgent question - StiExcelExportSettings in code behind

Post by jalal_logitude »

Yes, Thanks
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Urgent question - StiExcelExportSettings in code behind

Post by Alex K. »

Hello,

Let us know if you need any additional help.
Locked