Object is not defined in current context

22 posts, 0 answers
  1. Aydın Kara
    Aydın Kara avatar
    40 posts
    Member since:
    May 2008

    Posted 27 May 2008 Link to this post

    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..
  2. Milen
    Admin
    Milen avatar
    163 posts

    Posted 28 May 2008 Link to this post

    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
  3. DevCraft banner
  4. ERic
    ERic avatar
    3 posts
    Member since:
    May 2008

    Posted 29 May 2008 Link to this post

    Hi Hasan

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

    Thanks
    Eric
  5. Aydın Kara
    Aydın Kara avatar
    40 posts
    Member since:
    May 2008

    Posted 05 Jun 2008 Link to this post

    Nope, not yet :(
  6. Steve
    Admin
    Steve avatar
    10941 posts

    Posted 05 Jun 2008 Link to this post

    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
  7. Aydın Kara
    Aydın Kara avatar
    40 posts
    Member since:
    May 2008

    Posted 06 Jun 2008 Link to this post

    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.
  8. Michael Josiah
    Michael Josiah avatar
    92 posts
    Member since:
    Nov 2007

    Posted 15 Jun 2008 Link to this post

    I am also having this problem. Has a solution been identified yet?
  9. Aydın Kara
    Aydın Kara avatar
    40 posts
    Member since:
    May 2008

    Posted 16 Jun 2008 Link to this post

    I resolved this problem by re-installing Q1 2008 (not SP1). But still it doesnt work with SP1.
  10. Svetoslav
    Admin
    Svetoslav avatar
    649 posts

    Posted 16 Jun 2008 Link to this post

    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
  11. Ernst Sognnes
    Ernst Sognnes avatar
    2 posts
    Member since:
    Jan 2006

    Posted 21 Nov 2008 Link to this post

    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
  12. Steve
    Admin
    Steve avatar
    10941 posts

    Posted 24 Nov 2008 Link to this post

    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.
  13. ilkruzn
    ilkruzn avatar
    4 posts
    Member since:
    Jul 2007

    Posted 24 Nov 2008 Link to this post

    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
  14. ilkruzn
    ilkruzn avatar
    4 posts
    Member since:
    Jul 2007

    Posted 24 Nov 2008 Link to this post

    Hi again,

    The answer I needed has arrived while I am typing the post. We are expecting to have a SP very soon :(
  15. Robert
    Robert avatar
    2 posts
    Member since:
    Jul 2008

    Posted 17 Feb 2009 Link to this post

    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.
  16. antoniodlp
    antoniodlp avatar
    19 posts
    Member since:
    Mar 2007

    Posted 26 Feb 2009 Link to this post

    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
  17. Steve
    Admin
    Steve avatar
    10941 posts

    Posted 27 Feb 2009 Link to this post

    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.
  18. antoniodlp
    antoniodlp avatar
    19 posts
    Member since:
    Mar 2007

    Posted 25 Mar 2009 Link to this post

    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


  19. antoniodlp
    antoniodlp avatar
    19 posts
    Member since:
    Mar 2007

    Posted 25 Mar 2009 Link to this post

    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
  20. Svetoslav
    Admin
    Svetoslav avatar
    649 posts

    Posted 25 Mar 2009 Link to this post

    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.
  21. Phil Borland
    Phil Borland avatar
    6 posts
    Member since:
    Jan 2006

    Posted 10 Oct 2011 Link to this post

    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)
  22. Edwin
    Edwin avatar
    6 posts
    Member since:
    Oct 2011

    Posted 03 Nov 2011 Link to this post

    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?
  23. Cristian
    Cristian  avatar
    46 posts
    Member since:
    May 2011

    Posted 10 Jan 2012 Link to this post

    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 ;
            }
        }
Back to Top
DevCraft banner