Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

insert large piece of text dynamically

Status
Not open for further replies.

Samuel12Sam

Programmer
Jun 11, 2003
15
US
PLEASE LOOK AT THIS PIECE OF CODE. U WILL KNOW WHAT I AM TRYING TO DO. THIS IS ONLY A TEST PIECE. BUT IT DOESN'T WORK. PLEASE HELP ME.
ONE MORE QUESTION.
HOW DO U PROGRAMATICALLY IDENTIFY A TEXT OBJECT BY NAME?????

Dim report As New ReportDocument()

Dim objRepObj As ReportObject
Dim objtext As TextObject
' Get the ReportObject object by name and return it.

report.Load("C:\Documents and Settings\A8VP0\Desktop\test.rpt")

MsgBox(report.ReportDefinition.ReportObjects.Count)
For Each objRepObj In report.ReportDefinition.ReportObjects
MsgBox(objRepObj.Name)
Next
' Get the ReportObject by name, cast it as a TextObject,
' and return it.
objRepObj = report.ReportDefinition.ReportObjects.Item(0)
If objRepObj.Kind = ReportObjectKind.TextObject Then
CType(objRepObj, TextObject).Text = "abc"
End If
report.Refresh()
CrystalReportViewer1.ReportSource = report
MsgBox(objRepObj.Name)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top