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

Comments

  • edited 8:56AM
    Hello,

    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).
    wrote:
    I tried
    [IIf([TKDetail.Ticket.GrossScale]>0,"Scale "+[TKDetail.Ticket.GrossScale],"No Scale Used.")]
    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()

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.