Показать сообщение отдельно
Старый 29.09.2017, 13:12   #1  
Blog bot is offline
Blog bot
Участник
 
25,646 / 848 (80) +++++++
Регистрация: 28.10.2006
alirazazaidi: float value conversion in string SSRS expression and decimal points SSRS dynamics ax 2012 R3.
Источник: https://www.tech.alirazazaidi.com/fl...cs-ax-2012-r3/
==============





Today I have to record very small tip. During development of on SSRS report for Dynamics Ax 2012 R3, End user wants a row at the report footer for  analysis. he wants some kind of percentage  calculation with ‘%’.  A For this I have to use CStr ssrs expression function  like


Ctr(((sum(DataSet!field.Value) / sum(DataSet!field.Value)))*100)+”%”.

Now it is string and shows number of decimal as it result from division. For example  5.4356333. But end user wants formatting like 5.43 .

It is string or text value and SSRS textbox formatting is not apply on it.



Following SSRS expression works for me.






Left(CStr(5.4356333),instr(CStr(5.4356333),”.”)+2)



My Updated expression is something like this


Left(CStr(IIF(Parameters!ProductionReportBM2DS_ItemName.Value = “ITEM-00000420”,((sum(Fields!Scrap.Value)/sum(Fields!TotalConsumption.Value))*100),((sum(Fields!CutLength.Value)/sum(Fields!TotalConsumption.Value))*100))),instr(CStr(IIF(Parameters!ProductionReportBM2DS_ItemName.Value = “ITEM-00000420″,((sum(Fields!Scrap.Value)/sum(Fields!TotalConsumption.Value))*100),((sum(Fields!CutLength.Value)/sum(Fields!TotalConsumption.Value))*100))),”.”)+2) +”%”

Источник: https://www.tech.alirazazaidi.com/fl...cs-ax-2012-r3/
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.