how to use array of controls in a data report ???

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • hariharanmca
    Top Contributor
    • Dec 2006
    • 1977

    #16
    Originally posted by vishwaskothari
    It is displaying only first record, irrespective of the condition that i am giving in command text at run time.
    Did you place it in Detail section of report?

    Comment

    • pureenhanoi
      New Member
      • Mar 2007
      • 175

      #17
      Originally posted by vishwaskothari
      It is displaying only first record, irrespective of the condition that i am giving in command text at run time.
      Ofcouse, "WHERE ID=1" clause get only one row from database. If you want display more rows, let ID >1 or any condition else.

      Comment

      • QVeen72
        Recognized Expert Top Contributor
        • Oct 2006
        • 1445

        #18
        Hi,

        OK, u can use Parametrized, Command Type. This will refresh the Report,
        First RightClick the Command Object and Change the CommandText To :

        SELECT * FROM MyTable Where ID =?

        And Goto Parametrs Tab:
        and Change these properties:

        Direction: Input
        Data Type: adInteger (Select Appropriate datatype)

        Host Data Type: Long /nteger, Select from list

        write this code in Datareport show button:
        [code=vb]
        Load DataEnvironment 1
        With DataEnvironment 1
        If .rsCommand1.Sta te <> 0 Then .rsCommand1.Clo se
        .Command1 "10"
        End With
        DataReport1.Ref resh
        DataReport1.Sho w
        [/code]

        Pass the appropriate TextBox Value after Command1
        This works perfect here...

        REgards
        Veena

        Comment

        • vishwaskothari
          New Member
          • Aug 2007
          • 60

          #19
          Originally posted by QVeen72
          Hi,

          OK, u can use Parametrized, Command Type. This will refresh the Report,
          First RightClick the Command Object and Change the CommandText To :

          SELECT * FROM MyTable Where ID =?

          And Goto Parametrs Tab:
          and Change these properties:

          Direction: Input
          Data Type: adInteger (Select Appropriate datatype)

          Host Data Type: Long /nteger, Select from list

          write this code in Datareport show button:
          [code=vb]
          Load DataEnvironment 1
          With DataEnvironment 1
          If .rsCommand1.Sta te <> 0 Then .rsCommand1.Clo se
          .Command1 "10"
          End With
          DataReport1.Ref resh
          DataReport1.Sho w
          [/code]

          Pass the appropriate TextBox Value after Command1
          This works perfect here...

          REgards
          Veena



          hi,
          First of all thanks a lot,
          But
          i dont get this,
          where i have to write this code,
          and how it will check with the condition i am giving in query.

          TIA

          Comment

          • hariharanmca
            Top Contributor
            • Dec 2006
            • 1977

            #20
            Originally posted by vishwaskothari
            hi,
            First of all thanks a lot,
            But
            i dont get this,
            where i have to write this code,
            and how it will check with the condition i am giving in query.

            TIA
            you have to write in a VB command button which you are going to press to show the report.

            Comment

            • vishwaskothari
              New Member
              • Aug 2007
              • 60

              #21
              Originally posted by hariharanmca
              you have to write in a VB command button which you are going to press to show the report.

              hi ,

              thanks

              I have done exactly this, but it is giving some run time error

              can u plz explain what this code is doing exactly.

              Regards
              Vishwas

              Comment

              • hariharanmca
                Top Contributor
                • Dec 2006
                • 1977

                #22
                Originally posted by vishwaskothari
                hi ,

                thanks

                I have done exactly this, but it is giving some run time error

                can u plz explain what this code is doing exactly.

                Regards
                Vishwas
                [CODE=vb]'Loading Dataenvironment
                Load DataEnvironment 1
                With DataEnvironment 1
                'Checking If Dataenvironment is opened already if yes, then it'll close
                If .rsCommand1.Sta te <> 0 Then .rsCommand1.Clo se
                'Passing value as string to DE1's Command1(Wait.. .., it should be rsCommand1 "10")
                .Command1 "10"
                End With
                'Refresh The Report and show it to the user.
                DataReport1.Ref resh
                DataReport1.Sho w[/CODE]

                I think, this will solve your problem

                Comment

                • vishwaskothari
                  New Member
                  • Aug 2007
                  • 60

                  #23
                  Hi,

                  the following statement is giving error "INVALID USE OF PROPERTY"

                  .rsCommand1 "10"

                  TIA

                  Comment

                  • vishwaskothari
                    New Member
                    • Aug 2007
                    • 60

                    #24
                    Originally posted by vishwaskothari
                    Hi,

                    the following statement is giving error "INVALID USE OF PROPERTY"

                    .rsCommand1 "10"

                    TIA

                    and also plz tell me where to give the sql query to select the records satisfying particular criteria.

                    for eg where i have to write this

                    select * from accounts where amount >1000


                    in command1's sql text i have written

                    select * from accounts where amount > ?

                    as told by u

                    TIA

                    Comment

                    • bigmoe00100
                      New Member
                      • Sep 2007
                      • 2

                      #25
                      If you want to display a lot of records you can use crystal reporting it is much easier than data report but u have to buy this tool.
                      regards,
                      moe

                      Comment

                      • hariharanmca
                        Top Contributor
                        • Dec 2006
                        • 1977

                        #26
                        Originally posted by bigmoe00100
                        If you want to display a lot of records you can use crystal reporting it is much easier than data report but u have to buy this tool.
                        regards,
                        moe
                        Nothing is difficult or easy, if we have guide. But we have to look over the features
                        Of-course CR has more features.

                        Comment

                        • hariharanmca
                          Top Contributor
                          • Dec 2006
                          • 1977

                          #27
                          Originally posted by vishwaskothari
                          and also plz tell me where to give the sql query to select the records satisfying particular criteria.

                          for eg where i have to write this

                          select * from accounts where amount >1000


                          in command1's sql text i have written

                          select * from accounts where amount > ?

                          as told by u

                          TIA
                          Right click on the Command in Dataenvironment .
                          In the drop menu select properties.

                          Look the panel Source Of data
                          select the option Sql Statement.

                          There you can create your Sql Query.

                          Comment

                          Working...