Page 1 of 1

Questions

Posted: Sun Jun 11, 2006 2:46 pm
by Stefan Schmidt
Can I disable some of the buttons in Preview?

As example I want to hide the buttons for load/save a report.

Another question. I understood that the reports may saved as c# files and may included as c# files into my project. Did this then replace the .mrt files. If so how will I open/call/run then the report?

Thanks.

Questions

Posted: Mon Jun 12, 2006 3:58 am
by Edward
There are 2 ways to disable buttons in Preview:
1. With use of the StiPreviewControl:

PreviewControl.ShowOpen = false;
PreviewControl.ShowSave = false;

2. Without StiPreviewControl:

//Do this operation once when running the program
StiConfig.Load();

//Get service
StiPreviewConfigService config = StiConfig.Services.GetService(typeof(StiPreviewConfigService)) as StiPreviewConfigService;

//Turn off all buttons of changes of the rendered report
config.SaveEnabled = false;
config.OpenEnabled = false;

//Save configuration if necessary
StiConfig.Save();

If you want to load a report from the c# file, which is included in your application, use the following code:

Reports.Report report = new Reports.Report();
report.Show();

Where the Reports.Report - the class from the file of a report included into the application;