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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating SQL based on another value

Status
Not open for further replies.

PeteWalburn

Programmer
Jan 13, 2004
63
GB
Hello,

In one of my reports, I need to create different SQL depending on a value that is set higher up in the report.

At the moment I have tried setting the SelectClause, FromClause and WhereClause in the Start Method of the DataStream.

From the Actuate Help, I understand that I need to override the BindDataRow method too, but I get errors when I do this.

Has anyone been able to do something similar?

Pete
 
You should override the ObtainSelectStatement to modify the Select, From and Where clauses; not the Start method. What version of Actuate are you using? I have in the past done something else to avoid having to manually bind the variables to the data row.

Create a query which will return all the columns needed in the report. If you have a value to pass to your SQL string such as to append to the WhereClause, use a global variable and set the value where ever you need to. Pass the global variable to your SQL string by overriding the ObtainSelectStatement (put your code BEFORE the call to the Super class) like so:

WhereClause = WhereClause & " AND table.column = '" & globalVariableName & "'"

(This above would be for a string value). If you have more questions just let me know.


Bill
 
Bill,

Thanks for the reply. I have managed to do what I need to do using Conditional Sections.

I am using version 7 of Actuate.

Another problem which I am having just now is on a request page. I have 2 Browser Scripting Controls with a browse button for each. The second browse button should pass whatever value is in the first Browser Scripting Control to another form. If I use the browse button for the first control, then the variable is set and the second browse button does work as intended. However, if a value is simply typed into the first Browser Scripting Control then the variable is not set and the second browse button does not pass the value.

Could you tell me how I can set the variable when the user simply types a value into the control? I suspect it needs to be on a LostFocus event.

Thanks for any input,

Pete


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top