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!

Stop report printing 1

Status
Not open for further replies.

Cpreston

MIS
Mar 4, 2015
969
0
16
GB
Hi

Is there a way to stop a report printing if something meets a certain criteria. I know you can supress areas, but what I would like to happen is that the report is not printed at all.

If possible a prompt to say it cannot be printed because of .....

I am not sure of what [parameters there are yet, but cannot find anything to [prevent it printing at all.

Could someone advise please

Thanks
 
By "printing", I assume you mean displaying results.

Not sure what your criterion would be, but as an example let's say you didn't want to print it if the total amount of an order was less than a certain amount. First you would need to create a SQL expression {%sumamt} like this:

(
select sum(`amount`)
from Table
)

Then create a parameter {?amt}(number or currency depending on your field type) that will hold your criterion. Then add a record selection formula like this:
(
if {%sumamt}< {?amt} then
false else true
) and //add other selection criteria here

Then add a text box to a new report header_b section and add in something like: "Total amount is less than " and then insert {?amt}. Format the text box to suppress with a formula like this:

not isnull({table.id}) //use whatever field is present in each row of the report

Format the report header_b section to "suppress blank section".

Suppress the field headers in the report with the formula:

isnull({table.id})

If you have trouble with the SQL expression, let me know--if you need one. You haven't specified your criterion, so I have know idea if this is the direction you are headed. The syntax and punctuation of the SQL expression depends on your datasource and your version of CR.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top