Listview item in data report

30 pts.
Tags:
VB 6.0
VB Data Report
Visual Basic 6.0
how to show listview items in datareport?

Software/Hardware used:
vb6

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Discuss This Question: 5  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • carlosdl
    I don't think you can. Why would you want a listbox in a report ? Maybe you should be using a form instead.
    68,430 pointsBadges:
    report
  • Jamjam18
    Thanks for your response..yes, i have a form with a listview..all i want to do is to display all listview data in a report when i click a command button.Only the first item in my listview appears in my data report. Here's my code: With dtRptEM If Me.cboCrit.Text = "Table of Organization" Then Set rs = conn.Execute("Select * from T_ORG where REVISION like '" & txtSrcrev.Text & "' ORDER BY REVISION ASC") Set .DataSource = rs .LeftMargin = 0.75 .RightMargin = 0.75 .DataMember = rs.DataMember Set rs = conn.Execute("Select * from T_ORG WHERE REVISION like '" & txtSrcrev.Text & "' ORDER BY REVISION ASC") If Not rs.EOF Then rs.MoveFirst Do While Not rs.EOF .Sections("section1").Controls("lblDCNNo").Caption = .Sections("section1").Controls("lblDCNNo").Caption & rs!DCN_NO .Sections("section1").Controls("lblRevNo").Caption = .Sections("section1").Controls("lblRevNo").Caption & rs!Revision .Sections("section1").Controls("lblEffdate").Caption = .Sections("section1").Controls("lblEffdate").Caption & rs!EFFECTIVITY_DATE .Sections("section1").Controls("lblRevtype").Caption = .Sections("section1").Controls("lblRevtype").Caption & rs!TYPE_OF_REVISION .Sections("section1").Controls("lblRevdesc").Caption = .Sections("section1").Controls("lblRevdesc").Caption & rs!REVISION_DESC .Sections("section1").Controls("lblRevpage").Caption = .Sections("section1").Controls("lblRevpage").Caption & rs!REVISED_PAGE ' rs.MoveFirst DoEvents Loop End If .Show End If End With
    30 pointsBadges:
    report
  • carlosdl
    I'm not sure to understand what you are trying to do. If the data for the report is going to come from a database table you don't need to create a loop to read the recordset. You just need to set the recordset as the datasource for the report. However, if you do want to run through the recordset, you need to call the .MoveNext method at the end of every iteration to advance to the next record. And, I don't see how you are trying to display the data from the listview. As far as I can see, you are displaying data from a database query.
    68,430 pointsBadges:
    report
  • Jamjam18
    Hi...i did what you suggest and it works now! My listview data were displayed in datareport..Thank you so much..it was a great help...Here's the code: With dtRptEM If Me.cboCrit.Text = "Table of Organization" Then Set rs = conn.Execute("Select * from T_ORG where REVISION like '" & txtSrcrev.Text & "' ORDER BY DCN_NO ASC") Set .DataSource = rs .LeftMargin = 0.75 .RightMargin = 0.75 If Not rs.EOF Then .Sections("section1").Controls("lblDCNNo").Caption = .Sections("section1").Controls("lblDCNNo").Caption & rs!DCN_NO .Sections("section1").Controls("lblRevNo").Caption = .Sections("section1").Controls("lblRevNo").Caption & rs!Revision .Sections("section1").Controls("lblEffdate").Caption = .Sections("section1").Controls("lblEffdate").Caption & rs!EFFECTIVITY_DATE .Sections("section1").Controls("lblRevtype").Caption = .Sections("section1").Controls("lblRevtype").Caption & rs!TYPE_OF_REVISION .Sections("section1").Controls("lblRevdesc").Caption = .Sections("section1").Controls("lblRevdesc").Caption & rs!REVISION_DESC .Sections("section1").Controls("lblRevpage").Caption = .Sections("section1").Controls("lblRevpage").Caption & rs!REVISED_PAGE rs.MoveNext End If .Show End If End With
    30 pointsBadges:
    report
  • carlosdl
    Great ! Thanks for posting back and sharing your code.
    68,430 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following