SubReport, DataSources

StarkStark Syria
edited July 2009 in FastReport .NET
Hi , have a good day ...

I have two Question ... for fastreport.net


1) I have a Report with Subreport , but sometimes I need to hide/Delete SubReport from the Report by code
( I want to hide it from preview window and printing )


2) I have fastreport Desinger with this code
environmentSettings1.DesignerSettings.Restrictions.DontShowRecentFiles = true;
environmentSettings1.DesignerSettings.Restrictions.DontChangeReportOptions = true;
environmentSettings1.DesignerSettings.Restrictions.DontCreatePage = true;
environmentSettings1.DesignerSettings.Restrictions.DontCreateReport = true;
environmentSettings1.DesignerSettings.Restrictions.DontDeletePage = true;
environmentSettings1.DesignerSettings.Restrictions.DontEditData = true;
environmentSettings1.DesignerSettings.Restrictions.DontInsertBand = true;
environmentSettings1.DesignerSettings.Restrictions.DontLoadReport = true;

All this restricted seems to be woking . except the (DontEditData)
my user can still View/change My DataSource Query , and create a new Connection ...

I want to Allow Them Only
* Drag Objects(Columns) from Data->DataSource to report bands , and delete this objects from the report band
I can do the other saving and new report and delete pages restrections .....


any help will be appreciated , and thank you very much ....

Comments

  • edited 9:24PM
    Hello,

    1) set subreport's Visible property to false. You can do this in the BeforePrint event handler of the main band which contains a subreport.
    2) I've tried to do
    Config.DesignerSettings.Restrictions.DontEditData = true
    This hides the "Data" menu, disables the "Actions" menu of the Data window, and disables some context menu items. User cannot add a new connection or edit an existing connection anymore.
  • StarkStark Syria
    edited July 2009
    Thank you for your replay ,,,,

    and I am very sorry for asking you again ....

    1) Please see this project about data restrections it's very short , Only two lines of code ,
    but it still not working


    P.S
    I am using fastreport 1.1.1



    thank you in advance
  • edited 9:24PM
    Please use the latest available build, 1.1.53.
  • StarkStark Syria
    edited 9:24PM
    Thank you , I will use the last build ,,


    and the sub report prb has been solved .
                FastReport.SubreportObject rpt = billrpt.FindObject("Subreport1") as FastReport.SubreportObject;
                rpt.Visible = false;
    

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.