Search code examples
asp.netmodel-view-controllercrystal-reports

how to concatenate number values with the URL in crystal report formula


I need to add fixed values to the URL how to add the values to the URL this is the formula code :

stringvar replaceid := Replace(totext({GET_ALLORDER_RESULT_PRINT_CASH;1.order number}),",",""); 
stringvar replaceids := Replace(replaceid,".00",""); 

numberVar testid = 6438;
numberVar deptid = 11;
numberVar culture = 2;

stringVar barcodeInput:=  "http://www.store.com/RPT/WebForm1.aspx?order_id="&""&replaceids;

How to add testid , deptid and culture at the end of URL barcodeInput in crystal report formula

I need to call and open URL with these variables , I need your help please .


Solution

  • Your formula has multiple issues:

    1. You seem to try to format the number with Replace. This can be done with ToText, if used correctly.
      (Just highlight ToText in formula editor and press F1)
    2. = does not assign a value to the numberVar variables. Use := for assignment.
    3. The variable barcodeInput is not required

    The following should work:

    stringVar orderid := ToText({GET_ALLORDER_RESULT_PRINT_CASH;1.order number},0,"");  
    
    numberVar testid := 6438;
    numberVar deptid := 11;
    numberVar culture := 2;
    
    "http://www.store.com/RPT/WebForm1.aspx?" &
    "order_id=" & orderid &
    "&testid=" & ToText(testid,0,"") &
    "&deptid=" & ToText(deptid,0,"") &
    "&culture=" & ToText(culture,0,"");