473,545 Members | 2,444 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.MembersTable Adapter.Fill(dt )

Me.ReportViewer 1.RefreshReport ()

This doesn't work

Regards
Steve
Jun 8 '06 #1
1 15851
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(disp layed 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(b oth 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 "ServerRepo rt" property's
certain sub properties and refresh the reportviewre. e.g.

=============
Private Sub btnTest_Click(B yVal sender As System.Object, ByVal e As
System.EventArg s) Handles btnTest.Click

Me.ReportViewer 1.ProcessingMod e =
Microsoft.Repor ting.WinForms.P rocessingMode.R emote

Me.ReportViewer 1.ServerReport. ReportServerUrl = New
Uri("http://localhost/ReportServer/")
Me.ReportViewer 1.ServerReport. ReportPath =
"/ReportProj1/GroupReport"
Me.ReportViewer 1.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 (ReportDataSour ce)
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_C lick(ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles btnClientTest.C lick

Me.ReportViewer 1.Reset()
Me.ReportViewer 1.ProcessingMod e =
Microsoft.Repor ting.WinForms.P rocessingMode.L ocal
Dim newds As New
Microsoft.Repor ting.WinForms.R eportDataSource ("NorthwindData Set1_Region")
newds.Value = Me.RegionBindin gSource

Me.ReportViewer 1.LocalReport.D ataSources.Add( newds)
Me.ReportViewer 1.LocalReport.R eportEmbeddedRe source =
"ClientReportAp p.Report2.rdlc"
Me.ReportViewer 1.RefreshReport ()

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

In the above example, the "RegionBindingS ource" is a pregenerated winform
BindingSource(c onfigured 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
3375
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 but no success! This generally happens when I am browsing the tree in Object explorer in SQL 2005 Management Studio. I can be doing anything -...
4
2631
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 DataSource... Any hints/help woudl be really appreciated,
1
4255
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 the project: report (report1.rdlc) - Dragged a textbox to the report design form. (Typed "test" in the box) - Dragged a ReportViewer object to the...
1
1342
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 certain assemblies listed in the <assemblies> section of the web.config file (Microsoft.Reportviewer.Common, Microsoft.Reportviewer.ProcessingObjectModel,...
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 place dropdown near to Export link ( Excel and PDF Export).Is it possible to add at the dropdown list with in report viewer control?. I found the...
1
17925
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 control. The help files state that in the form the contains the reportviewer control there is a tasks smart tags panel in design view. I don't...
3
2892
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 Intelligence development studio that works in that environment. I've uploaded the same report to both the Reporting services on my local computer...
3
3407
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 report (.rdl) to the ReportViewer! I have the ReportViewer.LocalReport.ReportPath set to the path of the .rdl report but the report still dosen't...
5
10327
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 I would like to add a checkbox or dropdown control to the .RLDC and have Item #1, Item #2, or Item #3 display conditionally based on a checkbox being...
0
7490
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7425
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7682
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7935
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7449
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6009
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5351
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5069
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
1
1911
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 we have to send another system

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.