I am using a demo of the reporting software but I am having issues understanding parameters I have set up the parameter Invoice_Number on the report parameters screenshot as per image 1.1. On My menu click of my I have a report viewer with the report with the .
private void invoiceToolStripMenuItem_Click(object sender, EventArgs e)
{
Job job = jobsList.GetSelectedItem<
Job
>();
if (job != null)
{
InvoiceReports INV = new InvoiceReports();
INV.ReportParameters["Invoice_Number"].Value =job.InvoiceNumbers;
InvoiceViewer _invViewer = new InvoiceViewer();
_invViewer.Invoice_Number =job.InvoiceNumbers;
_invViewer.ShowDialog();
//var sageInvoiceCoordinator = new SageInvoiceCoordinator();
// sageInvoiceCoordinator.Print(job.ID);
}
}
In my invoice viewer have the following which is setting the invoice itself.
public string Invoice_Number { get; set; }
public InvoiceViewer()
{
InitializeComponent();
}
private void InvoiceViewer_Load(object sender, EventArgs e)
{
var report = new InvoiceReports();
report.ReportParameters["Invoice_Number"].Value = Invoice_Number.ToString();
// Use the InstanceReportSource to pass the report to the viewer for displaying
var reportSource = new Telerik.Reporting.InstanceReportSource();
// reportSource.Parameters.Add(new Telerik.Reporting.Parameter("Invoice_Number", 3));
reportSource.ReportDocument = report;
// Assigning the report to the report viewer.
reportViewer1.ReportSource = reportSource;
// Calling the RefreshReport method in case this is a WinForms application.
reportViewer1.RefreshReport();
}
}
And as you can see below I added it to my data connection. really at a loss as to what am doing wrong
SELECT
INVOICE.INVOICE_TYPE, INVOICE.INVOICE_OR_CREDIT, INVOICE.ACCOUNT_REF, INVOICE.
NAME
, INVOICE.ADDRESS_1, INVOICE.ADDRESS_2, INVOICE.ADDRESS_4, INVOICE.ADDRESS_5, INVOICE.ADDRESS_3,
INVOICE.C_ADDRESS_1, INVOICE.C_ADDRESS_2, INVOICE.C_ADDRESS_3, INVOICE.C_ADDRESS_4, INVOICE.C_ADDRESS_5, INVOICE.DEL_NAME, INVOICE.DEL_ADDRESS_1, INVOICE.DEL_ADDRESS_3,
INVOICE.DEL_ADDRESS_2, INVOICE.DEL_ADDRESS_5, INVOICE.DEL_ADDRESS_4, INVOICE.ORDER_NUMBER, INVOICE.CONTACT_NAME, INVOICE.ORDER_NUMBER_NUMERIC, INVOICE.CUST_ORDER_NUMBER,
INVOICE.CUST_TEL_NUMBER, INVOICE.NOTES_1, INVOICE.NOTES_2, INVOICE.NOTES_3, INVOICE.FOREIGN_ITEMS_GROSS, INVOICE.FOREIGN_ITEMS_TAX, INVOICE.FOREIGN_ITEMS_NET, INVOICE_ITEM.ITEM_NUMBER,
INVOICE_ITEM.JOB_NUMBER, INVOICE_ITEM.SERVICE_FLAG, INVOICE_ITEM.DESCRIPTION, INVOICE_ITEM.TEXT, INVOICE_ITEM.STOCK_CODE, INVOICE_ITEM.COMMENT_1, INVOICE_ITEM.COMMENT_2,
INVOICE_ITEM.FOREIGN_UNIT_PRICE, INVOICE_ITEM.FOREIGN_DISCOUNT_AMOUNT, INVOICE_ITEM.TAX_RATE, INVOICE.INVOICE_NUMBER, INVOICE.INVOICE_TYPE_CODE, COMPANY.L_NAME, COMPANY.L_ADDRESS_1,
COMPANY.L_ADDRESS_2, COMPANY.L_ADDRESS_3, COMPANY.L_ADDRESS_4, COMPANY.L_ADDRESS_5, COMPANY.TELEPHONE, COMPANY.FAX, COMPANY.E_MAIL, COMPANY.DEL_TELEPHONE, COMPANY.DEL_FAX,
COMPANY.DEL_E_MAIL, COMPANY.VAT_REG_NUMBER, COMPANY.
NAME
AS
Expr1, INVOICE.INVOICE_DATE, INVOICE_ITEM.FOREIGN_FULL_NET_AMOUNT, INVOICE_ITEM.FOREIGN_NET_AMOUNT,
INVOICE_ITEM.FOREIGN_TAX_AMOUNT, INVOICE_ITEM.FOREIGN_GROSS_AMOUNT, INVOICE.FOREIGN_INVOICE_GROSS, INVOICE.FOREIGN_INVOICE_NET, INVOICE.CURRENCY_TYPE, INVOICE.CURRENCY,
INVOICE.FOREIGN_AMOUNT_PREPAID, INVOICE.ANALYSIS_1
FROM
INVOICE, INVOICE_ITEM, COMPANY
WHERE
INVOICE.INVOICE_NUMBER = INVOICE_ITEM.INVOICE_NUMBER
AND
(INVOICE.INVOICE_NUMBER = @INVOICE_NUMBER)
Any Ideas