CrystalReportsFormulas
I am comparing against Crystal Reports looking for new reporting tool.
I need to make a formula I think this may be a calculate column but how do i do make the expression. Figured out how to make the Calculated Col just can't get valid expression wiht an IF.
I have a value in a row/col I need a formula that returns text based on that:
if (ticket.scalenumber) > 0
{
"Scale " + ticket.scalenumber // Use the scale No
}
else
{
"No Scale Used"
}
I tried
[IIf([TKDetail.Ticket.GrossScale]>0,"Scale "+[TKDetail.Ticket.GrossScale],"No Scale Used.")]
I get all kinds of errors if I put this in a Calulated Col OR I also tried making a Parameter.
I used the formula for IIf by double-clicking on it so it would make proper syntax, but it doesn't work i get CS error 1525 and CS1002
I find very little documentation
Thanks for your help...
Doug
I need to make a formula I think this may be a calculate column but how do i do make the expression. Figured out how to make the Calculated Col just can't get valid expression wiht an IF.
I have a value in a row/col I need a formula that returns text based on that:
if (ticket.scalenumber) > 0
{
"Scale " + ticket.scalenumber // Use the scale No
}
else
{
"No Scale Used"
}
I tried
[IIf([TKDetail.Ticket.GrossScale]>0,"Scale "+[TKDetail.Ticket.GrossScale],"No Scale Used.")]
I get all kinds of errors if I put this in a Calulated Col OR I also tried making a Parameter.
I used the formula for IIf by double-clicking on it so it would make proper syntax, but it doesn't work i get CS error 1525 and CS1002
I find very little documentation
Thanks for your help...
Doug
Comments
You may use:
1) calculated column (set its DataType and Expression properies);
2) report parameter (set its DataType and Expression properies);
3) private/public method in the report script;
4) custom function from your application (you need to register it, to make it available in the data window).
You don't need outer brackets unless you printing this in the Text object. Also don't forget about typecasting (if the GrossScale column is of numeric type):
"Scale "+[TKDetail.Ticket.GrossScale].ToString()