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

Data source parameter issue

2 Answers 67 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Geoff
Top achievements
Rank 1
Geoff asked on 01 Mar 2015, 03:19 PM
Hi there,

Bit of a strange one....

We have a very simple report - that runs as expected via the preview option in Visual Studio - that has one data source parameter.

The report library is a class project that we then access from our .NET application.

The problem is when we try to generate the report from the application the parameter is working weirdly.

For some reason the stored procedure is called twice - checked by adding logging to the SP.

First time the parameter is passed, second time a null value is passed. Result is always no data being returned.

Simplified code to generate report shown below...

Dim report_1l As CSA_Testing.Competitive_Tendering = New CSA_Testing.Competitive_Tendering
Dim ds1l As Telerik.Reporting.SqlDataSource = New Telerik.Reporting.SqlDataSource()

ds1l.ConnectionString = ConfigurationManager.ConnectionStrings("CSA_Testing.My.MySettings.CSA").ConnectionString
ds1l.SelectCommand = "RepGen_CT_By_CustomerID"
ds1l.SelectCommandType = SqlDataSourceCommandType.StoredProcedure
ds1l.Parameters.Add("@CustomerID", System.Data.DbType.Int32, 400045)

report_1l.DataSource = ds1l

Dim instanceReportSource As New Telerik.Reporting.InstanceReportSource
instanceReportSource.ReportDocument = report_1l

rv1.ReportSource = instanceReportSource

Has anybody come across this before or have any ideas why it would happen?

We have an older report libray running off earlier Telerik.Report versions that all work fine.

Now we have updated to the lateset versions and tried to create some new reports we always get this issue.

FYI: Visual Studio 2013 / SQL 2012 / Latest Telerik vestions.

Thanks in advance


2 Answers, 1 is accepted

Sort by
0
Nasko
Telerik team
answered on 04 Mar 2015, 08:15 AM
Hello Geoff,

We tested the described behavior locally with the latest version of Telerik Reporting (9.0.15.225) and the AdventureWorks sample database. However, we weren't able to reproduce the issue, as you can see in this screenshot and in the attached sample project.
In order to advise further we will need additional information about the issue and your project/report setup.

Regards,
Nasko
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Geoff
Top achievements
Rank 1
answered on 04 Mar 2015, 11:45 AM
Many thanks Nasko

On comparing our project to yours we noticed there was a problem with our web.config file.

Silly mistake by us but problem sorted.

Thanks for your help.

All the best

Geoff
Tags
General Discussions
Asked by
Geoff
Top achievements
Rank 1
Answers by
Nasko
Telerik team
Geoff
Top achievements
Rank 1
Share this question
or