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

Object is not defined in current context

21 Answers 1228 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Aydın Kara
Top achievements
Rank 1
Aydın Kara asked on 27 May 2008, 02:20 PM
Hi all,

I installed Reporting SP1, PageCount problem is solved. But after the installation other problems occured. When I run ReportViewer every textbox gives error message "#ERROR# The expression contains object '####' that is not defined in the current context. ". But the preview of report doesn't give any error. I'm usinf Business objects for datasource. I have a business object and a List class that is filled by that business objects. I try to rebind datasource to report but the result is same. It doesn't make sense that this error is occured after installation of SP1.
Do you have any advice?

Thanks..

21 Answers, 1 is accepted

Sort by
0
Milen | Product Manager @DX
Telerik team
answered on 28 May 2008, 02:31 PM
Hello Hasan ARSLAN,

There is a report in our examples called List Bound Report, that demonstrates how to use object datasource and it is working properly with the latest version of our product.

If your report works fine in Preview, I suppose that this behavior is caused by the code in your application that creates and provides data to the report.

In order to help you we need a sample project that reproduces the described issue. So please open a support ticket and send us a simple project with a report and viewer that we can examine and provide you assistance.

Thank you for your cooperation.

All the best,
Milen
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
ERic
Top achievements
Rank 1
answered on 29 May 2008, 07:08 AM
Hi Hasan

Did you have any luck in solving this issue? As i'm currently having the exact problem as well.

Thanks
Eric
0
Aydın Kara
Top achievements
Rank 1
answered on 05 Jun 2008, 02:26 PM
Nope, not yet :(
0
Steve
Telerik team
answered on 05 Jun 2008, 04:21 PM
Hi guys,

Unfortunately Hasan has not send a sample report and we have not been able to reproduce it locally. Eric would you be so kind, to open a support ticket and attach a zipped report that shows the issue you've encountered at hand? We would run it locally and advice you accordingly.

Thank you for the cooperation.

All the best,
Steve
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Aydın Kara
Top achievements
Rank 1
answered on 06 Jun 2008, 05:27 AM
I've opened a support ticket. I was trying some alternative. I've created a new project with different report and different business objects but unfortunately the result is same.
0
Michael Josiah
Top achievements
Rank 1
answered on 15 Jun 2008, 07:45 PM
I am also having this problem. Has a solution been identified yet?
0
Aydın Kara
Top achievements
Rank 1
answered on 16 Jun 2008, 06:44 AM
I resolved this problem by re-installing Q1 2008 (not SP1). But still it doesnt work with SP1.
0
Svetoslav
Telerik team
answered on 16 Jun 2008, 07:09 AM
Hi guys,

Most likely this problem is somewhat related to the specific culture settings of the computer running Telerik Reporting and/or the collation of the SQL Server database.

Anyway, up until now we cannot reproduce the same problem on our side, so we have no clue what is the actual reason. We will highly appreciate any additional information or even better - a sample project that illustrates the issue or steps to reproduce.

Thank you for the cooperation.

Kind regards,
Svetoslav
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Ernst Sognnes
Top achievements
Rank 1
answered on 21 Nov 2008, 03:47 PM
Hi,

i don't know whether this issue has been resolved, but I thought I'd share my experience with this eluding problem. My project is a ASP.NET 2.0 website, and I'm using the most recent version of Telerik.Reporting: 2008.31105 (which is 2008 Q3).

The report is retrieveing data via NeedDataSource event. It works in design-view / preview mode, but in production shows error messages "The expression contains object 'textbox' that is not defined in the current context." for all textboxes.

I am using MySql Connector.Net (most current version; 5.2.3), and thus also using MySqlDataAdapter to fill the dataset.

The problem, for me, was not related to culture or collation in the database / web application. It was simply because I had implemented my own custom session handler - for MySQL - which has been running without incident or other errors for my web project in all other regards. As soon as i disabled it and returned to default session handler in web.config - everything works fine!

Does ayone have thoughts on why this problem occurs in Reporting because of a custom session handler?


regards,
Ernst
0
Steve
Telerik team
answered on 24 Nov 2008, 07:55 AM
Hi Ernst,

We are aware of the problem and it caused when using StateServer/SqlServer session mode in the Q3 release. Our developers are investigating the problem and we should come up with a fix for one of the upcoming service packs.

Please excuse us for the inconvenience.

Sincerely yours,
Steve
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
ilkruzn
Top achievements
Rank 1
answered on 24 Nov 2008, 08:16 AM
Hi all,

I faced the same problem with my custom session state provider with the backing store Memcached or even with the StateServer provided by ASP.Net. I can reproduce the problem using Telerik.Reporting v2.9.8.1105(Q3 - 2008). The error given is: 

An error has occured while processing TextBox 'textBox1':
The expressioncontains object 'ItemName' that is not defined in the current context.


I read some entries in Telerik report forums, saying that it has some problems with report parameters when using "out of process session modes"  and they have fixed this in Q2 - SP2. In my situation, NeedDatasource event for Report is not being called when the app. session is not working InProc mode.

I can open a support ticket and upload a sample project to you, but it is very easy to reproduce for you and i don't want to waste my business hours trying to reproduce others problems. It is unacceptable for us to use the report tool until this issue is fixed.

--ilker
0
ilkruzn
Top achievements
Rank 1
answered on 24 Nov 2008, 08:19 AM
Hi again,

The answer I needed has arrived while I am typing the post. We are expecting to have a SP very soon :(
0
Robert
Top achievements
Rank 1
answered on 17 Feb 2009, 01:32 PM
In case it helps anyone in our situation using a out-of-proc session state in a database will cause the reports to fail with an unhandled global exception of "A list corresponding to the selected DataMember was not found" error.

This is directly related to using <sessionState> configuration when in SQLServer mode. At the time of writing this i'm using Q32008 RadReporting.
0
antoniodlp
Top achievements
Rank 2
answered on 27 Feb 2009, 03:42 AM
Hi,

I am using reporting in a Sharepoint custom application and unfortunately can't change the session state to be InProc. 

I would like to know if this bug will be fixed with the upcoming 2009 Q1 release. It doesn't say so in the roadmap.

If it's not, will 2008 Q2 work? Are there any known workarounds for this?

Could you please let us know as soon as possible as this is crucial to the development of out current project.

Thank you very much.

-Antonio
0
Steve
Telerik team
answered on 27 Feb 2009, 08:37 AM
Hello raindogmx,

Existing bugs are not added to our RoadMap - only new features are. Generally if you have a default contructor and make modifications to the report only in the report constructor, you should not experience any problems with out-proc session modes.
In Q1, there would be no such limitations, as we've changed the way this is handled.

All the best,
Steve
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
antoniodlp
Top achievements
Rank 2
answered on 25 Mar 2009, 09:33 AM
Hi,

I upgraded to Q1 2009 and using this for state management:

<sessionState mode="SQLServer" timeout="60" allowCustomSqlDatabase="true" partitionResolverType="Microsoft.Office.Server.Administration.SqlSessionStateResolver, Microsoft.Office.Server, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" /> 

Unfortunately receiving the "No parameterless constructor error"

Any advice?

Thank you

-Antonio


0
antoniodlp
Top achievements
Rank 2
answered on 25 Mar 2009, 10:38 AM
I got it working.

I used to load all the report parameters and data source from the report constructor.

Now I changed the constructor to a parameterless one and load the report parameters and data source from the report viewer page I made. I wanted to use the NeedDataSource event of the report but it doesn't seem to trigger it.

Now my only issue is how to get that NeedDataSource event fired but it is not a big deal now.

Regards,

Antonio
0
Svetoslav
Telerik team
answered on 25 Mar 2009, 12:38 PM
Hi Antonio,

The Report.NeedDataSource event is raised only if there is no data source set for the Report. For more information on the Report events please see Using Report Events help topic.

Sometimes one may need to use different data sources at design time and run time. If you have set the data source at design time you have to reset it at runtime to have the NeedDataSource event fired. Since the designer places all the initialization code inside the InitializeComponent() method the best place to reset the Report.DataSource property is at the end of the report's constructor like this:

public class MyReport1 : Telerik.Reporting.Report 
    public MyReport1() 
    { 
        InitializeComponent(); 
         
        // Reset the data source enable the NeedDataSource event: 
        this.DataSource = null
        // this.DataMember = string.Empty; 
    } 


Regards,
Svetoslav
the Telerik team

Check out Telerik Trainer , the state of the art learning tool for Telerik products.
0
Phil Borland
Top achievements
Rank 1
answered on 10 Oct 2011, 05:11 PM
I came accross this problem and it turned out to be a case sensitive issue.  Make sure the case of any of the offending strings in the designer.vb are exactly the same as the case of the thing you are using (query, parameter, etc etc).  This also effects vb.net (which normally isn't case sensitive)
0
Engineering
Top achievements
Rank 1
answered on 03 Nov 2011, 11:00 PM
I like to suggest providing some more information in the error description (like the statement that caused the problem). An error description like "The expression contains object "Value" that is not defined in the current context" leaves a lot to be desired. Could you give the expression or context or something useful?
0
Cristian
Top achievements
Rank 1
answered on 10 Jan 2012, 05:07 PM
Hi Guys,This is how Im binding my report and i get the same error.

Any Help?
Please

if (HttpContext.Current.Session["circuitos"] != null && HttpContext.Current.Session["RepPuesto"] == null)
{
    List<IQueryable> products = new List<IQueryable>();
    List<int> values = (List<int>)(HttpContext.Current.Session["circuitos"]);
    ListaMenores.Clear();
    Int32[] circs = {
                 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
                 23, 24, 25,
                 26, 27, 28, 29, 30, 31, 32
             };
    var Circuitos = values.Intersect(circs);
    foreach (var value in Circuitos)
    {
         
        IQueryable valorRetorno   =  (from r in contextoSIDRJF.Ratificacions
                                            from d in contextoSIDRJF.Documentoes
                                               from pr in contextoSIDRJF.ProxRatificar
                                               from jf in contextoSIDRJF.vw_JuzgadoresFederales
                                               where
                                                   r.fiIdExpJuzgador == jf.exp && pr.fiExpJuzgador == r.fiIdExpJuzgador &&
                                                   r.fiStatus == 3
                                                   && d.fiIdRatificacion == r.fiIdRatificacion && d.fiIdTpoDocto == 5 &&
                                                   (d.fdFchSesionDicRat >= fecha && d.fdFchSesionDicRat <= fecha2) &&
                                                   jf.Circuito == value
                                               orderby jf.Circuito
                                               select new
                                                          {
                                                              r.fiIdExpJuzgador,
                                                              jf.nombre_completo,
                                                              jf.nom_pue,
                                                              jf.Circuito,
                                                              d.fdFchSesionDicRat
                                                              //d.fdFchSesionDicRat
                       
                                                            
                                                      });
        
    products.Add(valorRetorno);
// ListaMenores.Add(valorRetorno);
         
     
        if (Circuitos.Last() == value)
        {
  
            Report.DataSource =products ;
        }
    }
Tags
General Discussions
Asked by
Aydın Kara
Top achievements
Rank 1
Answers by
Milen | Product Manager @DX
Telerik team
ERic
Top achievements
Rank 1
Aydın Kara
Top achievements
Rank 1
Steve
Telerik team
Michael Josiah
Top achievements
Rank 1
Svetoslav
Telerik team
Ernst Sognnes
Top achievements
Rank 1
ilkruzn
Top achievements
Rank 1
Robert
Top achievements
Rank 1
antoniodlp
Top achievements
Rank 2
Phil Borland
Top achievements
Rank 1
Engineering
Top achievements
Rank 1
Cristian
Top achievements
Rank 1
Share this question
or