Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
Hello eveyrone
I am working on a project in visual studio 2012 with sqlserver backend.
I am creating a Report which is working fine with selecting all the data from the database table, but when i want to select records based on invoice no it generates an error in the Formula.
the error is "A NUMBER IS REQUIRED HERE......"
 
The code I am using is
<pre lang="c#">
 Pending_order_Report por = new Pending_order_Report();
                rptsales rpt = new rptsales();
                suntechagribusinessDataSet ds1 = new suntechagribusinessDataSet();
                salesTableAdapter.Fill(ds1.sales);
                sale_detailsTableAdapter.Fill(ds1.sale_details);
                rpt.SetDataSource(ds1);
                por.crystalReportViewer1.ReportSource = rpt;
                por.crystalReportViewer1.SelectionFormula = "{sales.invoice_no}='" +   
                listView1.SelectedItems[0].SubItems[1].Text + "'";
                por.Show();
Pending_Order_report is the form on which i place the Crystal report viewer, invoice number is a column in sale table in the database.
The Above I place on a context menu on the Listview. the Formula Line select listview subitems[1] which is Invoice Number but it generates an error that A NUMBER IS REQUIRED HERE..
Any help will be Appreciated..
Thanks in Advance
Posted 27-May-13 7:25am
Edited 27-May-13 7:26am
v2
Comments
ThePhantomUpvoter at 27-May-13 12:27pm
   
Is "sales.invoice_no" an int or a string?
Rajan Adhikari at 30-May-13 5:47am
   
i think you have {sales.invoice_no} as integer and listView1.SelectedItems[0].SubItems[1].Text is text so the problem occur .change data type of sales.invoice_no and test

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



Advertise | Privacy | Mobile
Web02 | 2.8.1411022.1 | Last Updated 20 Oct 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100