Page 1 of 2 12 LastLast
Results 1 to 15 of 16
  1. #1
    Join Date
    Dec 2004
    Location
    gujarat, india
    Posts
    32

    Question Unanswered: Calling Crystal Reports From Vb (urgent)

    i am new to crystal reports 8.5
    and i want to call rpt file at runtime from vb without using crystal reports viewer i am using crystal report control

    Also i want to change the datasource or database of rpt file at runtime.

    Can any body help me??????????

    pls ...............

    thanks
    zenil
    Last edited by zenilshroff; 12-11-04 at 09:53. Reason: better view

  2. #2
    Join Date
    Oct 2003
    Posts
    357
    Hi, try this
    Code:
    CR.Datasource='Data source'
    CR.ReportFileName='Path of the File'
    CR.Show
    Madhivanan
    Last edited by Madhivanan; 12-13-04 at 01:20.

  3. #3
    Join Date
    Dec 2004
    Location
    gujarat, india
    Posts
    32

    reply

    thanks madhvan,
    but i cant change sql of crystal report control at runtime i have to get different datas from single report.

    can u pls help?

    Regards
    Zenil

  4. #4
    Join Date
    Oct 2003
    Posts
    357
    Do you want to generate report by using different queries?

    Madhivanan

  5. #5
    Join Date
    Dec 2004
    Location
    gujarat, india
    Posts
    32
    yes exactly, i want to generate report using different sql queries.

    Regards
    Zenil

  6. #6
    Join Date
    Oct 2003
    Posts
    357

    Thumbs up

    Hi, try this
    Code:
    CR.DiscardSavedData=True
    CR.Sqlquery='Query'
    CR.ReportFileName='Path of the File'
    CR.Show
    Madhivanan

  7. #7
    Join Date
    Dec 2004
    Location
    gujarat, india
    Posts
    32

    thanks

    Dear Madhvan,
    Thanks for ur post reply,

    Can i change connection at runtime, currently i am using "MTXDSN" as connection and in future i have to change dsn at runtime can i do it.

    Pls also describe how can i do it?

    Regards
    Zenil

  8. #8
    Join Date
    Oct 2003
    Posts
    357
    Code:
    Dim crApp As New CRAXDRT.Application
    crRepp.Database.LogOnServer "p2ssql.dll", Trim(Server), Trim(Database), Trim(UserName), Trim(Password)
    Madhivanan

  9. #9
    Join Date
    Dec 2004
    Location
    gujarat, india
    Posts
    32
    Dear Madhivanan,
    I am using access database for dsn so i cant log on to server.

    Pls revert me if you have any alternative.

    Regards
    Zenil

  10. #10
    Join Date
    Oct 2003
    Posts
    357
    Dim Crapp As New CRAXDRT.Application
    Dim CrRpt As CRAXDRT.Report

    CrRpt.Database.SetDataSource ("DsnName")

    Madhivanan

  11. #11
    Join Date
    Dec 2004
    Location
    gujarat, india
    Posts
    32
    how can i change datasource with crystal report control

    it given an error datasource property is write only.

    pls look at it and revert.

    Regards
    Zenil

  12. #12
    Join Date
    Oct 2003
    Posts
    357
    In the menu Database-->Set DataSource Location and change DB in Replace with

    Madhivanan

  13. #13
    Join Date
    Dec 2004
    Location
    gujarat, india
    Posts
    32
    Dear Madhivanan,
    Sorry to disturb you, But pls explain briefly i am not getting ur advise!!!!!!!!!!!!!!


    Zenil

  14. #14
    Join Date
    Oct 2003
    Posts
    357
    This can be done by opening the Crystal Report in Design mode.

    Madhivanan

  15. #15
    Join Date
    Dec 2004
    Location
    gujarat, india
    Posts
    32
    madhivanan,
    i am not using *.dsr for report, i am calling rpt file from vb using crystal report control and not crystal report viewer control

    if u have solution pls revert.

    Zenil

Posting Permissions

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