Page 1 of 1

limiting the possible save options

Posted: Wed Sep 09, 2009 10:40 am
by remkop
We show a report via an C# application. There are to many options to save the report in, so we want to limit this.
I could find something ablout a configuration file. So I have done something like this

Code: Select all

StiConfig.Load("..\\..\\report_config.Config");

StiServiceContainer Services = (StiServiceContainer)StiConfig.Services.GetServices(typeof(StiExportService));
foreach (StiService Service in Services)
{
	if (Service is StiPdfExportService)
	{
		Service.ServiceEnabled = false;
	}
}
StiConfig.Save();
For some raeson it's is still possible to save the report as an PDF. I think this has to do with the fact that our mrt-file isn't connected to the cofiguration file. I have no idea how to do this and/or this is the rhight way to limit the save options ...

So if anyone has thoughts about this, please provide some feedback.

limiting the possible save options

Posted: Wed Sep 09, 2009 12:46 pm
by Jan
Hello,

You can use following code:

Code: Select all

StiOptions.Viewer.Windows.Exports.ShowPdf = false;
StiOptions.Viewer.Windows.Exports.ShowXps = false;
StiOptions.Viewer.Windows.Exports.ShowExcel = false;
Thank you.

limiting the possible save options

Posted: Thu Sep 10, 2009 2:32 am
by remkop
Thanks for the answer.

Where should i put these lines??
Because this isn't working

Code: Select all

Report.Load("..\\..\\CustomPreview.mrt");
Report.Compile();

Report.Render(false);
StiOptions.Viewer.Windows.Exports.ShowPdf = false;
StiOptions.Viewer.Windows.Exports.ShowXps = false;
StiOptions.Viewer.Windows.Exports.ShowExcel = false;
PreviewControl.Refresh();

limiting the possible save options

Posted: Thu Sep 10, 2009 3:15 am
by remkop
I found out that I should place this in the template.
But are there also options to arange this from the calling application??

limiting the possible save options

Posted: Thu Sep 10, 2009 7:59 pm
by Edward
Hi

Please place this code in a very beginning of your application, i.e. in program.cs, when none of the report objects have been created.

Thank you.