Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Set label text in Crystal Report.NET on run time

Posted on 2004-10-05
5
Medium Priority
?
500 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 200 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying 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

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 …
Screencast - Getting to Know the Pipeline
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses

876 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