Sub report datasources are interacting?

13 posts, 0 answers
  1. Clive
    Clive avatar
    2 posts
    Member since:
    Jul 2012

    Posted 30 Nov 2010 Link to this post

    I am trying to set up multiple sub reports within an unbound main report.  Each has its own sqldatasource connecting to MS Access tables.  Individually the subreports work fine.  Placing each one individually into the main report they work fine but if I put both in, one of them does and one of them doesn't - I get the  'An error has occurred while processing TextBox 'dateDataTextBox':
    The expression contains object 'CalDate' that is not defined in the current context.'  error.

    Here is the weird bit - I tried this with two subreports that, by chance, have the same field name (completely different source tables though).  And the report with the error showed the field value from the other report.  In other words one report is looking at the other's datasource.  The datasources have different names, though they have the same connection string. 

    This is all just working in the report designer. Using Q3 2010 in VS2010.  Does anyone have any ideas?

    Thanks
    Clive
  2. Steve
    Admin
    Steve avatar
    10941 posts

    Posted 01 Dec 2010 Link to this post

    Hello Clive,

    This is due to a problem that slipped into the Q3 release and has been immediately fixed in an internal build available for download from your account. Please download the internal build, upgrade and let us know if further help is needed.

    Sorry for the temporary inconvenience.

    All the best,
    Steve
    the Telerik team
    Get started with Telerik Reporting with numerous videos and detailed documentation.
  3. DevCraft banner
  4. Terry Webster
    Terry  Webster avatar
    21 posts
    Member since:
    Dec 2009

    Posted 16 Dec 2010 Link to this post

    I have a similar issue as well. The sub reports run fine when called individually.  It is not until I add the subreport control and call them from within the same report that I begin having errors.

    I have a two telerik reports that each have sub reports that are called 2 or 3 seperate times with different parameters from the same datasource.  Several of the columns are reporting the below errors:

    An error has occurred while processing TextBox 'TextBox1': The expression contains object 'Name' that is not defined in the current context.
    An error has occurred while processing TextBox 'TextBox9': The expression contains object 'QTY' that is not defined in the current context.
    An error has occurred while processing TextBox 'TextBox14': Aggregate node 'Count(Fields(Const(Name)))' not found.
    An error has occurred while processing TextBox 'txtCostRxValues': The expression contains object 'Cost-Rx' that is not defined in the current context.
    An error has occurred while processing TextBox 'txtCostQtyValues': The expression contains object 'Cost-QTY' that is not defined in the current context.
    An error has occurred while processing TextBox 'TextBox16': Aggregate node 'Sum(Fields(Const(QTY)))' not found.
    An error has occurred while processing TextBox 'txtCostRxTotal': Aggregate node 'Sum(Fields(Const(Cost-Rx)))' not found.
    An error has occurred while processing TextBox 'txtCostQtyTotal': Aggregate node 'Sum(Fields(Const(Cost-QTY)))' not found.


    I did not see an internal build for download. 

    Please advise!
  5. Steve
    Admin
    Steve avatar
    10941 posts

    Posted 16 Dec 2010 Link to this post

    Hi Terry,

    According to your description, the problem I've mentioned in the previous reply is the same in your case. The internal build is available for download in your account (see attached screenshot).

    Best wishes,
    Steve
    the Telerik team
    Get started with Telerik Reporting with numerous videos and detailed documentation.
  6. Warren
    Warren avatar
    24 posts
    Member since:
    May 2008

    Posted 14 Feb 2011 Link to this post

    Thanks for the info.  -- Warren
  7. Casey
    Casey avatar
    299 posts
    Member since:
    Jul 2009

    Posted 24 Feb 2011 Link to this post

    Hello,

    I am using Telerik Reporting version 4.2.10.1110. I am experiencing this issue with a report containing two subreports. One of the subreports works, and the other gives me the same errors as the other users. I check and the report appears to be using the correct objectdatasource, however, it obviously is not.

    Should this issue still exist in the version of Telerik Reporting that I am using? 

    I went to Latest Internal Builds and this is the only option available for download: Telerik_Reporting_4_2_11_204_DEV.msi.

    Thanks,
    Casey
  8. Steve
    Admin
    Steve avatar
    10941 posts

    Posted 25 Feb 2011 Link to this post

    Hi Casey,

    Version 4.2.10.1110 is the official Q3 release where the issue exists. Version 4.2.11.204 is the latest internal build which contains the fix and you can go ahead and upgrade to it.

    All the best,
    Steve
    the Telerik team
    Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
  9. Casey
    Casey avatar
    299 posts
    Member since:
    Jul 2009

    Posted 25 Feb 2011 Link to this post

    I upgraded to the latest version and it fixed the issue. 

    Thanks!
    Casey
  10. tlp
    tlp avatar
    33 posts
    Member since:
    Oct 2006

    Posted 31 Aug 2011 Link to this post

    I currently upgraded to the latest 2011 Q2 Version (5.1.11.713) and I'm experiencing the same problem as previously identified. Basically, there are two subreports within a main report and the datasources are dynamically assigned to the subreports within the main report's NeedDataSource event. It seems that the 2nd subreport is attempting to use the 1st subreport's datasource and thus causing the following error:

    An error has occurred while processing TextBox 'xxxxx':
    The expression contains object 'XXXXXX' that is not defined in the current context.

    Any help in resolving this issue is greatly appreciated. Is there an internal build that I can download for 5.1.11.713 that will resolve this issue?

    Thanks.
    Tony

  11. Peter
    Admin
    Peter avatar
    1611 posts

    Posted 05 Sep 2011 Link to this post

    Hello Tlp,

    In our local tests we are unable to reproduce "The expression contains object 'XXXXXX' that is not defined in the current context." error with the provided information with the latest Telerik Reporting Q2 2011 release. Thus we will appreciate if you open a support thread and send us a sample project that exhibits the issue to debug locally.

    Kind regards,
    Peter
    the Telerik team

    Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

  12. tlp
    tlp avatar
    33 posts
    Member since:
    Oct 2006

    Posted 15 Sep 2011 Link to this post

    Peter,

    Thanks for the reply. To resolve the issue I uninstalled the Q2 2011 release and kept installing a previous release until the problem went away. I found that version 4.1.10.921 resolved my issue. I will continue to use version 4.1.10.921 and given the time, I will create a sample project with the latest 2011 release and see if I can reproduce the problem.


    Thanks,

    Tony
  13. Alexandre Jobin
    Alexandre Jobin avatar
    125 posts
    Member since:
    Jan 2010

    Posted 03 Oct 2011 Link to this post

    I also have this problem with v5.1.11.713 .

    My report works great until i add this to a textbox value:

    = System.Globalization.DateTimeFormatInfo.CurrentInfo.GetAbbreviatedMonthName(Fields.Mois)

  14. Peter
    Admin
    Peter avatar
    1611 posts

    Posted 04 Oct 2011 Link to this post

    Hi Alexandre Jobin,

    You are correct generic methods are not supported in expressions. Thus our suggestion is to wrap the method in an user function as shown in the following code snippet:

    public static string GetAbbreviatedMonthName(int month)
    {
        return System.Globalization.DateTimeFormatInfo.CurrentInfo.GetAbbreviatedMonthName(month);
    }
    All the best,
    Peter
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Back to Top
DevCraft banner