CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Guest

    How to pass query from VB form to Crystal Report Designer Component

    I am a beginner programmer in VB. I have a form from which the user can query the database in Access. I am using DAO. I also want to print a report but I don't know how to pass the query from VB form to Crystal Report Designer Component or Microsoft Data Report.

    If anybody has sample code or knows site where I can get help , please let me know.
    My email address is
    [email protected]

    Thanks in advance.


  2. #2
    Join Date
    Aug 1999
    Location
    Srilanka
    Posts
    25

    Re: How to pass query from VB form to Crystal Report Designer Component

    It depends on on what version you are using. The newer versions of crystal allows the programmer to pass parameters in away to the report to retrive data.
    The best way is to create a temp db at run time, run the query you want on the live db and update the neccesary data for the report into the temp db. Delete the temp db after displaying the report using the temp db.
    Also U can use queries defined in the access database in your reports. Hope this helps you.

    Amendra


  3. #3
    Guest

    Re: How to pass query from VB form to Crystal Report Designer Component

    hope this can help you abit.

    text1.Text = tmp1
    test2.Text = tmp2
    tmp1 = Format(text1.text, "YYYY-MM-DD")
    tmp2 = Format(text2.text, "YYYY-MM-DD")

    Crystalreport1.SqlQuery = "SELECT * FROM Customer WHERE JointDate BETWEEN '" & tmp1 & "' AND '" & tmp2 & "' ORDER BY CustID ASC ", dbSQLpassThrough
    CrystalRerpot1.action = 1

    regards...
    loader



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