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

Thread: Data Report Help

Hybrid View

  1. #1
    Join Date
    Aug 2004
    Posts
    131

    Data Report Help

    I am a bit out of my depth here. I started a simple accounts program that enters information into a MS Access database, so far so good. As well as enter the data I can view records one at a time and edit or delete them.

    Now I need to make a report. My main table has fields holding the following: id, date, category, supplier, amount, notes. Firstly I want to create reports between a user selectable start date and end date. On the report I want to list all the records between these dates, ordered by categories, and show a total of the amounts under each category as well as a final total at the end.

    I have been trying to use Data Reports and can generate a report showing all the fields, but so far it shows all records. I have no idea how to add a start date and end date, or how to add in totals.

    Any advice would be greatly appreciated.

  2. #2
    Join Date
    Jun 2002
    Location
    Clane, Ireland
    Posts
    766

    Re: Data Report Help

    To put in totals / categories, you will need to create group headers / footers in your report.

    You will also need to look at using Shape, to create a recordset which fits the structure of your report.

    You can specify the report source of the report, before openning it i.e. create a record source and then say
    Code:
    Set rpt.DataSource = adrQry
    where rpt is the name of your report, and adrQry is the name of your recordset.

    HTH
    JP

    Please remember to rate all postings.

  3. #3
    Join Date
    Aug 2004
    Posts
    131

    Re: Data Report Help

    Thanks for the help. Now I am getting errors "Report width is larger than the paper width". How would I stop this? I have almost nothing in the report at the moment.

  4. #4
    Join Date
    Aug 2004
    Posts
    131

    Re: Data Report Help

    Oh. I figured that one, I had a line on the report that was stopping me resize it. Guess I better do some readin on the Group Headers / Footers.

  5. #5
    Join Date
    Aug 2004
    Posts
    131

    Re: Data Report Help

    I have no idea how to use the group headers/footers. I drag a field into a group header and I get a "Report sections do not match data source" error. If anyone can give me a few hints on using the group headers / footers I would really appreciate it.

  6. #6
    Join Date
    Jun 2002
    Location
    Clane, Ireland
    Posts
    766

    Re: Data Report Help

    You need to look for help on the SHAPE command. I only ever use it as an SQL statement, so if you're using it like that I can help, but if you use the data environment, I'm can't help you.

    The shape command, basically allows you create different recordsets within the one recordset eg one for each header, and then one for the detail lines.

    Sorry I can't be of more help to you.

    JP
    JP

    Please remember to rate all postings.

Posting Permissions

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


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center