简体   繁体   中英

How can I write Crystal Report Expression to Vb code?

I'am new to crystal reports and I'am Working on Active Report Jap 9.5 version . I have recently started working on them and I want to know whether the crystal report expressions can be converted to an equivalent vb code, so I can use them in Active report(SSRS),(.rdlx)

Also the below crystal report expressions by itself looks like sort of vb code(someone correct me if I am wrong).

Crystal report formula:

A)Formula 1:

numberVar iDay := ToNumber(Right(Cstr({@PrntStartDate}), 2)) + 24; select iDay case 1 : {wk_TORIO0430_b.AcquisitionAmnt1} case 2 : {wk_TORIO0430_b.AcquisitionAmnt2} case 3 : {wk_TORIO0430_b.AcquisitionAmnt3}

B)Formula 2:

numberVar iDay;
stringvar sDay;

If (12 <= ToNumber({?NoOfDays})) Then
numberVar iDay := ToNumber (Right ({?StartDate}, 2)) + 11;

if iDay < 10 then
sDay := "0" + left(Cstr(iDay), 1)
else
sDay :=  left(Cstr(iDay), 2);
sDay + "(" + Left(WeekDayName(WeekDay(CDate (ToNumber (Left ({?StartDate},4)),ToNumber (Mid ({?StartDate}, 5, 2)) , iDay))), 1) +  ")";

C)Formula 3:

numberVar iPos1 := InStr({?StartDate}, "年");
numberVar iPos2 := InStr({?StartDate}, "月");

numberVar iPos3 := InStr({?StartDate}, "日");

stringVar sYr := left ({?StartDate}, 2);

stringVar sMonth := mid ({?StartDate}, iPos1 + 2, (((iPos2) - (iPos1)-3)));

sMonth := IIF (Length(sMonth) = 1, "0" + sMonth, sMonth);

stringVar sDay := mid ({?StartDate}, iPos2 + 2, (((iPos3) - (iPos2)-3)));

sDay := IIF (Length(sDay) = 1, "0" + sDay, sDay);

Now can I convert this crystal formula into vb code? Please help me.

You don't need to convert this code to VB. If you have RPT files, you can use the built-in converter tool in ActiveReports to convert your crystal reports to RDL. RDL reports also have built-in expression support. The expressions are similar to MS and SSRS and not as involved as the code you've provided. If you continue to have trouble, or need more guidance, you can submit a support ticket at supportone.componentone.com.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM