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

Thread: Data report

  1. #1
    Join Date
    Aug 2000
    Posts
    29

    Data report

    I am making a report and I used a child command in one of the commands. The problem is during run time, I have to filter the recordset of the child command. I cannot use the filter method because I have to use BETWEEN .. AND in order to filter the child command. Is there a way to access the recordset of the child command at run time? Hope you could help me. Thanks.


  2. #2
    Join Date
    May 2001
    Posts
    40

    Re: Data report

    What VB does when you use a child command is it creates a shape command such as the following

    SHAPE {select * from [parent table]
    "where [some field] = ? } ' ? = parameter marker
    as ParentCMD <==== the parent chapter name
    APPEND ({select * from [child table]
    where somefield = ?
    and otherfield between ? and ?}
    RELATE [Location Id] to [Location Id]) <== join criteria
    as ChildCMD




    when it uses the shape command it will expect 4 parameters passed in which you define on the
    parameters tab under the parent and child command properties. Then all you need to do is pass the parameters in when you set the command up.
    ie

    DECommand.parentcommand parameter1
    DECommand.childcommand parameter1,parameter2,parameter3



    there's an example of setting up the parameters at this site http://www.zarr.net/vb/download/sourcecode.asp

    look for Dynamic report 2.

    Hope this helps. If I haven't been clear ask again.





  3. #3
    Join Date
    Aug 2000
    Posts
    29

    Re: Data report

    I would like to ask some things about the code excerpts you cited.
    For the

    SHAPE {select * from [parent table] "where [some field] = ? } ' ? = parameter marker
    as ParentCMD <==== the parent chapter name APPEND ({select * from [child table] where somefield = ? and otherfield between ? and ?}
    RELATE [Location Id] to [Location Id]) <== join criteria as ChildCMD




    how will i put this in my code? do I have to declare an object (i.e. command) then use the execute method to do this?

    as for the
    DECommand.parentcommand parameter1
    DECommand.childcommand parameter1,parameter2,parameter3



    what is DECommand? How will the parentcommand and childcommand appear?

    please elaborate more on how i will use the tips you have given. Thank you.






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