Export Options
I have created a preview control in order to open .fpx type reports. What I am needing to do is limit the export/save options under the save button. Is there a way to limit the options? I am using C#. I have read the programmers manual, but I didn't really see anything useful. I appreciate any assistance.
I found something on previous fast reports forums but it doesn't tell you how to access the sub menu items programatically: http://www.fast-report.com/en/forum/lofive....php/t8398.html
Please let me know how to access the submenu items in the Preview Control. Apparently this was fixed back in 2011 according to the forum discussion I just referenced. I am able to add custom buttons, but not remove the export options under save.
I found something on previous fast reports forums but it doesn't tell you how to access the sub menu items programatically: http://www.fast-report.com/en/forum/lofive....php/t8398.html
Please let me know how to access the submenu items in the Preview Control. Apparently this was fixed back in 2011 according to the forum discussion I just referenced. I am able to add custom buttons, but not remove the export options under save.
Comments
I tried: FastReport.Utils.RegisteredObjects.FindObject(typeof(FastReport.Export.XAML.XAMLExport)).Enabled = false; but it didn't work for me. Would anybody have insight as to what I might be doing wrong?
Here is what I used:
FastReport.Preview.PreviewControl preview = new FastReport.Preview.PreviewControl();
ButtonItem btnSave = preview.ToolBar.Items[preview.ToolBar.Items.IndexOf("btnSave")] as ButtonItem;
btnSave.SubItems.RemoveAt(0);
btnSave.SubItems.RemoveAt(2);
btnSave.SubItems.RemoveAt(6);
btnSave.SubItems.RemoveAt(7);
btnSave.SubItems.RemoveAt(8);
btnSave.SubItems.RemoveAt(9);
btnSave.SubItems.RemoveAt(10);
btnSave.SubItems.RemoveAt(11);
btnSave.SubItems.RemoveAt(12);
btnSave.SubItems.RemoveAt(13);
0 = Prepared Report
1 = Rich Text File
2 = MHT file
3 = Excel
4 = Word
5 = PowerPoint
6 = OpenOffice Writer
7 = OpenOffice Writer
8 = CSV file
9 = Text File/Matrix Printer
10 = XAML file
11 = FTP
12 = Dropbox
13 = OneDrive
There are some others that were not able to be taken off with this method for some odd reason. I am still looking for a way to restrict some of the other options. If anyone knows of any way to do it, please let me know. The index will only allow you to go up to 13 even though Visual Studio locates 20 items in the array in SubItems. Really weird.
ButtonItem btnSave = preview.ToolBar.Items[preview.ToolBar.Items.IndexOf("btnSave")] as ButtonItem;
btnSave.SubItems.RemoveAt(22);
btnSave.SubItems.RemoveAt(21);
btnSave.SubItems.RemoveAt(20);
btnSave.SubItems.RemoveAt(19);
btnSave.SubItems.RemoveAt(18);
btnSave.SubItems.RemoveAt(17);
btnSave.SubItems.RemoveAt(16);
btnSave.SubItems.RemoveAt(14);
btnSave.SubItems.RemoveAt(13);
btnSave.SubItems.RemoveAt(12);
Hope this helps anyone who needs it!
I'm using VB Instead of C#....
Does anybody know how to use this code in VB? [img]style_emoticons/<#EMO_DIR#>/sad.gif" style="vertical-align:middle" emoid=":(" border="0" alt="sad.gif" /> Really need to remove a few of those export options.... Thanks[/img]