473,396 Members | 2,052 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Data Source with ReportViewer

Hy, i read the article in msdn2

Using a Database Data Source with the ReportViewer Windows Forms Control in
Local Processing Mode

But i don want to use the designer assosation to the report,
i want to define by code (at run time) the report and the
data source to be display.

example :

i have two table on sqlclient db file (anagrafica and pratica)
and i have two report (rpt_anagrafica.rdlc and rpt_pratica.rdlc)

in a form a have two button, one for visualize the first repor (whit his
data anagrafica) and
one to visualize the second report (whit his data pratica) ,
when run the application i want to decide what report to be visualize.

for this i don't now what is the metod
have yuo any example ?

I hope explain correctly (sorry for my english) thank's.
Mar 23 '06 #1
3 7147
Hi,

I don't know if I understood your suestion very good, but I thought you
wanted to chose at runtime the report to show? I'm using myself a solution
like this: One form, that contains one reportviewer, and I'm using the same
to show all my reports (based on a parameter).

This is my code:

'This comes in the form-load
Me.rpvwReport.ProcessingMode =
Microsoft.Reporting.WinForms.ProcessingMode.Remote
'"ReportServerUrl"="http://MyServer/reportserver2005"
Me.rpvwReport.ServerReport.ReportServerUrl = New
System.Uri(System.Configuration.ConfigurationManag er.AppSettings.Get("ReportServerUrl"),
System.UriKind.Absolute)
'method to show a given report (defines buy my variabel Me.m_ReportType)
Public Overridable Sub Fill()
Dim colPrm As New Generic.List(Of ReportParameter)
Dim prm As ReportParameter
Dim clsRep As clsReport = Nothing

Try
Select Case Me.m_ReportType 'select which report to show
(currently only one)
Case enumReportType.RepDemandeDeCotation
'charge le rapport de la DemandeDeCotation
clsRep =
clsWorkSpace.MyWorkSpace.GetReportFromReportName(" DemandeDeCotation")
prm = New ReportParameter("intCotationID",
Me.m_Document.PrimaryKey)
colPrm.Add(prm)
prm = New ReportParameter("intPersonneID",
Me.cmbResponsable.SelectedValue.ToString)
colPrm.Add(prm)
End Select
'52RE6_001.pdf"
Catch ex As Exception
ErrorMessage(ex, "Select Case Me.m_ReportType")
End Try

Try
If clsRep Is Nothing Then
'problem
MessageBox.Show("Le rapport ne peut pas être trouvé sur le
serveur.", "Pas de rapport", MessageBoxButtons.OK, MessageBoxIcon.Error)
Else
Me.rpvwReport.ServerReport.ReportPath = clsRep.ReportPath
Me.rpvwReport.ServerReport.SetParameters(colPrm)
Me.rpvwReport.RefreshReport()
End If
Catch ex As Exception
ErrorMessage(ex, "SetParameters")
End Try

Me.HasLoaded = True
End Sub

"Xpeppe" <xp****@libero.it> wrote in message
news:a9********************@twister2.libero.it...
Hy, i read the article in msdn2

Using a Database Data Source with the ReportViewer Windows Forms Control
in Local Processing Mode

But i don want to use the designer assosation to the report,
i want to define by code (at run time) the report and the
data source to be display.

example :

i have two table on sqlclient db file (anagrafica and pratica)
and i have two report (rpt_anagrafica.rdlc and rpt_pratica.rdlc)

in a form a have two button, one for visualize the first repor (whit his
data anagrafica) and
one to visualize the second report (whit his data pratica) ,
when run the application i want to decide what report to be visualize.

for this i don't now what is the metod
have yuo any example ?

I hope explain correctly (sorry for my english) thank's.

Mar 23 '06 #2
Pieter,

Ben jij een Waal/van Brussel?

Maybe did you it earlier that I did not see it, otherwise,

Nice to see you starting anwering here questions.

:-)

Cor

"Pieter" <pi**********@hotmail.com> schreef in bericht
news:ud**************@TK2MSFTNGP12.phx.gbl...
Hi,

I don't know if I understood your suestion very good, but I thought you
wanted to chose at runtime the report to show? I'm using myself a solution
like this: One form, that contains one reportviewer, and I'm using the
same to show all my reports (based on a parameter).

This is my code:

'This comes in the form-load
Me.rpvwReport.ProcessingMode =
Microsoft.Reporting.WinForms.ProcessingMode.Remote
'"ReportServerUrl"="http://MyServer/reportserver2005"
Me.rpvwReport.ServerReport.ReportServerUrl = New
System.Uri(System.Configuration.ConfigurationManag er.AppSettings.Get("ReportServerUrl"),
System.UriKind.Absolute)
'method to show a given report (defines buy my variabel Me.m_ReportType)
Public Overridable Sub Fill()
Dim colPrm As New Generic.List(Of ReportParameter)
Dim prm As ReportParameter
Dim clsRep As clsReport = Nothing

Try
Select Case Me.m_ReportType 'select which report to show
(currently only one)
Case enumReportType.RepDemandeDeCotation
'charge le rapport de la DemandeDeCotation
clsRep =
clsWorkSpace.MyWorkSpace.GetReportFromReportName(" DemandeDeCotation")
prm = New ReportParameter("intCotationID",
Me.m_Document.PrimaryKey)
colPrm.Add(prm)
prm = New ReportParameter("intPersonneID",
Me.cmbResponsable.SelectedValue.ToString)
colPrm.Add(prm)
End Select
'52RE6_001.pdf"
Catch ex As Exception
ErrorMessage(ex, "Select Case Me.m_ReportType")
End Try

Try
If clsRep Is Nothing Then
'problem
MessageBox.Show("Le rapport ne peut pas être trouvé sur le
serveur.", "Pas de rapport", MessageBoxButtons.OK, MessageBoxIcon.Error)
Else
Me.rpvwReport.ServerReport.ReportPath = clsRep.ReportPath
Me.rpvwReport.ServerReport.SetParameters(colPrm)
Me.rpvwReport.RefreshReport()
End If
Catch ex As Exception
ErrorMessage(ex, "SetParameters")
End Try

Me.HasLoaded = True
End Sub

"Xpeppe" <xp****@libero.it> wrote in message
news:a9********************@twister2.libero.it...
Hy, i read the article in msdn2

Using a Database Data Source with the ReportViewer Windows Forms Control
in Local Processing Mode

But i don want to use the designer assosation to the report,
i want to define by code (at run time) the report and the
data source to be display.

example :

i have two table on sqlclient db file (anagrafica and pratica)
and i have two report (rpt_anagrafica.rdlc and rpt_pratica.rdlc)

in a form a have two button, one for visualize the first repor (whit his
data anagrafica) and
one to visualize the second report (whit his data pratica) ,
when run the application i want to decide what report to be visualize.

for this i don't now what is the metod
have yuo any example ?

I hope explain correctly (sorry for my english) thank's.


Mar 23 '06 #3
"Cor Ligthert [MVP]" <no************@planet.nl> wrote in message
news:O8**************@tk2msftngp13.phx.gbl...
Pieter,

Ben jij een Waal/van Brussel?
Hi Cor,
Actually I'm from Gent, so I'm a Vlaming :-) But I do work for a
French-speaking Belgium/French Company, with parts in Africa. So the
official language in the company is French :-) I know I sometimes post
French comments in my code, or use French names. My apologizes, hehe. I'd
rather prefer too that Dutch was the offical world-language ;-)
Maybe did you it earlier that I did not see it, otherwise,

Nice to see you starting anwering here questions.

I did alreaddy answer a lot of questions before, but only if I do have some
real experience in the domain, and off course only when I know the answer,
hehe. I have to admit that I could answer a lot more questions, but most of
the time somebody else (like you) did it alreaddy before I see them :-)
:-)

Cor

Mar 23 '06 #4

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

Similar topics

2
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,...
4
by: Ryan | last post by:
I'm trying to create a report (similar to access) in VB 2005. It appears that Crystal Reports is the recommended method. I created a Crystal Report, set up the data connection (using the Wizard...
1
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...
0
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...
3
by: KimberlyLord | last post by:
I have created a report and subreport in VB/ASP.NET. The report works fine but the subreport will not display. The subreport, when displayed as a standalone report, works fine. But when viewed as a...
0
by: NaveenDuggal | last post by:
Hi All I have designed a rdlc file, using Business Object and table control, and added it on Report Viewer control. I am facing the excepiton Exception descritption: A data source instance has...
0
by: faisalmushtaq | last post by:
Hello to all brains, i am relativly new to this programming world and i need tons of favor from u guys.My problem i want to use a dataset's table as my report source.Report also takes some other...
8
by: Brock | last post by:
I am trying to populate a Crystal Report from data in my DataGrid. The reason for this is that I want the user to be able to change values without updating the database, but still have their report...
1
by: gandhi.vishal | last post by:
Hello, I have an issue. I'm not seeing the reportviewer data at all. The column names come up fine but there is no data in the report table. Here is what I'm doing I created a dataset with the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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...
0
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...
0
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...

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.