Click here to Skip to main content
15,905,504 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello everyone
My name is Sarfaraz and I am presently working on a project which is almost complete except that I need to print some reports based on a criteria.
I want to display all the records of a customer from purchases table by entering his customer No in a text box and after clicking a button should display a report based on that account number.
I have designed a report and i tried something like

<br />
Imports Microsoft.Reporting.WinForms<br />
    Private Sub btnload_Click(sender As Object, e As EventArgs) Handles btnload.Click<br />
        setFilterparameters()<br />
    End Sub<br />
    Private Sub setFilterparameters()<br />
        Me.purchasesTableAdapter.Fill(Me.DSPurchases.purchases)<br />
        Dim account As New ReportParameter("account", acno.Text)<br />
        ReportViewer1.LocalReport.SetParameters(New ReportParameter() {account})<br />
        ReportViewer1.RefreshReport()<br />
<br />
    End Sub<br />

But it actually display account number of all the records what i have typed in the textbox and display all the records on the report.
Please help in this regard.
Thank you
Posted
Comments
DamithSL 4-Jan-15 10:08am    
have you added account parameter in your rdlc report and have you use it to filter data in your data source?
sarfarazbhat 4-Jan-15 10:42am    
Yes from the report Data i added a parameter with data type integer because account number is a number in access and then assign it to the ac_no in rdlc report and in the data set there is a query fill,getdata which displays all the records if i try like

SELECT bill_no AS Expr1, ac_no AS Expr2, items AS Expr3, length AS Expr4, breadth AS Expr5, amount AS Expr6, dated AS Expr7, bill_no, ac_no, items, length, breadth,
amount, dated
FROM purchases
WHERE (ac_no = ?)

still the code is not working.
Any idea sir
Thank you

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900