PDA

View Full Version : Report with argument question


ABC123

Gman
04-09-2008, 03:23 PM
Within my SQL data source I have defined and argument called “reqby” which will print only the work orders for the person chosen. This works great, what i select is what is printed but my problem is I would like to print the field chosen in my report header. I looked through the message board and I found about creating a calculated field like req = a5_GetArgumentValue("reqby") but nothing will print. Any suggestions or ideas.

Thank you.

Selwyn Rabins
04-09-2008, 07:02 PM
Within my SQL data source I have defined and argument called “reqby” which will print only the work orders for the person chosen. This works great, what i select is what is printed but my problem is I would like to print the field chosen in my report header. I looked through the message board and I found about creating a calculated field like req = a5_GetArgumentValue("reqby") but nothing will print. Any suggestions or ideas.

Thank you.

thanks very much. it is a bug. i have just fixed it. it will be in the next patch.

in the mean time, you can work around the bug by passing in the argument values to report.print()

for example:

dim args as sql::arguments
args.add("argument1","value of argument1")

report.print("reportname","","",args)

this will work.

mtense
04-09-2008, 10:19 PM
I am a similar problem in qreportbuilder. Does this bug affect it also? Is there a workaround?

Thanks.

Gman
04-10-2008, 09:12 AM
Thank you for the information Selwyn. I can not say enough about this message board and community.

Thanks for the great product and support!!

Gman
04-22-2008, 05:03 PM
This post was earlier

"Within my SQL data source I have defined and argument called “reqby” which will print only the work orders for the person chosen. This works great, what i select is what is printed but my problem is I would like to print the field chosen in my report header. I looked through the message board and I found about creating a calculated field like req = a5_GetArgumentValue("reqby") but nothing will print. Any suggestions or ideas."

I am not sure what I am missing but I can't get the variable to print in a report. I have the latest build (1441_3175). Is anyone having the same problem?

Thanks,
Gary

Selwyn Rabins
04-22-2008, 05:25 PM
This post was earlier

"Within my SQL data source I have defined and argument called “reqby” which will print only the work orders for the person chosen. This works great, what i select is what is printed but my problem is I would like to print the field chosen in my report header. I looked through the message board and I found about creating a calculated field like req = a5_GetArgumentValue("reqby") but nothing will print. Any suggestions or ideas."

I am not sure what I am missing but I can't get the variable to print in a report. I have the latest build (1441_3175). Is anyone having the same problem?

Thanks,
Gary


I think I misunderstood your original post on this issue.

Is your report based on an <SQL Datasource>, or on an Active-Link table?

If it is based on an active-link table that has an argument in the SQL Select statement for the active-link table definition, then the a5_GetArgumentValue("reqby") call will work.

However, if you based your report on a <SQL Datasource> that uses an argument, then a5_GetArgumentValues() will not work.

I would recommend using active-link tables over a <SQL Datasource>.

However, if there is some reason why you don't want to use active-link tables, then you will have to pass in the argument values in your call to report.print(), with code that is similar to this:



dim a as sql::arguments
a.set("whatcity","Paris")
report.preview("reportOnSQLDataSource","","",.f.,.f.,a)

Gman
04-22-2008, 05:35 PM
Currently it is based on a <SQL Datasource> but it doesn't have to stay that way. I will take your suggestions and give it a go.

Thank You again.

dsturner
06-22-2011, 03:38 PM
I too am having difficulty with this issue. I have a report based on a SQL Datasource. In the Select statement, I have defined two arguments - :StartDate and :EndDate. The arguments are presented at runtime for the report. How do I pass the value of the argument to the report header. I really don't understand Selwyns instructions above as I am just now developing the report and do not have it incorporated into a call from a web page just yet. Can the values be accessed through a calculated field on the report?

Thanks in advance.