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

User-selected Sorting

Status
Not open for further replies.

PeteWalburn

Programmer
Jan 13, 2004
63
0
0
GB
Hi,

I am developing reports in Actuate for use within Maximo. So the reports are displayed in a web browser. Is it possible to have radio buttons at the top of the report to allow the user to sort by different fields?

At the moment, I have got 2 radio buttons at the top of the report (in browser scripting controls). I have them calling Javascript functions when they are clicked and have verified that they call the correct functions (using the alert() function).

Can I now tell the report to sort the data by the specified field?

Any help much appreciated.

Pete
 
You can use DECODE function in the ORDER BY clause of your query. For example:
Code:
select Field1, Field2, Field3 from Table1
where...
order by DECODE(:p_sort_parameter, 1, Field1, 2, Field2, Field3)
You need to make sure though that all fields included in the DECODE are of the same type.
 
Hi,

I could have radio buttons on the Request Page and have the user select the order and then press Submit. Then I could have the report modify it's SQL statement.

BUT, I would like the report to be displayed and then allow the user to alter the sort order dynamically. I am not sure if it can be done the way I want it or not. I suspect that I would have to reload the report anyway, so it might be a bit pointless trying to do it this way!

Pete
 
What you need to do is use Browser scripting controls.
These can be used to create an HTML form in your report. The users can then enter the params they want and click a SUBMIT button. The options are then sent to the iServer which will used them to run the ROX with the choices.

There is a good example delivered with the product.
Its called BrowserScriptingControl.rod.
 
Thanks,

I know how to do that - I do it a lot from Request Pages. But I was really wanting to do it on the report that is produced from the Request Page.

So the user would enter options on the Request Page and press Submit. Then the report would be generated and would have 2 radio buttons at the top - one for Sorting by ItemNum and one for sorting by Description. It would be sorted by ItemNum bu default and if the user clicked the Descriptin radio button, the report would change to be sorted by Description. I am fairly sure that I need to reload the report and pass in a parameter to indicate which field is to be sorted by. In fact, when I think about it, that is probably just what I need to do.

Pete

 
Hi,

Re: Radio Button to flip format…

If you only have 2 formats, and there is no other information you need to pass over, could you perhaps create both ROIs at the same time, (either thru report bursting or scheduling them to run one after the other) then use a Hyperlink to switch between ROIs. Hyperlinks are so much simpler to implement than a BSC form and working out the Browsercode. A hyperlink on the other report switches back to the other ROI.

Even if you run the ROX on the fly, the hyperlink could run the ROX and pass the parameters.

Milt.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top