Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

vb.net change crystal report textobject

Posted on 2004-08-30
6
Medium Priority
?
485 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
6 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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
If you are a mobile app developer and especially develop hybrid mobile apps then these 4 mistakes you must avoid for hybrid app development to be the more genuine app developer.
Progress
Starting up a Project

721 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