Community discussion forum

How to display the rows and columns generated by SQL query in rdlc report dynamically?

  • 11 months ago
    How to display the rows and columns generated by SQL query in rdlc report dynamically. I first created the .rdlc file and then add tables and then Column Names to display. Now i dont want to design the .rdlc file and i wanted to fill the .rdlc file with the number of columns and rows returned by SQL Server. Can anyone give me idea how to do it? I am using the code like this as shown below. Dim strQry = "select CompanyName,Address,Address1,City,State,Zip,Teleph one,Email from Company" Dim reportPath = "MyReportApplication.reportCompany.rdlc" Dim sReportDataSource As ReportDataSource Connection() OpenConn() ds = New DataSet() dataAdapter = New SqlDataAdapter(strQry, conn) dataAdapter.Fill(ds, "TestDataBase") rdlcViewer.LocalReport.ReportEmbeddedResource = reportPath sReportDataSource = New ReportDataSource() sReportDataSource.Name = "TestDB_Company" sReportDataSource.Value = ds.Tables(0) rdlcViewer.LocalReport.DataSources.Add(sReportData Source) rdlcViewer.Dock = DockStyle.Fill CloseConn() Me.rdlcViewer.RefreshReport()
    Post was edited on 16/12/2008 16:37:23 Report abuse

Post a reply

No one has replied yet! Why not be the first?

Sign in or Join us (it's free).

We'd love to hear what you think! Submit ideas or give us feedback