2014-02-12 2 views

ответ

1

Попробуйте это:

Используйте PrintControl, чтобы показать отчет в том виде, как я делаю ..:

PrintControl control = new PrintControl(); 
SomeForm.Controls.Add(control); 

/// Put this code to show report in Printcontrol at SomeForm 
public void SetReport(XtraReport report) 
{ 
      if (report != null) 
      { 
       control.PrintingSystem = report.PrintingSystem; 
       SetupButtonVisability(); 
       report.CreateDocument(); 
       report.RecreateDocumentMap();     
       control.PrintingSystem = report.PrintingSystem;    
      } 
} 

Другой способ заполните также следующую ссылку для документации:
How to: Invoke a Report's Print Preview

XtraReport1 report = new XtraReport1(); 

    using (ReportPrintTool printTool = new ReportPrintTool(report)) { 
     // Invoke the Print Preview form modally, 
     // and load the report document into it. 
     printTool.ShowPreviewDialog(); 

     // Invoke the Print Preview form 
     // with the specified look and feel setting. 
     printTool.ShowPreview(UserLookAndFeel.Default); 
    } 
+0

Привет, Я работаю отлично, но как добавить этот предварительный просмотр в форму? – Srihari

+0

Как удалить или скрыть главное меню и панель инструментов из этого предварительного просмотра? – Srihari

+0

Установите 'control.MainToolbar.Visible = false;', чтобы скрыть основную панель инструментов .. –

Смежные вопросы