Results 1 to 5 of 5

Thread: Print selected columnheader to data report

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Feb 2007
    Location
    Malaysia
    Posts
    1,370

    Print selected columnheader to data report

    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?

  2. #2
    PowerPoster
    Join Date
    Sep 2005
    Location
    Modesto, Ca.
    Posts
    5,510

    Re: Print selected columnheader to data report

    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.
    Code:
    Private Sub DataReport_Initialize()
        rptDailyuse.Sections("pageheader").Controls.Item("lblCompany").Caption = "somename"
    End Sub

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Feb 2007
    Location
    Malaysia
    Posts
    1,370

    Re: Print selected columnheader to data report

    Quote Originally Posted by wes4dbt
    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.
    Code:
    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 ?

  4. #4
    PowerPoster
    Join Date
    Sep 2005
    Location
    Modesto, Ca.
    Posts
    5,510

    Re: Print selected columnheader to data report

    The labels can be set like this,

    Code:
    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

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

    Re: Print selected columnheader to data report

    Moved to Reporting

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