2 Replies - 15026 Views - Last Post: 21 February 2011 - 02:41 AM Rate Topic: -----

#1 kirara  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 17-March 09

how to print data from datagrid using datareport?

Posted 17 March 2009 - 01:04 AM

Posted Image


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


DataReport6.Show

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




plz help..

tnx.. :)

Is This A Good Question/Topic? 0
  • +

Replies To: how to print data from datagrid using datareport?

#2 sastre06  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 2
  • View blog
  • Posts: 81
  • Joined: 05-June 07

Re: how to print data from datagrid using datareport?

Posted 18 March 2009 - 02:07 AM

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



if you want to show the records, you must use the Detail(Section1), and not Section2.
Was This Post Helpful? 0
  • +
  • -

#3 Guest_Ton2x*


Reputation:

Re: how to print data from datagrid using datareport?

Posted 21 February 2011 - 02:41 AM

Before you apply the code you should make first or add data report. Then put a rpttexbox in details section. If how many fields you want to display from the database then copy the field in the database and paste in in rpttextbox datafield in properties.

Private Sub Command1_Click()
Dim searchcon As New ADODB.Recordset

searchcon.CursorLocation = adUseClient
searchcon.Open "Select * from rotcgrades where ID_No ='" & search.Text & "'", con, adOpenForwardOnly, adLockOptimistic

Set rptindividualstudent.DataSource = searchcon
rptindividualstudent.Show

Set searchcon = Nothing
Unload Me
End If

End Sub


This post has been edited by macosxnerd101: 21 February 2011 - 08:51 AM
Reason for edit:: Please use code tags

Was This Post Helpful? 0

Page 1 of 1