Here is the print code:
private void Print()
{
System.Data.EntityClient.
EntityConnectionStringBuilder entCSB = new System.Data.EntityClient.EntityConnectionStringBuilder();
entCSB.ConnectionString =
App.CurrentApp.CurrentEnvironment.Connection;
Telerik.Reporting.
ReportBook book = new Telerik.Reporting.ReportBook();
foreach (OpenOnlineOrderDetails details in Transactions)
{
if (details.Selected)
{
book.Reports.Add(new OrderReport(entCSB.ProviderConnectionString, details.SaleTransactionID.ToString()));
}
}
AppView.Views.
ReportForm report = new LogiText.AppView.Views.ReportForm(book);
report.Show();
}
And this is the form with the report viewer:
public partial class ReportForm : Form
{
Telerik.Reporting.
ReportBook book;
public ReportForm(Telerik.Reporting.ReportBook reportBook)
{
InitializeComponent();
this.book = reportBook;
}
private void ReportForm_Load(object sender, EventArgs e)
{
reportViewer1.Report =
this.book;
reportViewer1.RefreshReport();
}
}