We have some shipping reports and the users don’t want to see the shipment detail lines if the amount is zero. We ship a lot of no charge items that have zero amounts.
Is there any way to code this report to check the amount and skip printing?
What it be put under Sales Line - OnAfterGetRecord() ??
That would be in the OnPreSection trigger of the line body section. CurrReport.SHOWOUTPUT(FALSE) will not print the section, so you would do something like this:
That worked great unfortunately they added another stipulation where it would only include a “userid” of a certain employee so I need to add and “AND” to this statement. Something similar to this but it’s needs a little help.
Daniel I seem to be having a syntax problem with the “username”. I’ve tried putting just about everything I can think of with/without quotes… Still get the same message.
I think your code needs some more parantheses (or what ever it’s called [:D])
CurrReport.SHOWOUTPUT(ABS(Amount) > 0) AND (USERID = “Personsname”)
This code only includes the “ABS(Amount) > 0” part in the CurrReport.SHOWOUTPUT.
Add yet another set of parantheses around it all, and it should work like you want.
CurrReport.SHOWOUTPUT((ABS(Amount) > 0) AND (USERID = ‘Personsname’))
(btw… remember to use single quotation-marks to define text… not double)
I must add that i think it’s a very very bad idea to hardcode the username of the user who can’t print the 0-lines into the report.
Any other user will have the 0-lines printed.
Then the first user falls ill, then who can print the invoices to the customers?
Anyone? By logging in with the first users login?
I think you should either consider adding a field to some setup-table, in wich it can be setup wich user-id is to be used in this report.
Or maybe add a boolean-variable in the report, and have the user check/uncheck it in the request-form.