private void frmReport_Load(object sender, EventArgs e)
{
this._reportViewer.Reset();
this._reportViewer.LocalReport.ReportPath = "LabelTemplate.rdlc";
_reportViewer.ProcessingMode = ProcessingMode.Local;
ReportDataSource dsSource = new ReportDataSource("ds", LabelModels);
this._reportViewer.LocalReport.DataSources.Clear();
this._reportViewer.LocalReport.DataSources.Add(dsSource);
this._reportViewer.ShowParameterPrompts = false;
this._reportViewer.RefreshReport();
this._reportViewer.RenderingComplete += new RenderingCompleteEventHandler(PrintLabelDirectly);
//}
}
public void PrintLabelDirectly(object sender, RenderingCompleteEventArgs e)
{
try
{
_reportViewer.PrintDialog();
_reportViewer.Clear();
_reportViewer.LocalReport.ReleaseSandboxAppDomain();
this.Close();
}
catch (Exception ex)
{
}
}