Results 1 to 6 of 6

Thread: how pass values to crystal report?

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Feb 2008
    Posts
    97

    how pass values to crystal report?

    hi,
    i have build a report that retrieve all data from db and all works fine but now
    i want pass values from the app without using the db
    like we have the report.title and report.author there is any way to acess the objects of the report and change them in runtime?
    thanks for your help

  2. #2
    Frenzied Member
    Join Date
    Aug 2006
    Location
    India, Punjab, Bhatinda
    Posts
    1,689

    Re: how pass values to crystal report?

    create an object of the report in the app then go down the heierarchy of each section something like....
    Code:
    Report.Sections(1).ReportObjects(1).SetText yourValue

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Feb 2008
    Posts
    97

    Re: how pass values to crystal report?

    hi,
    thanks for your help
    but in version that i use ( 6) i don´t have.
    i have parameters filter that i don´t know what is for
    do you know where can i find a manual of this ocx version 6 thanks

  4. #4
    Frenzied Member
    Join Date
    Aug 2006
    Location
    India, Punjab, Bhatinda
    Posts
    1,689

    Re: how pass values to crystal report?

    Parameters are used to receive values during runtime from user or other appln.
    For eg. you designed your report to view all records but you want during runtime to view records say for a city input by user you can use parameter fields in combination with select Expert.

  5. #5
    Member
    Join Date
    Mar 2008
    Posts
    47

    Re: how pass values to crystal report?

    Hi jason78944545,

    What Version of Crystal Reports are you using?

  6. #6
    Frenzied Member pnish's Avatar
    Join Date
    Aug 2002
    Location
    Tassie, Oz
    Posts
    1,918

    Re: how pass values to crystal report?

    It's been a long time since I've used the Crystal OCX but I believe you need to do something like this:

    In your report create a new formula, eg ReportHeading. In the formula just place two empty quotation marks, ie "". Save the formula.

    Place the formula on your report and format it how you want it to appear, ie font, size etc. Save the report.

    When you call the report from your program, add this line:
    Report1.Formulas(0) = "ReportHeading='This is my Report Heading'"
    Note the two single quotes around the text you're passing to the formula.

    If you have more than one formula, you need to increment the index each time, eg
    Report1.Formulas(1) = "SubHeading='This is a Sub Heading'"
    Report1.Formulas(2) = "SubHeading2='This is another Sub Heading'"

    and so on...

    I hope that helps.
    Pete

    No trees were harmed in the making of this post, however a large number of electrons were greatly inconvenienced.

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