CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> .NET

 Summing hrs to parent record from child grid

Print topic Send  topic

Author Message
rready1

Posts: 7
Posted: 11/01/2004, 10:56 AM

Im looking for a way to sum the total hours spent on a task in the task detail table to the task table.
I have a variable on the task record page and I need to sum up the totals from the detailtasks page which is in a grid below the task record page. Anyone have any ideas? Something like
Select sum(acthrs) as totalhrs From taskdetails where taskid = taskid???
_________________
Ron Ready
View profile  Send private message
Stan
Posted: 11/02/2004, 12:06 AM

You can use Dlookup action for this task. You should create label and in the before show event add DLookup action with following settings

Expression = "SUM(acthrs)"
Domain = "taskdetails"
' If you are use C# and obtain TaskId from the URL string
Criteria = "taskid=" + Request.QueryString["taskId"]
' If you are use VB and obtain TaskId from the URL string
Criteria = "taskid=" & Request.QueryString("taskId")

rready1

Posts: 7
Posted: 11/02/2004, 10:21 AM

I did this and received the following error:
C:\DOCUME~1\RON~1.LAK\LOCALS~1\Temp\~PROJE~1\Tasks_maint1.aspx.vb(203) : error BC30002: Type 'Field' is not defined.



TasksLabel4.Text = (New Field("",Settings.Connection1DataAccessObject.ExecuteScalar("SELECT " & Sum(ActHrs) & " FROM " & DetailTasks & " WHERE " & "taskid=" & Request.QueryString("taskId")))).GetFormattedValue("")

~~~~~



C:\DOCUME~1\RON~1.LAK\LOCALS~1\Temp\~PROJE~1>REM _End Make
_________________
Ron Ready
View profile  Send private message
rreday1
Posted: 11/02/2004, 12:49 PM

Expression= "Sum(ActHrs)"
Domain= "DetailTasks"
Criteria= ""taskid=" & Request.QueryString("taskId")"
Connection= Connection1
Convert= Result to Integer
Control= Control
Target= Label4

This is how I filled in my values under dlookup
Stan
Posted: 11/03/2004, 1:40 AM

I believe that these settings should work. But if you will write arbitrary value in the “Convert Result To” filed (for example 'Test'), which code will be generated in your case?

Stan
Tuong Do
Posted: 11/03/2004, 7:08 PM

Look carefullly in the Criteria line

Expression= "Sum(ActHrs)"
Domain= "DetailTasks"

// Criteria= ""taskid=" & Request.QueryString("taskId")"
Criteria= "taskid=" & Request.QueryString("taskId")
Connection= Connection1
Convert= Result to Integer
Control= Control
Target= Label4




"rreday1" <rreday1@forum.codecharge> wrote in message
news:84187f2e564b15@news.codecharge.com...
> Expression= "Sum(ActHrs)"
> Domain= "DetailTasks"
> Criteria= ""taskid=" & Request.QueryString("taskId")"
> Connection= Connection1
> Convert= Result to Integer
> Control= Control
> Target= Label4
>
> This is how I filled in my values under dlookup
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>

rready1

Posts: 7
Posted: 11/04/2004, 6:33 AM

that was the problem the extra Quote in the criteria option, Thanks alot

_________________
Ron Ready
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

PHP Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.