473,659 Members | 3,605 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

.net reportviewer

1 New Member
i am using reportviewer control. i want to change table name at runtime. i am using a stored prcedure with a parameter @tablename.

when i set the parameter as another thing code works. because i am designing the report, adding a table and assigning data columns. but when the tablename is variable i couldn't set the data columns. what should i do ?

this code works when parameter isn't tablename but when parameter is tablename setting object data source is problem

here is the code (show report button)

ReportViewer1.V isible = True

Dim MyConnection As New System.Data.Sql Client.SqlConne ction()
MyConnection.Co nnectionString = "Data Source=ssd-pc;Initial Catalog=kullani cilar;User ID=sa;Password= sapass"
MyConnection.Op en()

Dim MyCommand11 As New SqlCommand()
MyCommand11.Con nection = MyConnection
MyCommand11.Com mandType = Data.CommandTyp e.StoredProcedu re
MyCommand11.Com mandText = "deneme2"
Dim searchvalue As New SqlParameter("@ raporadi", Data.SqlDbType. NVarChar, 1000)
searchvalue.Val ue = TextBox1.Text
MyCommand11.Par ameters.Add(sea rchvalue)

Dim deneme As SqlDataAdapter = New SqlDataAdapter
deneme.TableMap pings.Add("Tabl e", TextBox1.Text)
deneme.SelectCo mmand = MyCommand11
Dim dataset1 As Data.DataSet = New Data.DataSet("d ataset1")

deneme.Fill(dat aset1)

Me.ReportViewer 1.LocalReport.R eportPath = "report.rdl c"
Me.ReportViewer 1.LocalReport.D ataSources.Clea r()

Me.ReportViewer 1.LocalReport.D ataSources.Add( New ReportDataSourc e("dataset2_den eme2", dataset1.Tables (0)))

Me.ReportViewer 1.LocalReport.R efresh()
Sep 28 '07 #1
0 992

Sign in to post your reply or Sign up for a free account.

Similar topics

2
9764
by: Fabio Pagano | last post by:
I was wondering why is there so little interest on the reportviewer control and the report designer integrated in VS 2005. It seems very cool and i think it can replace Crystal Reports. Moreover, it can be used locally (you give the filled dataset) or in conjunction with SqlServer Reporting Services. I am interested with local reports (not reporting services actually), here are two useful links about reportviewer: Microsoft web...
1
8542
by: Pieter | last post by:
Hi, In my application VB.NET 2005 application I placed a ReportViewer, and link it to a server-report: Me.ReportViewer1.ProcessingMode = Microsoft.Reporting.WinForms.ProcessingMode.Remote Me.ReportViewer1.ServerReport.ReportPath = "/myproject/DemandeDeCotation" Me.ReportViewer1.ServerReport.ReportServerUrl = New System.Uri("http://myserver/reportserver2005", System.UriKind.Absolute)
1
15860
by: steve | last post by:
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
4
4471
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 property as ReportViewer.Controls.Add.But its not working.Please help me. Regards, S.Sevugan.
1
17951
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 see any such thing. Where do I need to look to see this panel? So I have been trying to follow...
0
2005
by: Rich | last post by:
Hello, I started using the Reportviewer control (very nice) for generating Reporting Services type reports in my VB2005 app. I have been experimenting using a designer Reportviewer control from the toolbox - created at design time - (VB2005) and also creating a Reportviewer control at runtime on the fly. The runtime Reportviewer will populate/display data with a runtime dataAdapter, but the designer Reportviewer from the toolbox is...
0
1685
by: Fred G. Sanford | last post by:
Firstly, I am a fairly new .Net developer, so please excuse any dumb/ignorant questions or comments. Thanks. I created a VWD Express project, which uses the ReportViewer control, on my local machine. I had to download the ReportViewer control from MS and install it on my machine in order for this to work. I have the project working on my local machine, but I am running into some problems trying to deploy to another development server....
0
11595
by: billygotee | last post by:
Hi, I posted an issue previously that was entirely accurate. I have a master report called "MasterReport.rdlc" and a subreport called "Subreport.rdlc". MasterReport.rdlc has a single subreport with name Subreport and refers to Subreport.rdlc. I add a data source in the VS 2k5 report environment to Subreport.rdlc. This data source has name "SubreportInfo" and is an object of type SubreportInfo. First, say I set my...
10
3749
by: AG | last post by:
I am trying to use a ReportViewer control in a VS 2005 web application project (not Website project). When I try to create a new report (local), I can't seem to find any method to create a datasource. I would like to use an existing class object. The examples I have found state that the class should be in the App_Code folder. However a WAP does not have an App_Code folder. Is there any way to specify a datasource for a local report in a...
5
10338
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 clicked or a dropdown value being selected.
0
8428
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8337
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8851
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8748
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7359
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5650
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4175
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
1978
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1739
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.