PDA

Click to See Complete Forum and Search --> : Print selected columnheader to data report


matrik02
Dec 31st, 2007, 11:05 AM
I have select few columnheader from listview1 list it in the listbox1.Now from listbox, How I can sent this columnheader and listitems to data report?

wes4dbt
Dec 31st, 2007, 02:44 PM
You would have to create a recordset containing the listitems and then set this recordset as the datareport datasource at runtime. You can set the datareport columns also at runtime, see below.

Private Sub DataReport_Initialize()
rptDailyuse.Sections("pageheader").Controls.Item("lblCompany").Caption = "somename"
End Sub

matrik02
Dec 31st, 2007, 03:20 PM
You would have to create a recordset containing the listitems and then set this recordset as the datareport datasource at runtime. You can set the datareport columns also at runtime, see below.

Private Sub DataReport_Initialize()
rptDailyuse.Sections("pageheader").Controls.Item("lblCompany").Caption = "somename"
End Sub

Let said I have three columnheader in my listbox1. So How I can label this to the data report?. So How I can sent using you code? Where I can call the listbox1 name in the DataReport_Initialize ?

wes4dbt
Dec 31st, 2007, 03:54 PM
The labels can be set like this,


Private Sub DataReport_Initialize()
rptDailyuse.Sections("pageheader").Controls.Item("label1").Caption = Form1.Listview1.ColumnHeaders(1)
rptDailyuse.Sections("pageheader").Controls.Item("label2").Caption = Form1.Listview1.ColumnHeaders(2)
rptDailyuse.Sections("pageheader").Controls.Item("label3").Caption = Form1.Listview1.ColumnHeaders(3)

End Sub

Hack
Jan 1st, 2008, 03:05 AM
Moved to Reporting