Solved

Set label text in Crystal Report.NET on run time

Posted on 2004-10-05
5
490 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

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 …
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

867 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

18 Experts available now in Live!

Get 1:1 Help Now