473,509 Members | 2,857 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

VB.net 2005 Reportviewer help

Hi All

I need help on how to manipulate the data returned from the database for
displaying in the new reportviewer at runtime

So far I have an rdlc file with a dataset, binding source and Tableadapter
as created by the wizard and all work fine

However I want to be able to change the displayed report at runtime when the
user selects a different report type from a combobox but am unsure how to do
this

dim sql as string = "select * from members order by surname"

dim dt as datatable = getdata(sql)

Me.MembersTableAdapter.Fill(dt)

Me.ReportViewer1.RefreshReport()

This doesn't work

Regards
Steve
Jun 8 '06 #1
1 15845
Hello Steve,

Welcome to the MSDN newsgroup.

From your description, I understand you're using the .NET 2.0's winform
ReportViewer control to display some client report(based on rdlc file) in
your winform application. However, since you have mulitple such rdlc
template and various datasources, you're wondering how dynamically change
the reportViewer's datasource(displayed data) and refresh it, correct? If
anything I've missed, please feel free to let me know.

Based on my research, the winform reportviewer control does support
programmatic datasource configuration(both server report or local report)
through its certain properties. And to dynamically update the report data,
you can:

1. For server report, you can simply change the "ServerReport" property's
certain sub properties and refresh the reportviewre. e.g.

=============
Private Sub btnTest_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnTest.Click

Me.ReportViewer1.ProcessingMode =
Microsoft.Reporting.WinForms.ProcessingMode.Remote

Me.ReportViewer1.ServerReport.ReportServerUrl = New
Uri("http://localhost/ReportServer/")
Me.ReportViewer1.ServerReport.ReportPath =
"/ReportProj1/GroupReport"
Me.ReportViewer1.RefreshReport()

End Sub
===============

2. As for LocalReport, which rely on a rdlc template (on file system or
embeded in assembly resource), it is more complex to rebind the datasource
comparing to ServerReport model. Actually, we need to reset the
reportViewer first, and then add the new datasoruce (ReportDataSource)
needed, and change the LocalReport's reportPath(or embededResource name).
After that, still refresh the ReportViewer control to see the update. e.g.

=========================
==========================
Private Sub btnClientTest_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnClientTest.Click

Me.ReportViewer1.Reset()
Me.ReportViewer1.ProcessingMode =
Microsoft.Reporting.WinForms.ProcessingMode.Local
Dim newds As New
Microsoft.Reporting.WinForms.ReportDataSource("Nor thwindDataSet1_Region")
newds.Value = Me.RegionBindingSource

Me.ReportViewer1.LocalReport.DataSources.Add(newds )
Me.ReportViewer1.LocalReport.ReportEmbeddedResourc e =
"ClientReportApp.Report2.rdlc"
Me.ReportViewer1.RefreshReport()

End Sub
========================

In the above example, the "RegionBindingSource" is a pregenerated winform
BindingSource(configured throug DataSet/DataAdapter pairt) in design-time.
Hope this helps. If there is any other problems you met, please feel free
to post here.

Regards,

Steven Cheng
Microsoft Online Community Support
==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)


Jun 9 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
3374
by: SQLJunkie | last post by:
Hi, I have installed SQL 2005 RTM on a new server and I keep getting this error (described below) quite frequently. Was wondering if anyone has a clue on what's happening here. I tried googling...
4
2627
by: Pieter | last post by:
Hi, Is it possible to use a Custom Class/Object as a DataSource/DataSet for a report? I have now for instance my object MyCompany, and it woudl be nice to just use a MyCompany-instance as the...
1
4251
by: Erik | last post by:
I'm trying to get the VS 2005 ReportViewer (not crystal reports) to work in a windows form application. This is my small test project: - Created a windows form application - Added new item to...
1
1339
by: iThinkData | last post by:
Should these 3 items, .Net 2.0 Website, SQLServer 2005, Reporting Services 2005. all reside on the same computer? I know that the website issues a configuration error saying it can't find...
4
4462
by: Sevu | last post by:
I am working with ASP.NET.I am using ReportViwer Control to show my report.I like to add dropdownlist with in the reportviewer control. ( Not top to the control some thing like that).I need to...
1
17923
by: Rich | last post by:
Hello, I am trying to use the Reportviewer control. I have been following an example from the web, and the instructions from the help files on set up a ..rdlc and binding it to the reportviewer...
3
2890
by: Blasting Cap | last post by:
I'm using VS 2005, SQL 2005 reporting services. SQL reporting services is working, and I have it both on my local computer, as well as on a server. I've created a report in the SQL Business...
3
3398
by: S_K | last post by:
Hi and thanks in advance for your help. I have a Reporting Services report that I need to display in an ASP.NET web page using the ReportViewer. However I can't link the Reporting Services...
5
10323
by: =?Utf-8?B?Y2hlY2tyYWlzZXJAY29tbXVuaXR5Lm5vc3BhbQ== | last post by:
I have a VS 2008 ASP.NET webform that has a reportview tag on it, accessing an .RLDC report in local report. The columns for the report are essentially: Month Item #1 Item#2 Item#3 ...
0
7234
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7344
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7412
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7505
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5652
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5060
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4730
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3203
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1570
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.