logo
small logo
  • Producto
  • Comprar
  • Ayuda
  • Blogs
  • Consola de usarios Ayuda
    • en
    • pt
    • es
    • de
    • pl
    • JP
    • ZH
  • Página principal
  • /
  • Blogs
  • /
  • How to disable printing reports and other items from the menu when viewing the report FastReport.Net
  • Los eventos PreviewControl.OnPrint y PreviewControl.OnExport

    1 de octubre de 2020

    En FastReport 2019.4 se agregó la posibilidad de suscribirse a los eventos PreviewControl.OnPrint y PreviewControl.OnExport,

    read more
  • El evento de ExportParameters en WebReport.Report

    5 de octubre de 2020

    En FastReport 2020.1 hemos añadido la posibilidad de cambiar los parámetros de exportación. Para hacer

    read more
  • Toilet paper printing

    30 de marzo de 2020

    Gentlemen, jokes aside! Today we are talking about toilet paper. This essential hygiene product was

    read more
  • Formato de MS Word vs. Open Document Text, ¿cuál es mejor?

    19 de octubre de 2020

    Hablando de editores de texto, presentamos inmediatamente corifeo como Microsoft Word, que durante muchos años

    read more
  • ¿Quiere generar tablas para un usuario: Excel u OpenOffice Calc?

    8 de octubre de 2020

    Tablas. Durante siglos, se han utilizado para presentar datos similares para llevar registros, contar cantidades

    read more

How to disable printing reports and other items from the menu when viewing the report FastReport.Net

29 de febrero de 2020

The main report viewing tool FastReport.Net is Viewer. This viewer has a rich toolkit for storing, exporting, printing, and other manipulations with a report.

All this variety is very useful but not always necessary. For example, for users who only view and print reports export emailing is absolutely useless. Also, many people do not need a big list of available export reports. You just confused and lose time to find the right one.

In such cases, we would like to leave only the necessary functionality for these users. And it can be done quite simply.

This question also arose for the user of the Combit List & Label report generator.

The report designer of FastReport.Net, as you know, also allows you to view the reports. To do this, he uses the same Viewer. And you can customize the list of available exports in the designer's settings. File-'Options-User Interface menu:

 

Exports Menu button opens the settings window for export display:

 

You can customize the display of both individual exports and the whole group. There's a Default Menu button to quickly restore your original settings. For example, we removed exports from the display to the PDF, Office, and XML format. And indeed, when we view the report, we will see that they are no longer on the list of exports:

 

But from the report designer we can only set up a list of exports. What about other controls? To do this, you'll have to use programming skills. When creating an app that will run reports, we can set the reviewer's menu settings. For example, this code:

1
2
3
4
5
Report report = new Report();
 report.Load("App_Data/Master-Detail.frx");
 report.Prepare();
 FastReport.Utils.Config.PreviewSettings.Buttons = PreviewButtons.Print | PreviewButtons.Design;
 report.ShowPrepared();

 Here we set the button display. To be precise  - we just name all the buttons to be displayed: Print and Design.

As a result we get:

Great result - nothing more. Besides the buttons also displays the page number in the input field. It cannot be removed, otherwise you won't be able to go to other pages without page navigation buttons.

Now you can experiment a bit. If your application includes any logic for hiding / showing the controls in the preview, it will certainly be a useful opportunity to return everything to the initial form:

Config.PreviewSettings.Buttons = PreviewButtons.All;

You can go the other way and not list the buttons that should be displayed, but rather to list those that you want to exclude:

Config.PreviewSettings.Buttons ^ = PreviewButtons.Email;

At the same time, send e-mail button will disappear and the rest will be available.

Of course, you can edit the list of available exports, by analogy with the above example.

Also you can edit the export list through:  Config.PreviewSettings.Exports

And you can edit the exports to the clouds: Config.PreviewSettings.Clouds

about product descargar comprar
avatar
Dmitriy Fedyashov
Technical Writer
Fast Reports Team: Dmitriy Fedyashov - Technical Writer at Fast Reports
.NET FastReport Preview

Add comment
logo
  • 800-985-8986 (English, US)
  • +4930568373928 (German)
  • +55 19 98147-8148 (Portuguese)
  • info@fast-report.com
  • 901 N Pitt Str #325 Alexandria VA 22314
  • Comprar
  • Descargar
  • Documentación
  • Opiniones de usuarios
  • Cómo desinstalar nuestros productos
  • Enviar mensaje
  • FAQ
  • Toturial en vídeo
  • Foro
  • Documentación técnica
  • Nuestras noticias
  • Quiénes somos
  • Socios
  • Contactos

© 1998-2022 by Fast Reports Inc.

  • Privacidad