Comment faire pour imprimer directement rdlc rapport sans montrer PrintDialog() en C#?

J'ai une application dans laquelle je dois imprimer un RDLC rapport sans montrer la printDialog et à l'aide de la valeur par défaut de l'imprimante spécifiée définis dans l'application. Ci-dessous mon test implementaion code.

    Microsoft.Reporting.WinForms.ReportViewer reportViewerSales = new    Microsoft.Reporting.WinForms.ReportViewer();
    Microsoft.Reporting.WinForms.ReportDataSource reportDataSourceSales = new Microsoft.Reporting.WinForms.ReportDataSource();

    reportViewerSales.Reset();
        reportViewerSales.LocalReport.ReportPath = @"Sales.rdlc";

        reportDataSourceSales.Name = "SalesTableDataSet";

        int i = 1;
        foreach (Product item in ProductSalesList)
        {
            dataset.CurrentSales.AddCurrentSalesRow(i, item.Name, item.Quantity.ToString(), item.Price.ToString(), item.Price.ToString());
            i++;
        }
        reportDataSourceSales.Value = dataset.CurrentSales;
        reportViewerSales.LocalReport.DataSources.Add(reportDataSourceSales);
        dataset.EndInit();

        reportViewerSales.RefreshReport();
        reportViewerSales.RenderingComplete += new RenderingCompleteEventHandler(PrintSales);

Et voici mon Rendu Complet de la Méthode

public void PrintSales(object sender, RenderingCompleteEventArgs e)
    {
        try
        {

            reportViewerSales.PrintDialog();
            reportViewerSales.Clear();
            reportViewerSales.LocalReport.ReleaseSandboxAppDomain();
        }
        catch (Exception ex)
        {
        }
    }

OriginalL'auteur Redone | 2013-07-18