Converting Crystal to Stimulsoft
Converting Crystal to Stimulsoft
We are migrating over to Stimulsoft and I am working on learning the syntax.
Could I get some help converting this Crystal Syntax?
if {CustCode.CustCode} startswith "L-3" and (today-{OrderDet.User_Date2}) < 180 then "Short Life Material" else
if {CustCode.CustCode} startswith "HARR" and (today-{OrderDet.User_Date2}) < 180 then "Short Life Material" else
if {Estim.ProdCode} startswith "NITROG" then "NITROGEN CONTROLLED - DO NOT OPEN" ELSE ""
Could I get some help converting this Crystal Syntax?
if {CustCode.CustCode} startswith "L-3" and (today-{OrderDet.User_Date2}) < 180 then "Short Life Material" else
if {CustCode.CustCode} startswith "HARR" and (today-{OrderDet.User_Date2}) < 180 then "Short Life Material" else
if {Estim.ProdCode} startswith "NITROG" then "NITROGEN CONTROLLED - DO NOT OPEN" ELSE ""
-
- Posts: 6259
- Joined: Tue Mar 20, 2018 5:34 am
Re: Converting Crystal to Stimulsoft
Hello,
Please check the following expression:
Thank you.
Please check the following expression:
Code: Select all
{IIF((Left(CustCode.CustCode, 3) == "L-3" && DateDiff(Today, OrderDet.User_Date2).Days < 180), "Short Life Material",
IIF((Left(CustCode.CustCode, 4) == "HARR" && DateDiff(Today, OrderDet.User_Date2).Days < 180), "Short Life Material",
IIF(Left(Estim.ProdCode,6) == "NITROG", "NITROGEN CONTROLLED - DO NOT OPEN", "")))}
Re: Converting Crystal to Stimulsoft
Lech, this works great! Thank you so much!
Re: Converting Crystal to Stimulsoft
Lech, any chance you could take a whack at this? Aleksey wasn't sure with the DateDiff and DateAdd functions
ToText(DateDiff('d',currentdate+0,{DateAdd('m',{ToNumber({Estim.User_Text2})},{OrderDet.User_Date1})}) / (DateDiff('d',{OrderDet.User_Date1},{DateAdd('m',{ToNumber({Estim.User_Text2})},{OrderDet.User_Date1})})*100))
ToText(DateDiff('d',currentdate+0,{DateAdd('m',{ToNumber({Estim.User_Text2})},{OrderDet.User_Date1})}) / (DateDiff('d',{OrderDet.User_Date1},{DateAdd('m',{ToNumber({Estim.User_Text2})},{OrderDet.User_Date1})})*100))
-
- Posts: 6259
- Joined: Tue Mar 20, 2018 5:34 am
Re: Converting Crystal to Stimulsoft
Hello,
Please check the following expression:
Thank you.
Please check the following expression:
Code: Select all
{(DateDiff(Today, OrderDet.User_Date1.AddMonths(Estim.User_Text2)).Days /
(DateDiff(OrderDet.User_Date1, OrderDet.User_Date1.AddMonths(Estim.User_Text2)).Days * 1000)).ToString()}
Re: Converting Crystal to Stimulsoft
I will give it a shot. Thank you
-
- Posts: 6259
- Joined: Tue Mar 20, 2018 5:34 am
Re: Converting Crystal to Stimulsoft
Hello,
You are welcome.
You are welcome.
Re: Converting Crystal to Stimulsoft
Lech, this is the error I am getting. "There is no matching overloaded method for 'AddMonths(String)'"
Any ideas?
Currently writing in CSharp
Any ideas?
Currently writing in CSharp
-
- Posts: 6259
- Joined: Tue Mar 20, 2018 5:34 am
Re: Converting Crystal to Stimulsoft
Hello,
Try to use
OrderDet.User_Date1.AddMonths((int)Estim.User_Text2)
Thank you.
Try to use
OrderDet.User_Date1.AddMonths((int)Estim.User_Text2)
Thank you.
Re: Converting Crystal to Stimulsoft
Lech, made some progress with this:
{ (DateDiff(Today, PLMain.Relation.User_Date1.AddMonths((int)PLDet.Relation2.User_Text2)).Days )} / {(DateDiff(PLMain.Relation.User_Date1, PLMain.Relation.User_Date1.AddMonths((int)PLDet.Relation2.User_Text2)).Days * 100).ToString() }
If I make them into 1 formula (below) it gives me the error "There is no matching overloaded method for 'op_Div(Int32,String)'
{ (DateDiff(Today, PLMain.Relation.User_Date1.AddMonths((int)PLDet.Relation2.User_Text2)).Days ) / (DateDiff(PLMain.Relation.User_Date1, PLMain.Relation.User_Date1.AddMonths((int)PLDet.Relation2.User_Text2)).Days * 100).ToString() }
PLMain.Relation.User_Date1 = 10/2/2022
PLDet.Relation2.User_Text2 = 5
If it makes it simpler...the ultimate goal is to figure out (the number of days elapsed since User_Date 1) / ((The total number of days between User_Date1 and User_Text 2) *100)
In this case it would be 8 / 150
{ (DateDiff(Today, PLMain.Relation.User_Date1.AddMonths((int)PLDet.Relation2.User_Text2)).Days )} / {(DateDiff(PLMain.Relation.User_Date1, PLMain.Relation.User_Date1.AddMonths((int)PLDet.Relation2.User_Text2)).Days * 100).ToString() }
If I make them into 1 formula (below) it gives me the error "There is no matching overloaded method for 'op_Div(Int32,String)'
{ (DateDiff(Today, PLMain.Relation.User_Date1.AddMonths((int)PLDet.Relation2.User_Text2)).Days ) / (DateDiff(PLMain.Relation.User_Date1, PLMain.Relation.User_Date1.AddMonths((int)PLDet.Relation2.User_Text2)).Days * 100).ToString() }
PLMain.Relation.User_Date1 = 10/2/2022
PLDet.Relation2.User_Text2 = 5
If it makes it simpler...the ultimate goal is to figure out (the number of days elapsed since User_Date 1) / ((The total number of days between User_Date1 and User_Text 2) *100)
In this case it would be 8 / 150