roboticapps1
IS-IT--Management
I haven't programmed in Crystal Reports much so I don't know all the syntax but from what I've read thus far, this is what I have. Unfortunately, I get an error message that says
The string is non-numeric.
Details: errorKind.
It doesn't give me much information about where the problem is so I'm a little stuck. Here is the formula that I have. An explanation of the formula or what I was looking to do is at the bottom.
//Formula 1
shared numbervar machRAN;
shared numbervar machNUM;
shared stringvar machLET;
local stringvar machDOWN := "DOWN" + chr(13);
local stringvar output := "";
If {BAQReportResult.LaborDtl.ResourceID}[1] = machLET AND toNumber({BAWReportResult.LaborDtl.ResourceID}[2] = machNUM Then
(
{BAQReportResult.LaborDtl.ResourceID} + {BAQReportResult.EmpBasic.Name};
)
Else
(
While {BAQReportResult.LaborDtl.ResourceID}[1] <> machLET AND toNumber({BAWReportResult.LaborDtl.ResourceID}[2] <> machNUM
(
machNUM := machNUM + 1;
If machLET = "A" AND machNUM > 6 Then
(
machNUM = 1;
machLET = "B";
)
Else If machLET = "B" AND machNUM > 6 Then
(
machNUM = 1;
machLET = "C";
)
Else If machLET = "C" AND machNUM > 2 Then
(
machNUM = 1;
machLET = "D";
)
Else If machLET = "D" AND machNUM > 4 Then
(
machNUM = 1;
machLET = "E";
)
Else If machLET = "E" AND machNUM > 2 Then
(
machNUM = 1;
machLET = "F";
)
Else If machLET = "F" AND machNUM > 4 Then
(
machNUM = 1;
machLET = "G";
)
Else If machLET = "G" AND machNUM > 8 Then
(
machNUM = 1;
machLET = "H";
)
Else If machLET = "H" AND machNUM > 1 Then
(
machNUM = 1;
machLET = "J";
);
If {BAQReportResult.LaborDtl.ResourceID}[1] = machLET AND toNumber({BAWReportResult.LaborDtl.ResourceID}[2] = machNUM Then
(
output := output + {BAQReportResult.LaborDtl.ResourceID} + {BAQReportResult.EmpBasic.Name};
)
Else
(
output := output + {BAQReportResult.LaborDtl.ResourceID} + machDOWN;
);
);
output;
);
Our company has rows A - H of machines. A1-6, B1-6, C1-5, D1-4, E1-2, F1-4, G1-8, H1. I'm trying to output a list of all the machines and the work that has been done on each machine during the day. This would be completely easy if all machines were running but there are cases that a certain will be down. I need to document which machine is down on the report and that is where the formula comes in. The data that I'm using might have all machines except B6 and F2 in which case those machines are not going to be included in the data so I need to "manually" insert them in the crystal report to show that those machines were down.
Looking at the formula, can someone tell me why I'm getting that error?
Thank You.
The string is non-numeric.
Details: errorKind.
It doesn't give me much information about where the problem is so I'm a little stuck. Here is the formula that I have. An explanation of the formula or what I was looking to do is at the bottom.
//Formula 1
shared numbervar machRAN;
shared numbervar machNUM;
shared stringvar machLET;
local stringvar machDOWN := "DOWN" + chr(13);
local stringvar output := "";
If {BAQReportResult.LaborDtl.ResourceID}[1] = machLET AND toNumber({BAWReportResult.LaborDtl.ResourceID}[2] = machNUM Then
(
{BAQReportResult.LaborDtl.ResourceID} + {BAQReportResult.EmpBasic.Name};
)
Else
(
While {BAQReportResult.LaborDtl.ResourceID}[1] <> machLET AND toNumber({BAWReportResult.LaborDtl.ResourceID}[2] <> machNUM
(
machNUM := machNUM + 1;
If machLET = "A" AND machNUM > 6 Then
(
machNUM = 1;
machLET = "B";
)
Else If machLET = "B" AND machNUM > 6 Then
(
machNUM = 1;
machLET = "C";
)
Else If machLET = "C" AND machNUM > 2 Then
(
machNUM = 1;
machLET = "D";
)
Else If machLET = "D" AND machNUM > 4 Then
(
machNUM = 1;
machLET = "E";
)
Else If machLET = "E" AND machNUM > 2 Then
(
machNUM = 1;
machLET = "F";
)
Else If machLET = "F" AND machNUM > 4 Then
(
machNUM = 1;
machLET = "G";
)
Else If machLET = "G" AND machNUM > 8 Then
(
machNUM = 1;
machLET = "H";
)
Else If machLET = "H" AND machNUM > 1 Then
(
machNUM = 1;
machLET = "J";
);
If {BAQReportResult.LaborDtl.ResourceID}[1] = machLET AND toNumber({BAWReportResult.LaborDtl.ResourceID}[2] = machNUM Then
(
output := output + {BAQReportResult.LaborDtl.ResourceID} + {BAQReportResult.EmpBasic.Name};
)
Else
(
output := output + {BAQReportResult.LaborDtl.ResourceID} + machDOWN;
);
);
output;
);
Our company has rows A - H of machines. A1-6, B1-6, C1-5, D1-4, E1-2, F1-4, G1-8, H1. I'm trying to output a list of all the machines and the work that has been done on each machine during the day. This would be completely easy if all machines were running but there are cases that a certain will be down. I need to document which machine is down on the report and that is where the formula comes in. The data that I'm using might have all machines except B6 and F2 in which case those machines are not going to be included in the data so I need to "manually" insert them in the crystal report to show that those machines were down.
Looking at the formula, can someone tell me why I'm getting that error?
Thank You.