Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

GetControlValue-- HELP!!!!! 2

Status
Not open for further replies.

myty1998

Technical User
Nov 14, 2003
20
US
Can someone help me understand how this method works.

I need to reference the value of two separate controls in the formula of another control?

I just can't seem to make it work.

Thanks!
 
One thing to check for is the sequence with which the controls get built (these are in the same frame, correct?). If Control "C" needs to access the values of two other controls ("A" & "B") then A nd B need to be created first. To check this simply right click in the structure pane on one of the controls and then select "Slot Information..." This will list all controls and the order with which they are created in that frame. You can also change the order they are built.

Other than that, your code in control C should look like this:
DataValue = GetControlValue("A") + GetControlValue("B")
 
No. I'm still either getting a null value or all No's. I checked the slot information and my "Qualified" cell is last. I'm sure I'm overlooking something.

Should I be inputing the GetControlValue in the Value Exp of my control or in the SubOnRow method. If it belongs in the subonrow what would I put in the Value exp.

Thanks!

 
The controls that you're trying to get the value of: they're not aggregate controls, are they? Otherwise, I would have the code in either the OnRow method or the Finish method.

Have you put break points on the various controls to check their values prior to "getting" them?

I apologizr for the delay, but the email notification of your post was delivered to my junk mail folder....
 
Yes, they are aggregate controls. One sums pol cnt and one calculates an objective based on an if statement. The If statement is in the Finish () the datavalue is based on a DateDiff calculation in the the Value Exp.

How do I set break points to "get" the values?

Thanks for taking the time to respond.... I'm really struggling to get this done.

Chris

 
Hmmm... one reason you can get NULL values using the GetControlValue( ) method is because the value of the control you're trying to get is not yet set. I would move the GetControlValue code to the Finish( ) method then (of the final control -- as long as you're positive it is being created last).

Can you use the IIF( ) in the ValueExp of the control that is basing its value on the DateDiff in the Finish method? If you're not familiar with IIF, it is basically "If...then...else":
IIF((DateDiff("D", Date1, Date2)>30), ExpressionA, ExpressionB)
IIF's can be nested as well.

Because they are aggregate controls, they are going through multiple records to 'build' their values; do you have the ValueType property of the aggregate controls set to AutoValueControl or SummaryControl? That might make a difference as well.

To set break points, open the controls' Properties, open a method (if none are overridden, select the Finish method and place the break point on the "End Sub" line; to do this, just place your cursor on that line and hit F9, or go to "Debug" in the menu, and select "Toggle Breakpoint".

Ahhh, Actuate...... so many ways, so much confusion....
 
I have the Value Type sent to AutoValueControl. Is that ok?

I tried to put the iif in the Value exp (the DateDiff formula) and it wouldn't run. I was told that Acutate couldn't handle complicated iif statements in the Value expression that it would I would need to sent the datavalue based on the datediff and then override the Finish(). It does work that way.

I'll try the debug and see where that gets me.

Actuate... they certainly doesn't make it easy to learn. I feel like I take one step forward and two steps backwards!

Thanks Again!!!!!!!!!!!!!!
 
Thanks for your help. I was finally able to make it work.

I've moved on to another section of the report and once again... it's not working!

How long did it take you to master this software? Actuate is definetly a challenging product to learn.
 
Not to sound discouraging, but I have been working with Actuate for 4+ years... and I don't consider myself a 'master' yet! It truly is challenging to learn, as there are so many ways to accomplish a specific task. That doesn't mean each way is acceptible, or proper.

You really have to learn how Actuate builds objects, and how the objects relate to each other. A daunting task, indeed.

If I can be of any further help, don't hesitate to ask.


Bill
 
Thanks Again Bill.

I suppose then I shouldn't be discouraged after only 2 months with the application.

Chris
 
If you went through Actuate's training class, it used to be divided into two classes, the second being "Advanced". They recommended you not even take the second class until you had been using Actuate for 6 months. It is a very powerful tool, but with that power comes complication. So, no, two months in I imagine you are about to the point of understanding it well enough to be even more confused by it! Hang in there.
 
Can I ask you a question about the Parameters in Actuate? I have a couple reports that are running fine in Actuate however, when I move them to the web there are some dates that will need to be updated monthly. Is there a way to set this Condition "Dynamically" (for lack of a better word)? The Conditions are in the QBE section and in an ObtainSelectStatement that joins another table.

For example: When I run a January Report we will use the Start and End dates for January but I need to update the report Conditions (Assignment.OriOnPlandt >= '1/1/2003') For February this Condition would need to change to (Assignment.OriOnPlandt >= '2/1/2003').

Another report has two date conditions (Assignment.OriOnPlanDt <=12/31/2002 and Assignment.OriOnPlanDt<='1/1/2002') These would also change in monthly increments based on the Start and End Date of the Report.

Thanks!
Chris
 
What comes to mind immediately is &quot;when&quot;, as in when are these reports run? In other words, if these monthly reports always run for the previous month (ie, Jan. reports are run Feb 1 or later) then you can create a variable for previous month' date:

PrevMonthDate = DateAdd(&quot;m&quot;, -1, Now() )

This can be put in the root class (top most report object) Start( ) method, then passed to your data source ObtainSelectStatement( ) where you can override the WhereClause:

WhereClause = WhereCLause & &quot; AND DateParm = '&quot; & PrevMonthDate & &quot;'&quot;

Depending on your database for handling dates (Oracle is different than this example, or single ticks, etc. Is this what you were referring to?

 
When -- hmmm
The reports are generated monthly. February would be using January results however, the group of people that I need to include in the report is the condition that would be changing...basically, for one report it's anyone on plan for the year preceding the report date. The second report is anyone on plan 2 years preceding the report date but not including the group in the prior report. Sorry if this is confusing.

Do you think something like this would work?

Parameter name StartDate = value of ‘2/1/2004’ Assignment.OrigOnPlanDt is greater than or equal to the StartDate minus one year or ‘2/1/2003’,
add this to my Where clause:
Assignment.OrigOnPlanDt >= '&quot; & Format(DateAdd(&quot;yyyy&quot;, -1, StartDate), &quot;dd-mmm-yyyy&quot;) & &quot;'

I haven't used the DateAdd very much but I got some info from Actuate Help.

Thanks AGAIN!!!!!
 
Seems like it would work, but I am just curious as to how you are handling the current month -- for when the report is run. Do you have it so that NO dates are hard coded (including the above mentioned &quot;StartDate = value of '2/1/2004'&quot;)?

To try and better explain myself, let me assume the following scenario:
Whether the report is run on Feb 1 or Feb 28 (OK, 29 this year), the report should return data from 2/1/2003 - 1/31/2004; likewise, when run in March it would be for 3/1/2003 - 2/29/2004, then you will need to determine the current month (when the report is running, most likely using the Now() function?) so that you can get your end date to complete your date range. You may want to just create variables for both Month and Year so you can parse together your Start and End dates.

If the report will always be run on the 1st day of the month, then this is not necessary.

Does this sound like what you need to do?
 
Sounds like I may need the Now(). We won't always be running the report on the 1st of the month... (good point).

My Start and End dates are Parameters -- Unfortunately, I didn't design the portion of the Liabrary that drives all of our secondary reports. It worked so I basically went with it!

I'll keep working on it. You've been tremendously helpful!!!!

Chris
 
It's me again.

Do you know how I can RoundDown in Actuate? The standard RoundDown(0.0,0) function is returning an error.

Thanks!
 
RoundDown( ) is not an Actuate Basic function. Just format the control's value:
If the control/value is a double, then in the control's Format property have ###,##0
 
When I format the controls value it still rounds up. All I want is for my value to be expressed as 95 rather than 95.5.

Something that should be so simple.... sorry very frustrated today.

Thanks for your help on the Date problem it's working great!

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top