Questions

Stimulsoft Reports.NET discussion
Post Reply
Stefan Schmidt
Posts: 1
Joined: Sun Jun 11, 2006 2:34 pm

Questions

Post 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.
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

Questions

Post 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;
Post Reply