Results 1 to 4 of 4

Thread: [RESOLVED] Help in creating a formula

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2006
    Posts
    274

    Resolved [RESOLVED] Help in creating a formula

    I am on creating an Accounts Receivable report with Crystal Reports wherein I am using a Select Query coming from my Access database and vb.net 2005 as my front end application.Now, on the query there were fields PatientName and Company.Basically, a Patient would have a Company that would shoulder his/her charges, but on some occasions there was none so the charges would be named to themselves.Using this scenario, I made my report grouped by Company's name in ascending order and make a formula field named @Patient with the code goes like this:
    VB Code:
    1. 'Crystal Report Code
    2. if {AccountReceivable.Company}="" then {AccountReceivable.PatientName} else {AccountReceivable.Company}

    My logic here is that when a Patient does not have a Company, then his/her name would be displayed on the report where this formula was situated.Seems that it is not behaving the way it should be.Am I missing somthing here guys?Hope you figure it out for me.Should you need further infos or an attachments perhaps, feel free to ask...Thanks.

  2. #2
    Just Married shakti5385's Avatar
    Join Date
    Mar 2006
    Location
    Udaipur,Rajasthan(INDIA)
    Posts
    3,747

    Thumbs up Re: Help in creating a formula

    The formula make by you is working properly then where you are getting the problem.Is it not working properly.
    If your formula not working properly then pass a sql query that select those patient they have a company in this way there is no need of formula here.
    Because you sorted the data directly with the query.

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2006
    Posts
    274

    Re: Help in creating a formula

    I finally find to make this work.I manage to check if the field is null first.Here's my revised code:
    VB Code:
    1. 'CrystalReport Code
    2.  if isnull({@Company}) then {AccountReceivable.Name} else {AccountReceivable.Company}
    where @Company is another formula with code that goes like this:
    VB Code:
    1. 'CrystalReport Code
    2. if {AccountReceivable.Company}<>"" then {AccountReceivable.Company} else {AccountReceivable.Name}

  4. #4
    Just Married shakti5385's Avatar
    Join Date
    Mar 2006
    Location
    Udaipur,Rajasthan(INDIA)
    Posts
    3,747

    Arrow Re: Help in creating a formula

    so did you get your solution

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