Xtrareport - View report but don’t print

Asked

Viewed 67 times

0

I’m using the report builder XtraReport, and using ReportPrintTool to view and then print.

However, it was necessary, just visualize, blocking the print. It would be possible?

Preview button:

private void button8_Click(object sender, EventArgs e) // botao imprimir
    {
        // Create a report. 
        imp_orcamento report = new imp_orcamento(Convert.ToInt32(textBox1.Text));

        // Show the report's preview. 
        ReportPrintTool tool = new ReportPrintTool(report);
        tool.ShowRibbonPreviewDialog(); 
    }

1 answer

0


Solution:

private void button8_Click(object sender, EventArgs e) // botao imprimir
    {
        // Create a report. 
        imp_orcamento report = new imp_orcamento(Convert.ToInt32(textBox1.Text));

        // Show the report's preview. 
        ReportPrintTool tool = new ReportPrintTool(report);

        tool.Report.PrintingSystem.SetCommandVisibility(PrintingSystemCommand.File, false);
        tool.Report.PrintingSystem.SetCommandVisibility(PrintingSystemCommand.ExportFile, false);
        tool.Report.PrintingSystem.SetCommandVisibility(PrintingSystemCommand.Print, false);
        tool.Report.PrintingSystem.SetCommandVisibility(PrintingSystemCommand.Save, false);
        tool.Report.PrintingSystem.SetCommandVisibility(PrintingSystemCommand.Open, false);
        tool.Report.PrintingSystem.SetCommandVisibility(PrintingSystemCommand.SendFile, false);
        tool.Report.PrintingSystem.SetCommandVisibility(PrintingSystemCommand.PageSetup, false);
        tool.Report.PrintingSystem.SetCommandVisibility(PrintingSystemCommand.PrintDirect, false);


        tool.ShowRibbonPreviewDialog();
    }

Browser other questions tagged

You are not signed in. Login or sign up in order to post.