I'm working on my first report in PRD (v6.0), and can't seem to find much info on how to use query scripting. I can get a basic report to work (by entering the query in the "Static Query" tab, but our goal is to use parameters. The idea is to have several user options presented first, and based on the answers, design the specific query. But even without getting into the additional user options, I'm having trouble getting anything to display on the report.
So I started by creating a new JDBC data source, and in the "Query Scripting" tab I wrote code such as this...
function computeQuery (query, queryName, dataRow) {
query = "SELECT fullName, totLoadCount, totLoadGP....FROM tblX....WHERE blah blah blah";
return query;
}
When I hit the preview button at the bottom, it shows my data. As of now, I am not using parameters, but once I get things working, I'd like to adjust the query in code (by changing around the WHERE clauses). For example, if the user wants to exclude inactive employees, then in the code I would add something like this...
if (${prmExcludeActiveEmpsOption} = 'yes') {
query += " AND isActive = 1"
}
But my problem is without even using any parameters, I can't get any of the fields in my query to show up on the report. I dragged a text field to the report and in the attributes panel for "field", I type "fullName" (the first field in my select statement) yet nothing shows up when running the report. So why does the preview work fine but I'm not able to get these fields to display on the report? I have done a lot of searching on the internet for help with PRD, but it seems there is very little. If anyone knows where I can acquire additional info for help with PRD, that would be much appreciated also.
Thanks in advance for any help.
Wes