Solved

Set label text in Crystal Report.NET on run time

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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

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. …
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

705 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

16 Experts available now in Live!

Get 1:1 Help Now