Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

vb.net change crystal report textobject

Posted on 2004-08-30
6
Medium Priority
?
488 Views
Last Modified: 2008-01-09
In vb6 I was able to change the textobject value how do u do it in vb.net

this is what I have


Dim myreport As ReportDocument
myreport= New CrystalReport1
myreport.Load("..\CrystalReport1.rpt")


I tried

Dim textobject As CrystalDecisions.CrystalReports.Engine.TextObject
textobject = report1.ReportDefinition.ReportObjects.Item("Text1")


and if I look at the variable textobject it seems to pull in the currecnt value, but I can't figure out how to change it

I even did

textobject = report1.ReportDefinition.ReportObjects.Item("Text1")
textobject.tet = "Hello"

and nothing happened

any ideas??
0
Comment
Question by:bear23
  • 2
  • 2
4 Comments
 
LVL 101

Expert Comment

by:mlmcc
ID: 11932566
How about

report1.ReportDefinition.ReportObjects.Item("Text1").text = "Hello"

mlmcc
0
 

Author Comment

by:bear23
ID: 11932854
no that doesn't work.

When I put my cursor over that line it says

'Property item is read-only'

 I was able to do it with vb6 what is the equivulent in vb.net

0
 

Author Comment

by:bear23
ID: 11932933
also note that this works

I got this off of a old forum here:


Dim myReport As CrystalReport1
myReport = New CrystalReport1
Dim myTextObject As CrystalDecisions.CrystalReports.Engine.TextObject
myTextObject = myReport.Section1.ReportObjects.Item("Text1")
myTextObject.Text = "New Text"
CrystalReportViewer1.ReportSource = myReport


this works great but not using

Dim myreport As ReportDocument

and see I need this because I am using

myreport.Load("..\CrystalReport1.rpt")


so I need to have
Dim myreport As ReportDocument
0
 
LVL 101

Accepted Solution

by:
mlmcc earned 100 total points
ID: 11938169
I am very familiar with the CrystalReport1 method because that is the RDC.  What methodolgy is the other.  It may be that in VB.Net you don't have permissions for that.

Did you try

report1.ReportDefinition.ReportObjects.Item("Text1") = "Hello"

mlmcc
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
The SignAloud Glove is capable of translating American Sign Language signs into text and audio.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
Introduction to Processes

879 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question