CRYSTAL REPORT TO Sql SERVER WITH vb6.0

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Vbbeginner07
    New Member
    • Dec 2007
    • 103

    CRYSTAL REPORT TO Sql SERVER WITH vb6.0

    HI ALL,

    i want to know that how to connect crystal report to Sql SERVER with vb6.0

    i'm trying to get rid of this probs sine last 2 days but not succeded.

    Can someone suggest me a website which does contain method ( i mean the form piccs)to connect or please give me a step by step procedure for connection between crystal report and sql server....

    i hope you will help me............. ..
    waiting for quick reply....

    :confused:

    ThanKs in Advance

    Nick
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    What version of CRYSTAL REPORT you are using ?

    Try to create a DSN and connect to Sql SERVER .

    Comment

    • Vbbeginner07
      New Member
      • Dec 2007
      • 103

      #3
      Originally posted by debasisdas
      What version of CRYSTAL REPORT you are using ?

      Try to create a DSN and connect to Sql SERVER .
      that too is not connecting.....

      Comment

      • debasisdas
        Recognized Expert Expert
        • Dec 2006
        • 8119

        #4
        what is the error that you are getting ?

        are you able to connect to the sql server directly ?

        Comment

        • Vbbeginner07
          New Member
          • Dec 2007
          • 103

          #5
          Originally posted by debasisdas
          what is the error that you are getting ?

          are you able to connect to the sql server directly ?
          yes i able to connect it directly and i have succeded in that,but to view this using vb6....how can i do that.....
          i have a kept a "print" command button...please help me to write the code.....i have already done the rept that too directly....


          please sugest me the code.
          Thanks in advance.
          NICK

          Comment

          • Vbbeginner07
            New Member
            • Dec 2007
            • 103

            #6
            Originally posted by Vbbeginner07
            yes i able to connect it directly and i have succeded in that,but to view this using vb6....how can i do that.....
            i have a kept a "print" command button...please help me to write the code.....i have already done the rept that too directly....


            please sugest me the code.
            Thanks in advance.
            NICK
            i am after this for a couple of days please help..........

            NIKHITA.....

            Comment

            • debasisdas
              Recognized Expert Expert
              • Dec 2006
              • 8119

              #7
              what exactly is the error that you encounter ?

              how are you trying to display the report ?

              Comment

              • gpl
                New Member
                • Jul 2007
                • 152

                #8
                Originally posted by Vbbeginner07
                i am after this for a couple of days please help..........

                NIKHITA.....
                Back in 2001 I had a similar trouble, the report viewer in VB6 would not render our reports.

                After a lot of searching, it turned out that we needed a component from VB6 SP4 installed, after that it worked well.

                I am sorry but after so long, the actual details are forgotten and the source code has been consigned to the scrap heap.

                Do a Google search and you may find the answer -- what version of Crystal are you using ??

                Graham

                Comment

                • QVeen72
                  Recognized Expert Top Contributor
                  • Oct 2006
                  • 1445

                  #9
                  Hi,

                  You never mentioned Version of your CR...
                  You succeeded in Creating Report means,
                  You must have created the ODBC properly and is Previewed Data showing properly...?

                  Without mentioning these details, how can anyone help you...?

                  Regards
                  Veena

                  Comment

                  • Vbbeginner07
                    New Member
                    • Dec 2007
                    • 103

                    #10
                    Originally posted by QVeen72
                    Hi,

                    You never mentioned Version of your CR...
                    You succeeded in Creating Report means,
                    You must have created the ODBC properly and is Previewed Data showing properly...?

                    Without mentioning these details, how can anyone help you...?

                    Regards
                    Veena
                    sorry for not giving the correct infm let me telll u veena,i have done the same as u explaind
                    .............no w i need to view the report of the employees within a range and individually
                    by pressing a button.....
                    im using sql server 7.0

                    my queries:

                    1) how do i connect sql with crystal report(7.0).... ..im gettn as a crys.report viewer.

                    2) is it possible to me to get report as :

                    name
                    Nikhita
                    id 100
                    working hours 10
                    Overtime hours 5
                    Salary 30000



                    please clear my queries


                    ...Thanks in advance:
                    NICK

                    Comment

                    • QVeen72
                      Recognized Expert Top Contributor
                      • Oct 2006
                      • 1445

                      #11
                      Hi,

                      use this code to show the report in VB:

                      Place the Crystal Report control on the form...

                      [code=vb]
                      CrystalReport1. ReportFileName = App.Path & "\MyReportName. rpt"
                      CrystalReport1. Connect = "DSN=MyDSNN ame"
                      CrystalReport1. Action = 1
                      [/code]

                      Yes you can print the report in that format..
                      Go to Report Designer, Open the Report, and Increase the Detail Section (add few lines) and Place the Fields one below another.. save and View report

                      Regards
                      Veena

                      Comment

                      • metalheadstorm
                        New Member
                        • Sep 2007
                        • 84

                        #12
                        what im guessing is that he has connected CR to a sql server and can view the reports in cystal.

                        now he wants to view the reports in vb6 when he clicks a button.

                        ive tried this before but failed so i cant give you any help past this :( sorry

                        Comment

                        • Vbbeginner07
                          New Member
                          • Dec 2007
                          • 103

                          #13
                          Originally posted by QVeen72
                          Hi,

                          use this code to show the report in VB:

                          Place the Crystal Report control on the form...

                          [code=vb]
                          CrystalReport1. ReportFileName = App.Path & "\MyReportName. rpt"
                          CrystalReport1. Connect = "DSN=MyDSNN ame"
                          CrystalReport1. Action = 1
                          [/code]

                          Yes you can print the report in that format..
                          Go to Report Designer, Open the Report, and Increase the Detail Section (add few lines) and Place the Fields one below another.. save and View report

                          Regards
                          Veena

                          Hi,
                          but i have a crviewer,i have got errors while at runtime......

                          [vb code:]

                          Private Sub cmdRpt_Click()
                          Set report = crystal.OpenRep ort("C:\Program Files\Seagate Software\Crysta l Reports\report. rpt")
                          Form1.CRViewer1 .DisplayBorder = False
                          Form1.CRViewer1 .DisplayTabs = False
                          report.DiscardS avedData
                          report.Database .SetDataSource rs

                          ERROR:

                          Run-time Varaible 91
                          Object variable or With block variable not set.....




                          Thanks
                          Nikhita

                          Comment

                          Working...