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!

Style Formula

Status
Not open for further replies.

KL_Hutchmfg

IS-IT--Management
May 2, 2018
18
0
0
US
Hello,

We use a system called ECI M1... I am working on a grid in M1 and trying to put in a style format.

Here is the formula:
app.iif(fields("lmlTimecardType").value="2","Style1",app.iif(fields("jmoActualProductionHours").value >= (fields("jmoEstimatedProductionHours").value),"Style2","blank" is null))


Right now I'm receiving a object error which I am sure that it's for the blank is null. How can I change this part of the formula where it will ignore the null values..

app.iif(fields("jmoActualProductionHours").value >= (fields("jmoEstimatedProductionHours").value),"Style2","blank" is null))
 
Hi,

ECi M1 is not part of Crystal Reports.

I don’t know that Tek-Tips has a forum for ECi M1.

Each ERP system has its own properties and methods.

Skip,
[sub]
[glasses]Just traded in my OLD subtlety...
for a NUance![tongue][/sub]
 
I know they don't, ECI M1 uses crystal for it's reporting but it's slightly different for the grids in the actual system. Hoping someone would know what I could put in place to ignore the blank values in the production hours to make the formula work.
 
So is this question regarding a CR issue or ECi M1?

Skip,
[sub]
[glasses]Just traded in my OLD subtlety...
for a NUance![tongue][/sub]
 
Its a grid formula within M1 but I am asking if anyone would know what I could put in there because you've all worked with Crystal. Our reporting is done with crystal and that's why I am apart of this group and most formulas that you can put into crystal can be put into M1 grids.
 
Not sure what the syntax would be in your application, but in CR, you would lead with a conditional clause:

If not isnull({table.field} or
Trim({table.field})<>“” then //replace these iPad quotes!
<your style condition>

-LB
 
I put this in and I get a valid formula but then recieve an error when running the grid. This is what I put in:
app.iif(fields("lmlTimecardType").value="2","Style1",app.iif(isnull(fields("jmoEstimatedProductionHours").value) ="","Style3",app.iif(isnull(fields("jmoActualProductionHours").value) ="","Style3",app.iif(fields("jmoActualProductionHours").value >= (fields("jmoEstimatedProductionHours").value),"Style2",""))))

And I'm getting a "Cannot cast DBnull. value to type"system.decimal.' Please use a nullable type. Any ideas?
 
ActualProductionHours (decimal): it would seem reasonable that ZERO would be what you’re looking for rather than NULL.

Something like a FinishDate might be NULL, but not some DURATION.

Skip,
[sub]
[glasses]Just traded in my OLD subtlety...
for a NUance![tongue][/sub]
 
Its hours but not a date. So the reason i recieve the error is become I am pulling a grid that shows me what every guy is clocked in doing. If he is in a job, it shows production hours. If not its blank.
 
That’s what I’m suggesting.

HOURS, a decimal DURATION, ought not be NULL, if there are indeed no HOURS, but ought to be ZERO if there are no HOURS.

Skip,
[sub]
[glasses]Just traded in my OLD subtlety...
for a NUance![tongue][/sub]
 
Again, not sure of your syntax, but in CR, you need to reference nulls before referencing a value the field may have (i.e., check for nulls first. For a date field, the syntax would be:

If not isnull({table.date}) or
{table.date}<>date(0,0,0) then...

In Crystal iif() used to throw errors when nulls were involved, if I remember correctly. This might be an outdated issue though. So you also might want to try alternative syntax.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top