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

Problems with SUM() and COUNT() in beta 2

6 Answers 382 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
edgebyte
Top achievements
Rank 1
edgebyte asked on 22 Mar 2007, 10:28 AM

After some confusion during the upgrade between beta 1 and beta 2, I'm struggling with the following error and I don't know what I'm doing wrong (please could you confirm what version we're running- the distinction I'm using is that beta 2's TextBox has a .Value property whereas beta 1's TextBox has a .Text property. Is this correct? Our dev boxes have had old versions installed in the past and I'm not sure the installers did the upgrade properly)

I digress. Here's a screenshot of the designer view:
http://i162.photobucket.com/albums/t277/fantomning/Capture-2.png

CounterMt is a field in the data table to which the report is bound (programatically), but is not shown on the report. It is a unique key for each row - the intention is to show the number of rows in the COUNT() field here.

The five SUM() fields in reportFooterSection1 are supposed to be an aggregate of the corresponding fields in the detail section.

If I remove the SUM() fields then the report executes perfectly well, otherwise I get this exception:

Any ideas? 

Server Error in '/LawbyteDotNet' Application.

Object reference not set to an instance of an object.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[NullReferenceException: Object reference not set to an instance of an object.]
   Telerik.Reporting.Data.AggregateNode.Eval(DataRow row) +38
   Telerik.Reporting.Processing.TextBox.ProcessItem() +159
   Telerik.Reporting.Processing.ReportItemBase.ProcessItem() +144
   Telerik.Reporting.Processing.Report.ProcessItem() +312
   Telerik.Reporting.Processing.ReportProcessor.ProcessReport(Report reportDefinition) +57
   Telerik.Reporting.Processing.ReportProcessor.Render(String format, Report reportDefinition, Hashtable deviceInfo, CreateStream createStramCallback) +81
   Telerik.ReportViewer.WebForms.ServerReport.Render(HttpResponse response, String format, Int32 pageNumber, Boolean refresh) +806
   Telerik.ReportViewer.WebForms.ReportPageOperation.PerformOperation(NameValueCollection urlQuery, HttpResponse response) +72
   Telerik.ReportViewer.WebForms.HttpHandler.System.Web.IHttpHandler.ProcessRequest(HttpContext context) +118
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +303
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +64


Version Information: Microsoft .NET Framework Version:2.0.50727.312; ASP.NET Version:2.0.50727.312

6 Answers, 1 is accepted

Sort by
0
edgebyte
Top achievements
Rank 1
answered on 22 Mar 2007, 10:31 AM
I should also note that, for example in the office balance column, the detail section has .Value of =OfficeBalMt, and the corresponding field in the reportFooterSection1 has .Value of =SUM(OfficeBalMt). OfficeBalMt is a decimal type number from an SQL 2005 database. Similar holds for the other 4 fields.
0
Rossen Hristov
Telerik team
answered on 26 Mar 2007, 07:15 AM
Hi Tom,

We are sorry for the problems that we caused, but it turned out that we have not polished the expressions completely. This is a known issue and we are currently working on it. Right now, you can use aggregate functions only in the Group Header/Footer, but we will make them universal. Once again, excuse us for this weird behavior of the aggregate functions, but we were pushing hard for the Beta2 release and we have missed that.

Kind regards,
Rossen
the telerik team
0
edgebyte
Top achievements
Rank 1
answered on 26 Mar 2007, 09:45 AM
That's fine.. I look forward to the next release.

I was just checking that I was not doing something stupid.

All the best

Tom
0
Rossen Hristov
Telerik team
answered on 27 Mar 2007, 01:48 PM
Hello Tom,

Thank you for the great feedback. Stay tuned for the next release.

Kind regards,
Rossen
the telerik team

Instantly find answers to your questions at the new telerik Support Center
0
edgebyte
Top achievements
Rank 1
answered on 04 May 2007, 08:56 AM
This wasn't fixed in the release version.

This is now a blocking issue for us. We can't release our product until this functionality is available.

I've raised a support ticket - but not being able to add up column totals is a bit of a gaping hole in a reporting package, no?

0
Svetoslav
Telerik team
answered on 04 May 2007, 02:43 PM
Hello Tom,

We're sorry that we failed to fix this issue on time. Although the current version doesn't allow an easy way to create grand/column totals there is a way to achieve the same result using the item binding events and the ReportFooterSection.

Attached please find a sample project that demonstrates how create a grand total sum for a data field (you need to set the project references to use your version of Telerik Reporting assemblies).

The main idea behind the example is: every time the detail section is bound (this occurs once for each row of the data source) we need to accumulate the value of the field for the grand total sum; After all details (and groups if any) are bound it is the time when the report footer section is being processed and here we set the accumulated value to a TextBox that will display the grand total.

Once again please accept our apologies for the troubles we've caused.

Regards,
Svetoslav
the telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
General Discussions
Asked by
edgebyte
Top achievements
Rank 1
Answers by
edgebyte
Top achievements
Rank 1
Rossen Hristov
Telerik team
Svetoslav
Telerik team
Share this question
or