I have a section in my report and Below is my requirement to suppress it:
If scanmode and status=null (these fileds coming from database)
then i need to suppress the section.
If it is not null then i need check next condition {Status.status} >= 3 if it is >=3 then i need to check next condition {?Stack} <> "S" .
Please suggest the logic i wrote is correct or not>If wrong please modify it
Logic i wrote:
isnull({Status.scan_mode}) and isnull({Status.status})
or
{Status.status} >= 3
or
{?Stack} <> "S"
What is my doubt is here we gave or condition for every logic will it check 1st condition,if it is true then then 2nd ,if it is true then 3rd
or it will hide the section if any one of above 3 logic's is correct.
Is there any way to convert above logic to if else condition.Can we write if else in suppress condition.If yes please tell me
Please suggest me.
Write below logic in supress section
If isnull({Status.scan_mode})
then
(
if isnull({Status.status}) or {Status.status} >= 3 then
(
if {?Stack} <> "S"
then
true
)
)
else false
if isnull({Status.scan_mode}) and isnull({Status.status}) then true
else if Scanmode = 'C' or Scanmode = 'D' then true
else if {Status.status} >= 3 or {?Stack} <> "S" then true
else false
I hope this helps
Related
I'm trying to run a report that has already been created and works. But when I try to run an error pops up with the 'Formula Workshop' screen and it says "the ) is missing". This is the formula displayed:
if({a.sched_firm_qty}+{a.sched_excess_qty} != 0)
then
(({a.actual_firm_qty}+{a.actual_excess_qty}) / ({a.sched_firm_qty}+{a.sched_excess_qty}))-1
else
-1
Please help
Your formula should look like
if(({a.sched_firm_qty}+{a.sched_excess_qty}) <> 0)
then
(({a.actual_firm_qty}+{a.actual_excess_qty}) / ({a.sched_firm_qty}+{a.sched_excess_qty}))-1
else
-1
I've added one additional bracket for first summary and replaced matching operator. <> is equivalent for != in CR. Hope it helps
I have a medical report that I need to alter the value of each appointment code.
If {Schedule.Activity} = "123"
then give it a value of 2,
if {Schedule.Activity} = "124"
then 1
else 1
The list is quite long of specific codes and what value they need to be for counting. Currently the report is counting all appointments as just 1.
I could do individual formulas but can anyone help with just one?
at the end of the report, they will all need to be summed as well.
I'm still new to CR so please have simple explanations and all the right syntax!
Thanks
Select {Schedule.Activity}
Case "123" : 1
Case "124" : 2
Case "125" : 3
///add as many Cases as you like
Default : 0 ;
I have created a CR with 2 different letters. One letter is in the Details Section and the other letter is in a Subreport.
Basically, if the table.field = 1,2,3 or 9 then I want to print the Subreport. If the table.field <> 1,2,3 or 9 then I want to print the Details Section.
I know that I would need to suppress one over the other but I don't know the easiest way to do this.
Any suggestions would be greatly appreciated. Thanks!
The easiest way to do it is next.
Your report contains :
subreport which shows if value of field is 1,2,3 or 9
detail section shows if value of field is <> 1,2,3 or 9
Go to section expert, detail section and under "supress" write formula
if ({table.field} = 1 or {table.field} = 2 or {table.field} = 3 or {table.field} = 9) = false then false
else true
Right click on subreport and unders "supress" triger write formula.
Formula for subreport is
if {table.field} = 1 or {table.field} = 2 or {table.field} = 3 or {table.field} = 9 then false
else true
And this should do the trick. I'm sure there is other ways to solve this situation, but this is how i do it.
Hope it helps you :)
I have tried 2 formulas to get a "Y" on my report if one of two fields has a value of YES but I cannot get the formula to work.
Formula 1:
if ({Print.RetailRx} = "YES")
or ({Print.MailRx} = "YES")
then "Y"
Else ""
Formula 2:
if ({Print.RetailRx} = "YES") then "Y"
else if ({Print.MailRx} = "YES")
then "Y"
What happens is if retailRx has a value of "YES" I'll get the "Y" but it does not apply for MailRx. Can anyone help? Thanks
In which scenarios is it failing? And what is it doing?
The first is probably the simplest solution:
if {Print.RetailRx} = "YES" or {Print.MailRx} = "YES" then
"Y"
else
""
You may just need to change the dropdown at the top of the formula editor to read: default values for nulls (instead of exception for nulls).
i found this on another forum
set your default value 'ALL' for parameter
add if statement to Select Expert:
If {?Parameter}='ALL'
Then {Database.Field} like '*'
Else {Database.Field} = {?Parameter} and
{fctime_ts} >= {#StartDate} and
{fctime_ts} < {#EndDate}
that didnt work, for some reason it isnt using the date constraints. So then i tried the following.
{fpartno} = IIF({?PartNbr} = 'All', '*' , {?PartNbr})
that works great if i use an actual part number, but when i use the defaul ALL it doesnt work at all.
this is my complete selection formula:
fpartno} = IIF({?PartNbr} = 'All', '*' , {?PartNbr}) and
{fctime_ts} >= {#StartDate} and
{fctime_ts} < {#EndDate}
anyone know how to either make the mentioned answer on this forum work with dates or how ot make this way work?
Try:
(If {?Parameter}='ALL' Then
{Database.Field} LIKE '*'
Else
{Database.Field} = {?Parameter}
)
and {fctime_ts} >= {#StartDate}
and {fctime_ts} < {#EndDate}
I had a problem with what you recommended, but i found this answer.
This is how it works, it checks to see if PartNbr is equal to 'All'. If it does then it skips to the date restraints. By skipping, it will in turn select all the parts in that date range. if PartNbr doesn't equal 'All', it will take PartNbr and get the parts with that number within the date range.
This solution worked great for me, just htought id update if someone came by
({?PartNbr} = 'All'
or
{?PartNbr}= {intran.fpartno}) and
{intran.fctime_ts} >= {#StartDate} and
{intran.fctime_ts} <= {#EndDate}