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

Thread: Data report with data from two tables!!

  1. #1
    Join Date
    Jan 2003
    Posts
    4

    Data report with data from two tables!!

    hi,

    I am trying to generate a report that has to take data present in two tables. is it possible for me to add two 'commands' referring to these two tables in a single 'data environment' and then add these to the datareport. right now i can only add a single command to the data report.

    well i'm new to this....if theres any good site containing tutorials and code related to data report generation plz do specify that also. any help will be highly appreciated....


    thanks

    ameena
    Last edited by ameena; January 22nd, 2003 at 02:36 AM.

  2. #2
    Join Date
    Jan 2003
    Location
    Albany, NY
    Posts
    82
    Bad News:

    No you can only use one DE command at design time to design your Data report.

    Good News:

    However you can create an ADO Hirearchy by using the "Add Child Command" so that if a Parent-child (one to many) relationship exists between your two tables you would be able to display your data (DE will write the SQL SHAPE command for you.).

    If you have an intermidate or a one to one relationship between your tables you can write an SQL command instead of using a database object (DE has a good SQL Designer- make sure your using SP5 however)

    And by the way once your code is running you can further alter your Command by using the .CommandText property (must be valid SQL)
    Last edited by ta9347; January 22nd, 2003 at 09:01 AM.
    Your code can only be as good as your algorithm.

  3. #3
    Join Date
    Jan 2003
    Location
    Albany, NY
    Posts
    82
    You can't add two diffrent columns but you can change the datasource or member at runtime.

    Dim DR1 As DataReport1
    Set DR1 = New DataReport1
    Set DR1.DataSource = ReportRs
    DR1.Sections("Section1").Controls("Text1").DataField = ReportRs(0).Name

    The Data report is not a robust as crystal or even access there are some things that you just can't do on the report its self.

    However if you manipulate your ADO Recordsets to do pretty much anything. So if your realy stuck and don't want to use SQL you can create an unboud recordset, append collumns to it and then use the other two RS to populate it.

    You should realy try to use the above only if the SQL SHAPE command in your .Open doesn't do what you need.
    Your code can only be as good as your algorithm.

  4. #4
    Join Date
    Dec 2003
    Posts
    3

    Have you found the right solution at your problem?

    I have found the same your problem.... Have you found a solution for it? Thanks in advance, Marco

Posting Permissions

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


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)