Solved

vb.net change crystal report textobject

Posted on 2004-08-30
6
480 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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
wordcount challenge 11 121
Not needed 13 111
Rubik's Cube Code for Effective Presentation 3 52
draw a Christmas tree by using a nested loop? 26 62
A short article about problems I had with the new location API and permissions in Marshmallow
If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
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 …
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

776 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