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

Stored Procedure call: The expression contains object 'myobject' that is not defined in the current context

3 Answers 614 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Kirivarnan
Top achievements
Rank 1
Kirivarnan asked on 04 Nov 2015, 01:53 AM

Hi, 

I'm very new to telerik reporting. Please check my issue below. 

I have created a telerik report using designer. This report calls stored procedure to retrieve the data and binds to chart. 

I'm getting following error message when I generate the report via report viewer. 

      "The expression contains object 'dtScan' that is not defined in the current context". 

I have already added all required report parameters (input parameters). Actually this 'dtScan' is not an input parameter. It is a one of the data table field and using inside my stored procedure. I'm sure that there is no issue on my stored procedure. It is working perfectly when I design the report (means that when I set stored procedure to report via design wizard).

As I mentioned, I'm getting this error message when I generate report via report viewer and as well as preview window (please see the attached images).

 Please looking forward your help to solve this issue. 

 Thanks!

3 Answers, 1 is accepted

Sort by
0
Accepted
Kirivarnan
Top achievements
Rank 1
answered on 04 Nov 2015, 07:51 AM

Finally, I managed to understand the problem. It because of 'temp' table. 

Please refer ​this link http://www.telerik.com/forums/temporary-table-in-stored-proc​

Hope this helps others!

0
Kirivarnan
Top achievements
Rank 1
answered on 05 Nov 2015, 02:23 AM
Sorry, It is not working. still I couldn't able to fix this problem....
0
Stef
Telerik team
answered on 06 Nov 2015, 02:52 PM
Hi Kirivarnan,

The error indicates you are using a field dtScan, which is not available in the Graph item's DataSource fields.


If the stored procedure uses temporary tables, you will need to add a setting allowing the SqlDataSource to retrieve the data schema - How to configure Stored Procedure with Temporary Tables for use with SqlDataSource component.

This will allow available fields to be loaded in the Data Explorer and used in expressions. Note that a field is available only in the scope defined by the item bound to the corresponding data source component - Expression scope. By suing the ReportItem.DataObject in expression you can get fields of parent data scope - How to use the ReportItem.DataObject property in expressions.


I hope this information is helpful.

Regards,
Stef
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
General Discussions
Asked by
Kirivarnan
Top achievements
Rank 1
Answers by
Kirivarnan
Top achievements
Rank 1
Stef
Telerik team
Share this question
or