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

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

1 Answer 447 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
John
Top achievements
Rank 1
John asked on 30 Jun 2011, 09:46 PM
Hi Folks,
I have written a pixel precise (image overlay) report using Reporting Q1 2011 trial. So far so good. After reading the documentation, I decided to create a calculated field for a barcode control. I took an existing field and added some other characters to it. My report is very simple (structure wise) it has a Detail and a report Footer. The field that is using the calculated field is in the Detail section and it will render well in Preview mode (the field is assigned a value from a business object). BUT... when the application is rendered programmaticaly, it fails with "The expression contains object 'BarcodeValue' that is not defined in the current context."

I don`t understand why it works in preview and not when .RenderReport is called.

Thanks

-John

1 Answer, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 01 Jul 2011, 01:25 PM
Hi John,

Does the report show any data at all or the problem is only related to the calculated field? If there is no data,
this usually indicates that the connectionString is either incorrect or missing. When you bind a report to Data Source Component it asks you to save the connectionString in the app.config file of the report class library. However, when you run your actual application, the report would look for the connectionString in the config file of the application itself i.e. you should copy the connectionString from the app.config of the class library to the web.config (in case of web application project) or app.config (in case of windows forms/wpf app).

If this is not the problem, please open a support ticket and provide us with a sample project that exhibits the issue.

Kind regards,
Steve
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items
Tags
General Discussions
Asked by
John
Top achievements
Rank 1
Answers by
Steve
Telerik team
Share this question
or