I have created the report below and it is almost doing what I want, but not quite. I have a header section at the top of the report with a title, some text, a button, and an drop-down (select) list. I show a series of query results in the body below the header section at the top beginning with the loan table. I want to be able to display a popup window when the user selects a table name from the selectlist AND presses the button. Currently the popup list appears when the user selects an item from the selectlist and the button does not appear. Can I modify this report so that the popup does not appear when the user selects an item from the drop-down list, but instead appears when they click the button? Also, why doesn't the button appear? And for extra credit, can I have the select list have no selection when the report first appears, or even better an option that says "Select A Table". I don't know how I was able to get this far because the selectlist/report behavior is not well-explained (to me) in the documentation. It appears that the selectlist takes the values from the first column in sp_DBR_payasr_Show_Table, but I'm not sure.
CREATE PROCEDURE sp_DBR_Loan_Viewer
( LoanID INT )
BEGIN
SELECT 'dbr.title', 'Loan Viewer'; SELECT 'dbr.text', CONCAT('Loan ID ', LoanID), 'ParamHeaderClass';
SELECT 'dbr.report', 'sp_DBR_payasr_Show_Table', 'popup', 'TableName=table_name'; SELECT 'dbr.button', 'Show Table'; SELECT 'dbr.selectlist', '', 'Select'; SELECT table_name FROM payasr.show_table ORDER BY table_name;
SELECT 'dbr.text', 'loan', 'ParamHeaderClass';
SELECT * FROM payasr.loan WHERE id = LoanID;
SELECT 'dbr.text', 'adjustment_log', 'ParamHeaderClass';
SELECT * FROM payasr.adjustment_log WHERE loan_id = LoanID ORDER BY adjustment_dt;
SELECT 'dbr.text', 'loan_term', 'ParamHeaderClass';
SELECT * FROM payasr.loan_term WHERE loan_id = LoanID ORDER BY effective_dt;
SELECT 'dbr.text', 'loan_payment_method', 'ParamHeaderClass';
SELECT * FROM payasr.loan_payment_method WHERE loan_id = LoanID ORDER BY effective_dt;
END $$