Click here to Skip to main content
15,878,748 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All...
i am creating the report management system in vb.net, 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:

VB
____________________________________________________
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 VB.net Windows application,the automatically
create a RDLC Report like below...

VB
____________________________________________________
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
Updated 4-Sep-13 0:18am
v6
Comments
[no name] 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?
sv sathish 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...
Mohan Gopi 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.
sv sathish 3-Sep-13 0:49am    
pls send your ideas sir..

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
 
Share this answer
 
Comments
sv sathish 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
sv sathish 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
(1)-General
(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.

http://technet.microsoft.com/en-us/library/cc512027.aspx

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.
i solve this problem in simple way my code is below
VB
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)
       ReportViewer1.LocalReport.DataSources.Clear()
       ReportViewer1.LocalReport.DataSources.Add(sReportDataSource)
       Me.ReportViewer1.RefreshReport()
   End Sub


Just call the clientid in any where in your coding window.:)
 
Share this answer
 
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 VB.net 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

        Try
            cn.Open()
            MsgBox("connected", MsgBoxStyle.Information)
            sqlQRY = "Select invoiceid,Clientid,Clientname,Productname,Totalamount,BalanceAmount from receipt"
            viewreports()
        Catch ex As Exception
            MsgBox(ex.Message.ToString)
        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)
        ReportViewer1.LocalReport.DataSources.Add(sReportDataSource)
        Me.ReportViewer1.RefreshReport()
    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)
        viewreports()
    End Sub
End Class



pls send your ideas..
 
Share this answer
 
v2

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