Results 1 to 13 of 13

Thread: [RESOLVED] how to print data from datagrid using datareport?

  1. #1

    Thread Starter
    Member kirara22's Avatar
    Join Date
    Feb 2009
    Posts
    54

    Resolved [RESOLVED] how to print data from datagrid using datareport?




    in my sreenshot it must print all what it is in in column1 which is:
    aaa
    bbb
    ccc


    Code:
    DataReport6.Show
    
    DataReport6.Sections("Section2").Controls("label1").Caption = DataGrid1.Columns(1)

    plz help..

    tnx..
    Last edited by kirara22; Mar 17th, 2009 at 02:32 AM.

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: how to print data from datagrid using datareport?

    Moved To Reporting

  3. #3

    Thread Starter
    Member kirara22's Avatar
    Join Date
    Feb 2009
    Posts
    54

    Re: how to print data from datagrid using datareport?

    oppss.. ok.. sorry..

    plz help me..



  4. #4
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758

    Re: how to print data from datagrid using datareport?

    Add the appropriate controls to the Data Report at design time. Then simply use the code below to view the report.
    Code:
    Private Sub cmdPrint_Click()
        Set DataReport1.DataSource = DataGrid1.DataSource
        DataReport1.Show
    End Sub

  5. #5

    Thread Starter
    Member kirara22's Avatar
    Join Date
    Feb 2009
    Posts
    54

    Re: how to print data from datagrid using datareport?

    Failed getting Rowset(s) from current data source

  6. #6
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758

    Re: how to print data from datagrid using datareport?

    Is the DataGrid attached to an ADO Data Control? If yes try this code

    Code:
    Private Sub cmdPrint_Click()
        Set DataReport1.DataSource = ADODC1.RecordSet
        DataReport1.Show
    End Sub

  7. #7

    Thread Starter
    Member kirara22's Avatar
    Join Date
    Feb 2009
    Posts
    54

    Re: how to print data from datagrid using datareport?

    using that code it returns this error:

    runtime error 3001 :
    The application is using arguments that are of wrong type, are out of acceptable range, or are in conflict with one another

    printing data on datagrid gives me headache

  8. #8
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758

    Re: how to print data from datagrid using datareport?

    What can I say! Everything I posted works fine for me.

    I could keep on guesing and posting solutions but without more help from you it would be futile.

  9. #9
    New Member
    Join Date
    Mar 2009
    Posts
    13

    help

    i want to show row number for each record that had fetched in report via data report
    but i don't know how i can do this
    each record in final report begin from number 1 ....

    for example
    1 jack robert 110 usa
    2 nick stone 230 usa
    .
    .
    .

  10. #10

    Thread Starter
    Member kirara22's Avatar
    Join Date
    Feb 2009
    Posts
    54

    Re: how to print data from datagrid using datareport?

    Code:
    Private Sub cmdPrint_Click()
    
    Do While DataGrid1.Columns(0) <> ""
    
    DataReport6.Sections("Section2").Controls("label1").Caption = DataGrid1.Columns(1)
    
    DataGrid1.Row = DataGrid1.Row + 1
    
    Loop
    
    End Sub
    i try this code
    but it gives me an error message:
    run time error '6148'
    invalid row number

    in this line of code:
    Code:
    DataGrid1.Row = DataGrid1.Row + 1
    plz help tnx.

  11. #11

    Thread Starter
    Member kirara22's Avatar
    Join Date
    Feb 2009
    Posts
    54

    Resolved Re: how to print data from datagrid using datareport?

    i've solved it already..hehehe

  12. #12
    New Member
    Join Date
    Jun 2010
    Posts
    1

    Re: [RESOLVED] how to print data from datagrid using datareport?

    can you show the code you used? thanks!

  13. #13
    New Member
    Join Date
    Mar 2014
    Posts
    1

    Re: how to print data from datagrid using datareport?

    Quote Originally Posted by kirara22 View Post
    i've solved it already..hehehe
    mate! what code did you use! i have the same porblem as you! really need it (
    thnx in advance!

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