CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Aug 2001
    Location
    The Netherlands, near germany
    Posts
    42

    display one record

    Can somebody tell me how I can show one record in Crystal Reports from vb6. I Go from form1 to a crystal report and there I want to show one record that I selected in form1. How can I give the variable through? So form1 gives the value 1 through to chrystal reports and chrystal reports display record nr. 1. Where do I put the variable, only in vb6 or also in Crystal Reports? And where?

    Remco Ploeg
    [email protected]

  2. #2
    Join Date
    Mar 2001
    Posts
    71

    Re: display one record

    First in crystal report create a report
    then there is a method of crstalreport ocx named 'replaceselectionformula'.
    you will have to use this method to filter the data that the crystalreport is supposed to show

    suppose u have a table named 'TABLE1'
    and u have columns named ID,NAME,AGE,SEX

    Now in vb u will write:
    Report1.replaceselectionformula("TABLE1.ID = somevalue")
    Report1.action = 1
    This will ensure that the crystalreport shows the record for onle the id that u have supplied.

    Hope it helps


  3. #3
    Join Date
    Aug 2001
    Location
    The Netherlands, near germany
    Posts
    42

    Re: display one record

    what do you mean with replaceselectionformula. Where can i find that in crystral report?

    Remco Ploeg
    [email protected]

  4. #4
    Join Date
    Aug 2001
    Location
    The Netherlands, near germany
    Posts
    42

    Re: display one record

    So I have form1 there I have got a ID from a customer, now I want to print that customer. So I made a crystal report with a sql query but there is ID = 5. Now When I push the button to start making the report, i want to overrule that sqlstatement in crystal report, with a sql statement that is in the code of the action button. Can I do that? So then I see 1 customer on my screen and not ID5. But the ID where I'am standing on. I made already a variable for that. But how can I make the select statement with the variable in crystal reports?

    Remco Ploeg
    [email protected]

  5. #5
    Join Date
    Mar 2001
    Posts
    71

    Re: display one record

    'replaceselectionformula' is a method of CRYSTAL REPORT CONTROL which is available as an activex control to be used in vb.

    You won't find that method on Crystal Report


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