Crystal report

摘要:Crystal report

Crystal report

l          StringVar message := "Special ";

l          ü tick symbol

 Sample Code 1

stringVar QTY :=  " - " & ToText ({DRRPT002;1.Qty}) & " Unit(s) ";

if {DRRPT002;1.Qty} = 0
then QTY := "";

stringVar printString := {DRRPT002;1.Fee_Code} & ' - ' & {DRRPT002;1.Fee_Code_EngDesc} & QTY ;
//stringVar printString := {DRRPT002;1.Fee_Code} & ' - ' & {DRRPT002;1.Fee_Code_EngDesc} & QTY & {DRRPT002;1.Actual_Time};

stringVar Blood_Transfusion_1 :="";
stringVar Blood_Transfusion_2 :="";
stringVar Blood_Transfusion_3a :="";
stringVar Blood_Transfusion_3b :="";
stringVar Blood_Transfusion_3c :="";
stringVar Blood_Transfusion_4 :="";
stringVar Blood_Transfusion_5 :="";

stringVar Constantstr :="Unknown";

if {DRRPT002;1.Blood_Transfusion_HB} = 0 then
Blood_Transfusion_1 := " *- Hb : " & Constantstr
else
Blood_Transfusion_1 := " *- Hb : " & {DRRPT002;1.Blood_Transfusion_HB} & " g/dL";

if {DRRPT002;1.Blood_Transfusion_WBC} = 0 then
Blood_Transfusion_2 := " *- WBC : " & Constantstr  
else
Blood_Transfusion_2 := " *- WBC : " & {DRRPT002;1.Blood_Transfusion_WBC} & " x10 ^9/L";

if {DRRPT002;1.Blood_Transfusion_PT} = 0 then
Blood_Transfusion_3a := " *- PT : " & Constantstr  
else
Blood_Transfusion_3a := " *- PT : " & {DRRPT002;1.Blood_Transfusion_PT} & " Sec.";

if {DRRPT002;1.Blood_Transfusion_INR} = 0 then
Blood_Transfusion_3b := " *- INR : " & Constantstr  
else
Blood_Transfusion_3b := " *- INR : " & {DRRPT002;1.Blood_Transfusion_INR} ;

if {DRRPT002;1.Blood_Transfusion_APTT} = 0 then
Blood_Transfusion_3c := " *- APTT : " & Constantstr
else
Blood_Transfusion_3c := " *- APTT : " & {DRRPT002;1.Blood_Transfusion_APTT} & " Sec.";

if {DRRPT002;1.Blood_Transfusion_Platelet} = 0 then
Blood_Transfusion_4 := " *- Platelet : " & Constantstr  
else
Blood_Transfusion_4 := " *- Platelet : " & {DRRPT002;1.Blood_Transfusion_Platelet} & " x10 ^9/L";

if {DRRPT002;1.Blood_Transfusion_Fibrinogen} = 0 then
Blood_Transfusion_5 := " *- Fibrinogen : " & Constantstr
else
Blood_Transfusion_5 := " *- Fibrinogen : " & {DRRPT002;1.Blood_Transfusion_Fibrinogen} & " g/L";




stringVar Blood_Gas_Type :="";

select {DRRPT002;1.Blood_Gas_Type}
case 1 :  Blood_Gas_Type := " (capillary)"
case 2 : Blood_Gas_Type := " (arterial)"
case 3 : Blood_Gas_Type := " (venous)";

if {DRRPT002;1.Fee_Code} <> '' then  
(

select {DRRPT002;1.Fee_Code}  

case '0028W' : printString & Blood_Transfusion_1  
case '0028B' : printString & Blood_Transfusion_2  
case '0257F' : printString & Blood_Transfusion_3a & Blood_Transfusion_3b & Blood_Transfusion_3c
case '0257P' : printString & Blood_Transfusion_4  
case '0257C' : printString & Blood_Transfusion_5  
case '0091' : printString & Blood_Gas_Type

case '0107' : printString & " - time : " & {DRRPT002;1.Creatinine_Blood_Date}
case '0103A' : printString & " - " & Time({DRRPT002;1.Immunology_Time_AM})
case '0103P' : printString & " - " & Time({DRRPT002;1.Immunology_Time_PM})

default : printString & {DRRPT002;1.Actual_Time};


)
else
    if ltrim(rtrim({DRRPT002;1.Fee_Code_EngDesc})) <> '' then
        'Other - ' & {DRRPT002;1.Fee_Code_EngDesc}

 


Sample code 2

 

stringVar StrA := "";
stringVar StrB := "";
stringVar StrC := "";
stringVar StrD := "";
stringVar StrE := "";
stringVar StrF := "";
stringVar StrTotal := "";

//chr(13)

stringVar StrBa := "";
stringVar StrBb := "";

if {DRRPT002;1.Cancel_Request} = true then
StrBa := " If not available Cancel Request";

if {DRRPT002;1.Draw_Blood_Again} = true then
StrBb := " If not available Draw blood again";



if {DRRPT002;1.Fasting} = true then
StrA := " Fasting NPO From "& {DRRPT002;1.Fasting_Time} &",";

if {DRRPT002;1.Old_Sample} = true then
StrB := " Old Sample - "& {DRRPT002;1.Old_Sample_Desc} & StrBa & StrBb & ",";

if {DRRPT002;1.Save_Serum} = true then
StrC := " Save Serum"& ",";

if {DRRPT002;1.Save_Serum_for_X_Match} = true then
StrD := " Save EDTA sample for transfusion"& ",";

if {DRRPT002;1.Stat_Report} = true then
StrE := " Stat Report"& ",";

if {DRRPT002;1.Stat_Phlebotomy} = true then
StrF := " Stat Phlebotomy"& ",";


StrTotal := StrA  + StrB  + StrC + StrD+ StrE  + StrF;
if Length (StrTotal) >0 then  
StrTotal := Left (StrTotal, Length (StrTotal)-1);

StrTotal

 

 

 

------------------

熱愛生命 喜愛新奇 有趣的事物

 

過去 是無法改變
將來 卻能夠創造

 

希望使大家生活更便利
世界更美好

 

a guy who loves IT and life