Reply
 
LinkBack Thread Tools Display Modes
Old 12-29-2010, 09:01 AM   #1 (permalink)
Run
Junior Member
 
Join Date: Jun 2010
Posts: 7
Run is on a distinguished road
Default return the total value of bound text box

How to return the total value of a text box that have "SummaryGroup" and "SummaryType".
when I use this method: ReportUtilities.ReturnTextBoxValue(rpt, "grpLaborDetail", "txtMgmtLabor")
it returns only The first value not the total.

For Example: I use in my report the field (../../../dtr:Project/dtr:Items/dtr:Item /dtr:MgtLaborPrice)
SummaryGroup: grpLaborDetail
SummaryType: SubTotal

I want to add this field’s value to the field “dtr:LaborPrice” which in the “grpLaborDetail”
Run is offline   Reply With Quote
Old 12-30-2010, 07:53 AM   #2 (permalink)
Senior Member
 
Join Date: May 2009
Location: Chennai, India
Posts: 157
nkarthick is on a distinguished road
Default Try this Idea

Hi,

If you want to retrieve the bound value which is summarized, then get the value in BeforePrint event procedure instead of Format event procedure.

In your case -

Use the ReturnTextBoxValue method in grpLaborDetail_BeforePrint procedure

Sub grpLaborDetailr_BeforePrint

Dim mgtValue as Double = Double.Parse(ReportUtilities.ReturnTextBoxValue(rp t, "grpLaborDetail", "txtMgmtLabor"))

End Sub

Add mgtValue to the LaborPrice(get as like as mgmtlabor) and assign it to the corresponding TextBox using ReportUtilities.SetTextBoxValue method.

Hope it helps.
__________________
Narayana Karthik
nkarthick is offline   Reply With Quote
Old 01-17-2011, 11:00 AM   #3 (permalink)
Run
Junior Member
 
Join Date: Jun 2010
Posts: 7
Run is on a distinguished road
Default

Hi nkarthick,

Thanks for your reply, but it always return 0
Here is my code:

Private designPrice As Double

Sub grpDesignLabor_BeforePrint

designPrice = ReportUtilities.ReturnTextBoxValue(rpt, "grpDesignLabor", "txtDesignLabor2")

End Sub


Sub grpDesignLabor_Format

ReportUtilities.SetTextBoxValue(rpt, "grpDesignLabor", "TextBox1", designPrice )

End Sub
Run is offline   Reply With Quote
Old 01-17-2011, 11:09 AM   #4 (permalink)
Senior Member
 
Join Date: May 2009
Location: Chennai, India
Posts: 157
nkarthick is on a distinguished road
Default

Hi,

Your code should be -

Sub grpDesignLabor_BeforePrint

designPrice = Double.Parse(ReportUtilities.ReturnTextBoxValue(rp t, "grpDesignLabor", "txtDesignLabor2"))

ReportUtilities.SetTextBoxValue(rpt, "grpDesignLabor", "TextBox1", designPrice )


End Sub


Don't assign the textbox value (summarized bound value) in format event procedure, do it in the BeforePrint event procedure itself.

FYI- Format event procedure fire/run first then only BeforePrint event procedure will be fired.


Hope it helps.
__________________
Narayana Karthik
nkarthick is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 09:17 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.3.0
D-Tools, Inc.