Click here to Skip to main content
15,885,244 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,

I used to use a 1 line code by I forgot it... :$

Its to set a value to a text object of a crystal report before it loads using vb.net
can any body help ASAP PLEASEEEE?

I tried
DirectCast(myReport.Section2.ReportObjects("text13"), TextObject).Text = "yourvalue"

but its not working
Posted
Updated 13-Sep-19 4:46am
v4

1. Import this -
Imports CrystalDecisions.CrystalReports.Engine

2. Write the code as -
Dim CRObj As New YourCrystalReport
Dim txtObj As TextObject = CRObj.ReportDefinition.ReportObjects("TextObjectName")
txtObj.Text = "Your Value"
 
Share this answer
 
v2
Comments
Member 10404143 13-Jan-20 4:32am    
Thank you!
Quote:
You must indicate that it is a Text Object


Dim CRObj As New YourCrystalReport
Dim txtObj As TextObject = DirectCast(CRObj.ReportDefinition.ReportObjects("TextObjectName"),CrystalDecisions.CrystalReports.Engine.TextObject)
txtObj.Text = "Your Value"
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900