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

Sub report datasources are interacting?

12 Answers 289 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Clive
Top achievements
Rank 1
Clive asked on 30 Nov 2010, 10:20 PM
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

12 Answers, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 01 Dec 2010, 08:54 AM
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.
0
Terry Webster
Top achievements
Rank 1
answered on 16 Dec 2010, 05:37 PM
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!
0
Steve
Telerik team
answered on 16 Dec 2010, 05:41 PM
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.
0
Warren
Top achievements
Rank 2
answered on 14 Feb 2011, 04:08 PM
Thanks for the info.  -- Warren
0
Casey
Top achievements
Rank 1
answered on 24 Feb 2011, 09:02 PM
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
0
Steve
Telerik team
answered on 25 Feb 2011, 01:01 PM
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!
0
Casey
Top achievements
Rank 1
answered on 25 Feb 2011, 02:47 PM
I upgraded to the latest version and it fixed the issue. 

Thanks!
Casey
0
tlp
Top achievements
Rank 1
answered on 31 Aug 2011, 03:12 PM
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

0
Peter
Telerik team
answered on 05 Sep 2011, 08:25 PM
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 >>

0
tlp
Top achievements
Rank 1
answered on 15 Sep 2011, 06:00 PM
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
0
Alexandre Jobin
Top achievements
Rank 1
answered on 03 Oct 2011, 04:13 PM
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)

0
Peter
Telerik team
answered on 04 Oct 2011, 05:00 PM
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 >>

Tags
General Discussions
Asked by
Clive
Top achievements
Rank 1
Answers by
Steve
Telerik team
Terry Webster
Top achievements
Rank 1
Warren
Top achievements
Rank 2
Casey
Top achievements
Rank 1
tlp
Top achievements
Rank 1
Peter
Telerik team
Alexandre Jobin
Top achievements
Rank 1
Share this question
or