Solved

vb.net change crystal report textobject

Posted on 2004-08-30
6
478 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
6 Comments
 
LVL 100

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 100

Accepted Solution

by:
mlmcc earned 25 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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

RIA (Rich Internet Application) tools are interactive internet applications which have many of the characteristics of desktop applications. The RIA tools typically deliver output either by the way of a site-specific browser or via browser plug-in. T…
I know it’s not a new topic to discuss and it has lots of online contents already available over the net. But Then I thought it would be useful to this site’s visitors and can have online repository on vim most commonly used commands. This post h…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

757 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now