2
Answers

Display a Report from a selected grid Item

Peter Dzuya

Peter Dzuya

9y
385
1
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)