visibility button command in print ribbon report devexpress

0 thích 0 không thích
33 lượt xem
đã hỏi 6 Tháng 7, 2018 trong Devexpress bởi nguyenthao (5,620 điểm)
Link tham khảo: https://documentation.devexpress.com/XtraReports/2571/Creating-End-User-Reporting-Applications/WinForms-Reporting/Print-Preview/API-and-Customization/Using-Printing-System-Commands
using DevExpress.XtraPrinting;
using DevExpress.XtraReports.UI;
// ...

private void button1_Click(object sender, System.EventArgs e) {
    // Create a Print Tool with an assigned report instance. 
    ReportPrintTool printTool = new ReportPrintTool(new XtraReport1());

    // Access the Print Tool's Printing System.
    PrintingSystemBase printingSystem = printTool.PrintingSystem;

    // Remove the Watermark command from the Print Preview UI.
    if (printingSystem.GetCommandVisibility(PrintingSystemCommand.Watermark)
        != CommandVisibility.None) {
        printingSystem.SetCommandVisibility(PrintingSystemCommand.Watermark,
            CommandVisibility.None);
    }

    // Enable the Document Map command in the Print Preview UI.
    printingSystem.SetCommandVisibility(PrintingSystemCommand.DocumentMap,
        CommandVisibility.All);

    // Disable document export to any format.
    printingSystem.SetCommandVisibility(new PrintingSystemCommand[] { 
        PrintingSystemCommand.ExportCsv, PrintingSystemCommand.ExportTxt, PrintingSystemCommand.ExportDocx, 
        PrintingSystemCommand.ExportHtm, PrintingSystemCommand.ExportMht, PrintingSystemCommand.ExportPdf, 
        PrintingSystemCommand.ExportRtf, PrintingSystemCommand.ExportXls, PrintingSystemCommand.ExportXlsx, 
        PrintingSystemCommand.ExportGraphic },
        CommandVisibility.None);

    // Enable the "Export to CSV" and "Export to TXT" commands.
    printingSystem.SetCommandVisibility(new PrintingSystemCommand[] { 
        PrintingSystemCommand.ExportCsv, PrintingSystemCommand.ExportTxt },
        CommandVisibility.All);

    // Disable export and mailing of documents.
    printingSystem.SetCommandVisibility(new PrintingSystemCommand[] { 
        PrintingSystemCommand.SendFile },
        CommandVisibility.None);

    // Show the report's Print Preview in a dialog window.
    printTool.ShowPreviewDialog();
}
Looking for an answer?  Share this question:     

Xin vui lòng đăng nhập hoặc đăng ký để trả lời câu hỏi này.

...