Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: VB.NET
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:
 
____________________________________________________
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...
 
____________________________________________________
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 9:19am
Edited 4-Sep-13 0:18am
v6
Comments
ThePhantomUpvoter at 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 at 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 at 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 at 3-Sep-13 0:49am
   
pls send your ideas sir..
Rate this: bad
good
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 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..
  Permalink  
v2
Rate this: bad
good
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
  Permalink  
Comments
RaviRethi at 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 at 3-Sep-13 4:57am
   
write in SystemReportFilterByID
RaviRethi at 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 at 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 at 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 / , 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 at 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 at 3-Sep-13 6:08am
   
Please try here.
 
http://technet.microsoft.com/en-us/library/cc281378.aspx
 
I think that is the same. Let me install SQL 2012 and check for you. I also prepare for new project.
RaviRethi at 3-Sep-13 6:10am
   
Sir i am using MS Access database.
Rate this: bad
good
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)
       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.Smile | :)
  Permalink  

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

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 6,745
1 OriginalGriff 6,696
2 CPallini 5,315
3 George Jonsson 3,599
4 Gihan Liyanage 2,650


Advertise | Privacy | Mobile
Web04 | 2.8.140922.1 | Last Updated 19 Sep 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