Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2004

    Unanswered: How to show report from VB by dynamic Sql

    Hi All,
    I am in trouble,
    I want to show the crystal report using VB6 and I want to generate report depending on the dynamic sql on run time selection of fields of query.
    How can I do this.
    Please Reply soon.
    Also let me know how to integrate the crystal report with vb6.
    Thanks in advance.

  2. #2
    Join Date
    Aug 2004
    Hi priya_79,

    I had the same problem and solved it with this:

    Dim Report As New CrystalReport1

    Private Sub Form_Load()
    Screen.MousePointer = vbHourglass
    Report.Database.LogOnServer "p2sodbc.dll", "servername", "databasename", "username", "password"
    Report.ParameterFields(1).AddCurrentValue (Command)
    CRViewer1.ReportSource = Report
    Screen.MousePointer = vbDefault

    End Sub

    This passes just one parameter to crystal but you can increase the number of parameters passed using the Report.ParameterFields(1). (Just increase the number).

    To include your Crystal report in VB6 choose Project/Add Crystal Report 8.5/From existing report - and select the report you have written.


  3. #3
    Join Date
    Feb 2004
    Bangalore, Karnataka, India


    Let me know whether you are using the Cyrstal reports object control or crystal reports view control.
    do you want to design a report in run time or you want to fire a report when some click event occurs..

Posting Permissions

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