Error CS0019: Operator '/' cannot be applied...

edited 7:40PM in FastReport .NET
Hi! I'm a new user to FAST Reports (experienced Crystal Reports user), and I'm trying to create a Parameter to place in the Data band on a report. It is called $/MH. It is set as a Decimal DataType. The expression I'm trying to get to work is:

[Total_Labor]/IIf([BOQ_Table.HOURS] ==0, 1, [BOQ_Table.HOURS])

[Total_Labor] is another Parameter, DataType = Decimal. Total_Labor is a formula of 2 datafields that are each Decimal datatypes. [BOQ_Table.HOURS] is a datafield, DataType = Decimal. I've tried all manners of trying to get this expression to work and it keeps returning the Error Msg:

$/MH: Error CS0019: Operator '/' cannot be applied to operands of type 'decimal'and 'object'.

I had already created 4 other parameters using the same syntax that are working but they are on Group Footer bands. They are all Variant datatypes. The syntax of them is:

[G3 LaborTotal]/IIf([G3 HoursTotal]==0, 1,[G3 HoursTotal])

[G3 LaborTotal] is a Total of a data field BOQ_URB1 which is Labor$. It is a Decimal DataType.

[G3 HoursTotal} is a Total of a data field BOQ_HOURS which is Labor HOURS. It too, is a Decimal DataType.

Why is one of these Parameter expressions not working but 4 others with the same syntax working?

Thanks,

Mike

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.