Click here to Skip to main content
12,758,782 members (37,368 online)
Rate this:
Please Sign up or sign in to vote.
See more: VB VB.NET
Hi All...
i am creating the report management system in, i am facing the new problem in my application,when i choice the client id, the particular client id Details only generate the RDLC report. i want like this

This is my Database Table:

ClientId | ClientName  | Amount  | BalanceAmount
1        | xxx         | 5000    | 4000
2        | yyy         | 2000    | 1000
3        | sss         | 3000    | 0
1        | xxx         | 5000    | 2000
1        | xxx         | 5000    | 1000

When i choice the ClientId 1 in my Windows application,the automatically
create a RDLC Report like below...

ClientId | ClientName  | Amount  | BalanceAmount
1        | xxx         | 5000    | 4000
1        | xxx         | 5000    | 2000
1        | xxx         | 5000    | 1000

Pls help me... Today is my project submission date,But Still not complete this module,so Send your ideas and codes..

i am try to many way but correct result is not coming
My code is below pls check it...
Posted 2-Sep-13 10:19am
Updated 4-Sep-13 1:18am
ThePhantomUpvoter 2-Sep-13 15:31pm
Well my idea you won't like too much. Don't wait so long to do your homework assignment next time.

What exactly have you tried to do for yourself? Where are you stuck? What errors do you get?
RaviRethi 2-Sep-13 15:40pm
Truly saying i am not touch this process, because i have no idea for how to do this.I am creating RDLC using parameter passing methods only,But in this Case is different, so only i am stuck this report Generating...
MohanGopi 3-Sep-13 0:46am
Your passing Data for RDLC Report as a DataTable or What?. If Source as a DataTable or BindingSouurce means i have a solution.
RaviRethi 3-Sep-13 0:49am
pls send your ideas sir..
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Please try this:

It is more simple than yours. Please add two reports like this:

AllSystemReport.rdl - The report will be display all records
SystemReportFilterByID - Parameter of Report

Step 1: (Do in SystemReportFilterbyID)
-> Change the query to Select * From [table name] where ClientID=@ClientID
-> parameter @ClientIDwill be generated in Parameter category
-> You run this report alone, you have type ClientID

Step 2 (Do in AllSystemReport)
righ click ClientID field
-> Text Box Properties.
-> choose action,
-> choose go to report,
-> specify a report : SystemReportFilterByID
-> Add parameter: Name: ClientID Value: ClientID

Now you run or preview order. You move mouse to ClientID and click. you will get the SystemReportFilterByID with ClientID
RaviRethi 3-Sep-13 4:54am
Sir pls Tel me Where i write the query "Select * From [table name] where ClientID=@ClientID"
In Form ? or SystemReportFilterByID..??
Anh Nguyen Trong 3-Sep-13 4:57am
write in SystemReportFilterByID
RaviRethi 3-Sep-13 5:16am
Sir where i write the query in SystemReportFilterByID.
i am creating the SystemReportFilterByID parameter in report,and right click the SystemReportFilterByID and go to parameter properties there are 3 tabs is display
(2)-Available Values
(3)-Default Values.

only this tabs are display i don't where i write the query in SystemReportFilterByID.

please tel sir where i put the query in SystemReportFilterByID.
Anh Nguyen Trong 3-Sep-13 5:24am
you go to DataSet. Right click in dataset and choose query. then you can change the query for that reports
Anh Nguyen Trong 3-Sep-13 5:47am
Or go here to change the query of report.

some copy

In the Configuration Manager console, navigate to System Center Configuration Manager / Site Database / Computer Management / Reporting / Reporting Services / <Report Server Name>, and expand the node.

Right-click a SQL Reporting Services report, and click Properties.

On the General tab of the Report Properties dialog box, you can specify a new name and description for the report. For more information, see Report Properties: General Tab.

On the Datasets tab of the Report Properties dialog box, you can view and edit the SQL code for the report. For more information, see Report Properties: Datasets Tab.
RaviRethi 3-Sep-13 5:57am
Sir I am using visual Studio 2012. so Query option is not in dataset. And i right click the dataset there are only one option is there,that is General, in this General only use for choose the dataset. So please tel me a another way to write the query in SystemReportFilterByID.
Anh Nguyen Trong 3-Sep-13 6:08am
Please try here.

I think that is the same. Let me install SQL 2012 and check for you. I also prepare for new project.
RaviRethi 3-Sep-13 6:10am
Sir i am using MS Access database.
Rate this: bad
Please Sign up or sign in to vote.

Solution 3

i solve this problem in simple way my code is below
Public Sub clientid()
       Dim sqlQRY As String
       Dim reportPath As String = "Company_Reckon_Invoice.Report4.rdlc" 'report viewer path
       Dim sReportDataSource As New ReportDataSource
       sqlQRY = "select invoiceid,Clientid,ClientName,Productname,(SUM(TotalAmount)-Sum(Amountpaid)) as BalanceAmount  from receipt where Clientid=" + TextBox1.Text + " GROUP BY invoiceid,Clientid,Clientname,Productname "
       ds = New DataSet
       clientidd = New OleDbDataAdapter(sqlQRY, conn)
       clientidd.Fill(ds, "receipt") ' receipt = database tabel name
       ReportViewer1.LocalReport.ReportEmbeddedResource = reportPath
       sReportDataSource.Name = "DataSet1" ' DataSet1=datasource name in report viewer
       sReportDataSource.Value = ds.Tables(0)
   End Sub

Just call the clientid in any where in your coding window.:)
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

I do this program myself but i got a error in
an error occurred during local report processing the definition of the report 'report1' has not been specified Object reference not set to an instance of an object

I don't know how to solve this problem pls help me: My windows Application code is below:

Imports System.Data.OleDb
Imports Microsoft.Reporting.WinForms
Public Class Form1
    Dim cn As New OleDbConnection("Provider=Microsoft.jet.oledb.4.0;data source=D:\Programs\sathish\invoicedb.mdb")
    Dim cmd As OleDbCommand
    Dim da As OleDbDataAdapter
    Dim ds As DataSet
    Dim sqlQRY As String = ""
    Dim reportPath As String = "Custom Based RDLC Report Generation.Report1.rdlc"
    Dim sReportDataSource As New ReportDataSource
    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load

            MsgBox("connected", MsgBoxStyle.Information)
            sqlQRY = "Select invoiceid,Clientid,Clientname,Productname,Totalamount,BalanceAmount from receipt"
        Catch ex As Exception
        End Try

    End Sub
    Sub viewreports()
        ds = New DataSet
        da = New OleDbDataAdapter(sqlQRY, cn)
        da.Fill(ds, "receipt")
        ReportViewer1.LocalReport.ReportEmbeddedResource = reportPath
        sReportDataSource.Name = "DataSet1"
        sReportDataSource.Value = ds.Tables(0)
    End Sub
    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        sqlQRY = "Select invoiceid,Clientid,Clientname,Productname,Totalamount,BalanceAmount from receipt where  Clientid=" & Val(TextBox1.Text)
    End Sub
End Class

pls send your ideas..

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

    Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170217.1 | Last Updated 19 Sep 2013
Copyright © CodeProject, 1999-2017
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