This is a migrated thread and some comments may be shown as answers.

Passing Runtime Parameters to report

1 Answer 172 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Siingh
Top achievements
Rank 2
Siingh asked on 15 Dec 2010, 01:37 AM
I have followed telerik video to pass the report parameters at runtime.
My VB Code in Web Application looks like as below::

Default.aspx.vb
Dim FullnameRpt As New ClassLibrary1.Fullname()
FullnameRpt.Param = tbWorkerId.Text
ReportViewer1.Report = FullnameRpt
ReportViewer1.RefreshReport()

Fullname.vb
Public Property Param() As String
Get
Return
SqlDataSource1.Parameters(0).Value.ToString
End
Get
Set(ByVal value As String
)
SqlDataSource1.Parameters(0).Value = value
End
Set
End
Property

This same report works fine at design time.
but doesnt not work at runtime at all,even if i pass the paramter value as default value.
It gives me error as follows:
An error has occurred while processing Report '':
Unable to establish a connection to the database. Please, verify that your connection string is valid. In case you use a named connection string from the application configuration file, make sure the name is correct and the connection string settings are present in the configuration file of your application.
------------- InnerException -------------
Format of the initialization string does not conform to specification starting at index 0.

1 Answer, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 15 Dec 2010, 09:51 AM
Hello Siingh,

The error message says it all - you should copy the connectingString from the class library app.config file to the config file of your actual application. In your case it is a web application, which means this is the web.config file.
In class library, the Report and Data Source Wizards save the selected connection string in the config file using the application settings which use full path i.e. MyClassLib.Properties.Settings.SiinghTest.

Best wishes,
Steve
the Telerik team
Get started with Telerik Reporting with numerous videos and detailed documentation.
Tags
General Discussions
Asked by
Siingh
Top achievements
Rank 2
Answers by
Steve
Telerik team
Share this question
or