Help on Report Viewer Title (VB2005)

L

Lemune

Hi again.

on my other post
http://groups.google.com/group/micr...56207bfd59b/405d197e4d3dc7fb#405d197e4d3dc7fb
(VB 2005 ReportViewer to change the chart title on runtime)

but now i want to make different approach, i don't want to change the
chart title (i don't think it can be done), i want to make report
title. I have done it in my previous project using vb 6.0 and crystal
report 6 ( i don't remember the crystal report version, because it on
my passed company in 2002 and i don't bring the data) and using
parameters.

My question is, Is report parameters in report (client report
definition (.rdlc) files ) on vb 2005 could do the same thing?
And if it could, how i do that?

Thanks for any useful information.
 
L

Lemune

For information, I have tried to create report parameter name="Title"

and in my viewer i add this code

Dim p As New ReportParameter("Title", "My Report Title")

Me.ReportViewer1.LocalReport.SetParameters(p)

and it get error message:
Unable to cast object of type
'Microsoft.Reporting.WinForms.ReportParameter' to type
'System.Collections.Generic.IEnumerable`1[Microsoft.Reporting.WinForms.ReportParameter]'.

on Me.ReportViewer1.LocalReport.SetParameters(p), what's wrong?
 
L

Lemune

Never mind, I found my own answer, here is the code that I used:

Dim reportParam As New ReportParameter("Title", "My Report Title")
Dim p as As ReportParameter = {reportParam}
Me.ReportViewer1.LocalReport.SetParameters(p)

Thanks all.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top