Hide Code Tab

GonzaloGonzalo Madrid
edited 1:08AM in FastReport .NET
Hi!

How can I hide the Tab Code in the Designer for the user?

Thanks!

Regards.

Comments

  • edited 1:08AM
    Hello,

    It's not possible to hide the Code Tab from your code. If you have FR.Net Pro with source code, you can tweak the designer source.
  • GonzaloGonzalo Madrid
    edited 1:08AM
    AlexTZ wrote: »
    Hello,

    It's not possible to hide the Code Tab from your code. If you have FR.Net Pro with source code, you can tweak the designer source.

    And I can disable it?
    I want that the user could not introduce malicious code in the FastReport Disigner.

    Thanks.
  • edited 1:08AM
    Hello,

    You can prevent execution of such code using the Report.ScriptRestrictions property. See more info about this property in the class reference.
  • GonzaloGonzalo Madrid
    edited 1:08AM
    AlexTZ wrote: »
    Hello,

    You can prevent execution of such code using the Report.ScriptRestrictions property. See more info about this property in the class reference.


    Thank you for answering.
    Please, where can I obtain more information about this class? Some example?
    I have been searching for Internet and have not found anything of usefulness.

    Regards.
  • edited 1:08AM
    You can learn about restrictions in MSDN. Here is sample from FastReport class reference:

    /// <summary>
    /// Gets or sets a set of permissions that will be restricted for the script code.
    /// </summary>
    /// <remarks>
    /// Since the report script is compiled into .NET assembly, it allows you to do ANYTHING.
    /// For example, you may create a script that will read/write files from/to a disk. This property
    /// is used to restrict such operations.
    /// <example>This example shows how to restrict the file IO operations in a script:
    /// <code>
    /// using System.Security;
    /// using System.Security.Permissions;
    /// ...
    /// PermissionSet ps = new PermissionSet(PermissionState.None);
    /// ps.AddPermission(new FileIOPermission(PermissionState.Unrestricted));
    /// report1.ScriptRestrictions = ps;
    /// report1.Prepare();
    /// </code>
    /// </example>
    /// </remarks>

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.