Results 1 to 8 of 8
  1. #1
    Join Date
    Feb 2005
    Posts
    4

    Unanswered: fetch Numeric value from String

    Hi all,

    I am using Visual Basic v6 and Crystal report 8.5.

    1) 23/ROLLS ; 23/BAGS
    2) 34/ROLLS ; 23/CARTON

    Above are two records, this is '23/ROLLS ; 23/METERS' complete value in field.

    want a sum of all the Units in report footer like this:

    57/ROLLS ; 23/BAGS ; 23/CARTONS

    I fillter all the units values from string with specipfic formula variable.

    Problem:
    1) I did not find mBags (all other units also) variable in Running Total aswell as in sum formula.
    2) It give me only maximum formula only

    Hope u will understand my broblem.
    Please help it is urgent.

    Thanks

  2. #2
    Join Date
    Jan 2005
    Location
    Avon Lake, OH
    Posts
    112

    Question

    Coolguy2,


    Can you post the formulas used to parse the data please?

    Thanks,


    Barry

  3. #3
    Join Date
    Feb 2005
    Posts
    4

    This is the formula

    Thanks Barry for reply,
    Here is the formula:
    ---Start
    Shared stringarray() as String
    Shared arrBags() as String
    stringarray = split({sp_towel_gatepass.Quantity},";")
    Dim counter as Number
    Dim arrayposition as Number
    counter = 1

    Do While counter <= count(stringarray)
    if instr(stringarray(counter),"BAGS") >0 then
    arrBags = split(stringarray(counter), "/")
    formula = tonumber(arrBags(1))
    exit do
    else
    formula = 0
    end if
    counter= counter +1
    Loop
    ---end

    This formula give me all the values in BAGS, and it give correct numeric value in detail section. But I can not sum up it on report footer section.

    Or if u know easy way to do this task, I will thnksfull to u.

    Coolguy

  4. #4
    Join Date
    Oct 2003
    Posts
    357
    Hi Coolguy2

    See this attachment
    Attached Files Attached Files
    Madhivanan

    Failing to plan is Planning to fail

  5. #5
    Join Date
    Feb 2005
    Posts
    4

    Check Data Table

    Thanks Madhivanan,
    I am tring to open report and it give me error of invalid version. I and using crystal report v8.5. I will thanskfull to u if u save this report in 8.5 version.

    And yes I check MDB file and I change the DATA also, Please check it out it will work in your's report example also.

    See attachment, and waiting for u'r reply.

    Coolguy
    Attached Files Attached Files

  6. #6
    Join Date
    Oct 2003
    Posts
    357
    Hi,
    I am using the ver 9. Your modified data dont give the expected result.
    Every value should in different row

    Madhivanan
    Madhivanan

    Failing to plan is Planning to fail

  7. #7
    Join Date
    Feb 2005
    Posts
    4
    Hi Madhivanan,
    That is y im submit this problem in forum.

    any way thanks for u'r help.

    coolguy

    Quote Originally Posted by Madhivanan
    Hi,
    I am using the ver 9. Your modified data dont give the expected result.
    Every value should in different row

    Madhivanan

  8. #8
    Join Date
    Jan 2005
    Location
    Avon Lake, OH
    Posts
    112
    Coolguy2,

    Try changing your original formula to add a shared variable to hold the grand total. Now you can reference that grand total from another formula and place it at the end of the report. See below (changes are in blue).

    Best regards,


    Barry

    ---Start
    Shared stringarray() as String
    Shared arrBags() as String
    Shared TotalBags as Number

    stringarray = split({sp_towel_gatepass.Quantity},";")
    Dim counter as Number
    Dim arrayposition as Number
    counter = 1

    Do While counter <= count(stringarray)
    if instr(stringarray(counter),"BAGS") >0 then
    arrBags = split(stringarray(counter), "/")
    TotalBags = TotalBags + tonumber(arrBags(1))
    formula = tonumber(arrBags(1))
    exit do
    else
    formula = 0
    end if
    counter= counter +1
    Loop
    ---end

    //forTotalBags
    Shared TotalBags as Number
    formula = TotalBags

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •