Peter Dzuya

Peter Dzuya

  • NA
  • 313
  • 40.8k

Display a Report from a selected grid Item

Sep 24 2015 7:35 AM
Hi everyone, 
I have  a grid which the User can select an Invoice Item to view.
 
I have the code below which returns an empty report. Thanks.
 
 
try {
var selectedinvoice = InvoiceView.GetFocusedRow() as Invoice;
if (selectedinvoice == null) return;
rptInvoice InvoiceChoice = new rptInvoice();
InvoiceChoice.DataSource = _invoiceTransactionService.GetById(selectedinvoice.InvoiceId);
ReportPrintTool tool = new ReportPrintTool(InvoiceChoice);
tool.ShowPreview();
} catch (Exception Errhand) {
MessageBox.Show(Errhand.Message);
}

Answers (2)