Results 1 to 12 of 12

Thread: MS Data Report Printing one Record

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2006
    Posts
    10

    Question MS Data Report Printing one Record

    Hello

    I am using Vb6. I am using data report in my program I have it working but when I print it is printing all the records in the database. I am having troubles with it printing a single record. If there is anyone out there that has had this same problem and know how to correct it. I would really appreciate it thank you for your time

  2. #2
    Frenzied Member d3gerald's Avatar
    Join Date
    Jan 2006
    Posts
    1,348

    Re: MS Data Report Printing one Record

    how did you display those records in the report?

    i suggest you use ado to display those data and get the data from the database using sql statement
    On error goto Trap

    Trap:
    in case of emergency, drop the case...

    ****************************************
    If this post has been resolved. Please mark it as "Resolved" by going through the "Thread Tools" above and clicking on the "Mark Thread Resolved " option.
    if a post is helpful to you, Please Rate it by clicking on the Rate link right below the avatar

  3. #3

    Thread Starter
    New Member
    Join Date
    Apr 2006
    Posts
    10

    Re: MS Data Report Printing one Record

    I am using ado to display for the sql statement SELECT tblAmut.* FROM tblAmut ORDER BY ProductID this is want I have or I am missing a something

    thank you for your time

  4. #4
    Frenzied Member d3gerald's Avatar
    Join Date
    Jan 2006
    Posts
    1,348

    Re: MS Data Report Printing one Record

    you should have a where condition in your sql statement so that it will only get a specific record like

    SELECT tblAmut.* FROM tblAmut where ProductID = '<ProductIdtobeDisplayed>'
    On error goto Trap

    Trap:
    in case of emergency, drop the case...

    ****************************************
    If this post has been resolved. Please mark it as "Resolved" by going through the "Thread Tools" above and clicking on the "Mark Thread Resolved " option.
    if a post is helpful to you, Please Rate it by clicking on the Rate link right below the avatar

  5. #5

    Thread Starter
    New Member
    Join Date
    Apr 2006
    Posts
    10

    Re: MS Data Report Printing one Record

    Thank you for your help I really appreciate you spending the time to help me.

  6. #6

    Thread Starter
    New Member
    Join Date
    Apr 2006
    Posts
    10

    Re: MS Data Report Printing one Record

    Hello

    when I add the sql statement SELECT tblAmut.* FROM tblAmut where ProductID = '<ProductIdtobeDisplayed>' When I run the program and go to print the record everything shows up blank

  7. #7
    Frenzied Member d3gerald's Avatar
    Join Date
    Jan 2006
    Posts
    1,348

    Re: MS Data Report Printing one Record

    maybe the productid you supplied doensnt exist in the record. make sure it exists or if its a new record, save it before querying it
    On error goto Trap

    Trap:
    in case of emergency, drop the case...

    ****************************************
    If this post has been resolved. Please mark it as "Resolved" by going through the "Thread Tools" above and clicking on the "Mark Thread Resolved " option.
    if a post is helpful to you, Please Rate it by clicking on the Rate link right below the avatar

  8. #8

    Thread Starter
    New Member
    Join Date
    Apr 2006
    Posts
    10

    Re: MS Data Report Printing one Record

    I did that and still nothing when I view the data report it shows the header in the report header section but it dont show any of the rptlabels or rpttextboxes in the detail section

  9. #9
    Frenzied Member d3gerald's Avatar
    Join Date
    Jan 2006
    Posts
    1,348

    Re: MS Data Report Printing one Record

    have you set the datafield of the rpttextboxes properly?
    On error goto Trap

    Trap:
    in case of emergency, drop the case...

    ****************************************
    If this post has been resolved. Please mark it as "Resolved" by going through the "Thread Tools" above and clicking on the "Mark Thread Resolved " option.
    if a post is helpful to you, Please Rate it by clicking on the Rate link right below the avatar

  10. #10

    Thread Starter
    New Member
    Join Date
    Apr 2006
    Posts
    10

    Re: MS Data Report Printing one Record

    this is what I have for the productid rpttextbox datafield productid, data form general, and data member command 1

  11. #11

    Thread Starter
    New Member
    Join Date
    Apr 2006
    Posts
    10

    Re: MS Data Report Printing one Record

    Ok the cmdbutton that would take you to the report screen would I need to add any code into that. this is what i have right now

    Load DataReport1
    DataReport1.Show vbModal

  12. #12

    Thread Starter
    New Member
    Join Date
    Apr 2006
    Posts
    10

    Re: MS Data Report Printing one Record

    Ok this is how i have the sql statement SELECT tblAmut.* FROM tblAmut where ProductID = '1'

    when i run the program click the button that takes me to the data report I can see the header that is in the report header section but I cant see any of the rptlabel or rpttextbox's in the detail section. Now if i remove the = '1' i can see everything but i a back to sqaure one printing all the records. thank you for your time
    Last edited by nomad700; Apr 8th, 2006 at 01:51 PM.

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