Solved

Set label text in Crystal Report.NET on run time

Posted on 2004-10-05
5
491 Views
Last Modified: 2010-08-05
hi Experts,

i want to ask How to set label text in Crystal Report.NET on run time?

in Crystal Report 8.5 i can set the label text on run time using the settext function,
but it didn't work when i tried it in Crystal Report.NET version

thanks in advance
0
Comment
Question by:Axpress
  • 3
  • 2
5 Comments
 
LVL 42

Expert Comment

by:frodoman
ID: 12226995
It should work, although it can only be a literal string that can be set.  What's the problem with it?

Another option is to simply create a parameter in your report and pass in the parameter value.  Position the parameter to display wherever you want it.
0
 

Author Comment

by:Axpress
ID: 12243857
thanks for your response frodoman
but it didn't work when i tried the SetText function in CR.NET

below is my code:
Dim rpt As New crMyReport
rpt.txtTest.SetText("TESTING")

the error message is: 'txtTest' is not a member of 'MyProject.crMyReport'
and i did put a Text Object called txtTest in crMyRport

it worked in Crystal Report 8.5

there might be a syntax change in CR.NET, could you give me an example?

thanks
0
 
LVL 42

Accepted Solution

by:
frodoman earned 50 total points
ID: 12249792
Try this instead

rpt = New crMyReport
Dim myTextObject As CrystalDecisions.CrystalReports.Engine.TextObject
myTextObject = rpt.Section1.ReportObjects.Item("txtTest")
myTextObject.Text = "TESTING"
0
 

Author Comment

by:Axpress
ID: 12255553
finally it worked... thanks a lot frodoman
0
 
LVL 42

Expert Comment

by:frodoman
ID: 12257550
Glad to help - frodoman
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

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

786 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