TRDX Report Fails with Object is not defined in the current context when fields are available in SQL Stored Procedures

1 Answer 8 Views
Report Designer - Web
Adil
Top achievements
Rank 1
Iron
Iron
Veteran
Adil asked on 05 Dec 2025, 08:46 AM

Hello,

I have a TRDX report where the data comes from SQL stored procedures.
The report works successfully at runtime, and the data is returned correctly by the stored procedures.

However, in the Telerik Report Designer, I get errors like:

Object 'XXX' is not defined in the current context

=Fields.SomeField
=Fields.OtherField

So we are in a situation where:

  • SQL returns the fields correctly

  • The application renders the report correctly

  • But the Designer does not recognize the fields

  • And shows “not defined” errors during design time


What I understand

It looks like the Designer cannot infer the field schema from stored procedures unless they return static metadata.


Question

What is the recommended/best practice way to expose stored procedure output fields to the Designer so we avoid the “Object not defined” errors?

For example:

  • Should we add dummy SELECT statements for metadata?

  • Is there a supported/recommended pattern for TRDX reports using stored procedures?

  • Is there another way to force the Designer to read schema?

  • Important Note

    I am not asking about runtime behavior (which works).
    My issue is purely about design-time schema detection.

1 Answer, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 09 Dec 2025, 02:04 PM

Hello Adil,

Thank you for the attached screenshot and the additional information!

We already discussed this case in a private ticket, but let me share with the community as well what may have been causing those issues.

Let me start by mentioning that this is a runtime issue rather than a design one, despite it occurring within the Standalone Report Designer. The report designer itself also has two modes/states - Design & Preview.  The red rectangle errors appear only at runtime when the report is being previewed(the preview of the designer renders the report to images and displays them).

In the ticket, Adil shared a report whose connection string for the SqlDataSource components was changing dynamically. This is the most likely reason for the report to fail in the designer, but work in the production environment, as a different connection string means that another database may be used, and the stored procedure there may be different as well.

I hope that this information is helpful to other users who have a similar scenario and encounter issues like this one.

Regards,
Dimitar
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
Report Designer - Web
Asked by
Adil
Top achievements
Rank 1
Iron
Iron
Veteran
Answers by
Dimitar
Telerik team
Share this question
or