Solved

vb.net change crystal report textobject

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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

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.
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
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…
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 …

734 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