CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 11 of 11
  1. #1
    Join Date
    Jul 2005
    Location
    Chennai
    Posts
    39

    Question How to use the Thousand Seperators In Crystal Report 8.5

    Hi!

    I am developing a accounting application using visual basic and ms access.
    then i use the crystal report 8.5 for report.

    plz explain how to use the thousand seperator formula in number field.

    like Rs.5,55,555.00

    when i applied the thousand seperator formula

    it should be displayed like this :

    Rs 55,555,55.00

    what can i do for these problem plz explain.


    then one more doubt is there :

    how to use the crystal report in asp page.

    plz have u got any source plz send me.

    thanks in advance.

  2. #2
    Join Date
    Jul 2004
    Location
    Chennai, India
    Posts
    1,064

    Re: How to use the Thousand Seperators In Crystal Report 8.5

    What is your desired output?
    Rs 55,555,55.00 or 5,55,555.00?
    Madhivanan

    Failing to plan is Planning to fail

  3. #3
    Join Date
    Jul 2005
    Location
    Chennai
    Posts
    39

    Re: How to use the Thousand Seperators In Crystal Report 8.5

    hi mathivanan!

    i like the following format

    indian currency format

    Rs : 5,55,55,555.00


    plz explain
    Last edited by tks_muthu; July 12th, 2005 at 02:11 AM.

  4. #4
    Join Date
    Jul 2004
    Location
    Chennai, India
    Posts
    1,064

    Re: How to use the Thousand Seperators In Crystal Report 8.5

    Create a formula having this code
    Code:
    StringVar Amt; 
    StringVar s; 
    NumberVar N; 
    Amt:=Replace(Totext({AmountField}),",",""); 
    s:=left(Amt,len(Amt)-3); 
    N:=len(s); 
    Select N 
    case 4: 
    left(s,1)&","& right(s,3) & ".00" 
    case 5: 
    left(s,2)&","& right(s,3)& ".00" 
    case 6: 
    left(s,1)&","& mid(s,2,2) & "," & right(s,3)& ".00" 
    case 7: 
    left(s,2)&","& mid(s,3,2) & "," & right(s,3)& ".00" 
    case 8: 
    left(s,1)&","& mid(s,3,2) & "," & mid(s,6,2) & "," & right(s,3)& ".00" 
    case 9: 
    left(s,2)&","& mid(s,3,2) & "," & mid(s,6,2) & "," & right(s,3)& ".00" 
    default: 
    s;
    and place it in the details section
    Madhivanan

    Failing to plan is Planning to fail

  5. #5
    Join Date
    Jul 2005
    Location
    Chennai
    Posts
    39

    Re: How to use the Thousand Seperators In Crystal Report 8.5

    hi mathi!

    when i am using the formula!
    i got the error message

    "The Formula Result Must be a Boolean"
    here u also use ToText Function but its fired error.

    what can i do for these problem plz explain.


    StringVar Amt;
    StringVar s;
    NumberVar N;

    Amt:=Replace(Totext({product_details.prod_price}),",","");
    s:=left(Amt,len(Amt)-3);
    N:=len(s);

    Select N
    case 4:
    left(s,1)&","& right(s,3) & ".00"
    case 5:
    left(s,2)&","& right(s,3)& ".00"
    case 6:
    left(s,1)&","& mid(s,2,2) & "," & right(s,3)& ".00"
    case 7:
    left(s,2)&","& mid(s,3,2) & "," & right(s,3)& ".00"
    case 8:
    left(s,1)&","& mid(s,3,2) & "," & mid(s,6,2) & "," & right(s,3)& ".00"
    case 9:
    left(s,2)&","& mid(s,3,2) & "," & mid(s,6,2) & "," & right(s,3)& ".00"
    default:s;

  6. #6
    Join Date
    Jul 2004
    Location
    Chennai, India
    Posts
    1,064

    Re: How to use the Thousand Seperators In Crystal Report 8.5

    It should work correctly
    Check again whether you miss something in the code
    Madhivanan

    Failing to plan is Planning to fail

  7. #7
    Join Date
    Jul 2005
    Location
    Chennai
    Posts
    39

    Re: How to use the Thousand Seperators In Crystal Report 8.5

    Hi MathiVanan!

    your code is working properly!

    thanking you.

  8. #8
    Join Date
    Jul 2004
    Location
    Chennai, India
    Posts
    1,064

    Re: How to use the Thousand Seperators In Crystal Report 8.5

    Well
    How did you have problem initially?
    Madhivanan

    Failing to plan is Planning to fail

  9. #9
    Join Date
    Jul 2005
    Location
    Chennai
    Posts
    39

    Question Re: How to use the Thousand Seperators In Crystal Report 8.5

    Hi Mathy!

    actually i am applying the function to the price field object using

    Field Object --> Format -->Number Format-->
    Thousand Seperator -->Choose the Formula Editor

    later i just create a new formula field and applying this code.
    and then drag the formula field in my report page
    it working properly.


    thanks mathi!


    muthu

  10. #10
    Join Date
    Apr 2011
    Posts
    1

    Resolved Re: How to use the Thousand Seperators In Crystal Report 8.5

    hi all,
    your posting in this page is very useful to me... I thank all of u...

    I changed that coding slitly for decimal places...

    StringVar Amt;
    StringVar s;
    StringVar s1;
    NumberVar N;
    Amt:=Replace(Totext({AmtFieldName}),",","");
    s:=left(Amt,len(Amt)-3);
    s1:=right(Amt,2);
    N:=len(s);
    Select N
    case 1:
    s & "."& s1
    case 2:
    s & "."& s1
    case 3:
    s & "."& s1
    case 4:
    left(s,1)&","& right(s,3) & ".00"
    case 5:
    left(s,2)&","& right(s,3)& ".00"
    case 6:
    left(s,1)&","& mid(s,2,2) & "," & right(s,3)& ".00"
    case 7:
    left(s,2)&","& mid(s,3,2) & "," & right(s,3)& ".00"
    case 8:
    left(s,1)&","& mid(s,3,2) & "," & mid(s,6,2) & "," & right(s,3)& ".00"
    case 9:
    left(s,2)&","& mid(s,3,2) & "," & mid(s,6,2) & "," & right(s,3)& ".00"
    default:

    It is working very properly... once again thanks a lot...
    With Love
    Rohith Thangaraj

  11. #11
    Join Date
    Jan 2008
    Posts
    19

    Re: How to use the Thousand Seperators In Crystal Report 8.5

    Quote Originally Posted by tks_muthu View Post
    hi mathi!

    when i am using the formula!
    i got the error message

    "The Formula Result Must be a Boolean"
    here u also use ToText Function but its fired error.

    what can i do for these problem plz explain.


    StringVar Amt;
    StringVar s;
    NumberVar N;

    Amt:=Replace(Totext({product_details.prod_price}),",","");
    s:=left(Amt,len(Amt)-3);
    N:=len(s);

    Select N
    case 4:
    left(s,1)&","& right(s,3) & ".00"
    case 5:
    left(s,2)&","& right(s,3)& ".00"
    case 6:
    left(s,1)&","& mid(s,2,2) & "," & right(s,3)& ".00"
    case 7:
    left(s,2)&","& mid(s,3,2) & "," & right(s,3)& ".00"
    case 8:
    left(s,1)&","& mid(s,3,2) & "," & mid(s,6,2) & "," & right(s,3)& ".00"
    case 9:
    left(s,2)&","& mid(s,3,2) & "," & mid(s,6,2) & "," & right(s,3)& ".00"
    default:s;
    I am new to Crystal Report. I am using Crystal Report 8.5. Please explain in Detail how to use above formula for getting result ?(Thousand Separtor)?

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured