Samuel12Sam
Programmer
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)
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)