Append text to textobject in a .rpt report using VB6

I have made a .rpt file which I am using in report viewer control in vb6. as

dim rptApp as new CRAXDRT.Application
dim rpt as New CRAXDRT.Report

Set rpt = rptApp.OpenReport(App.Path & "\testrpt.rpt")

CRViewer1.ReportSource = rpt
CRViewer1.ViewReport


What my problem is that I want to append some text in textObjects of this report.
Say, if text in one textobject is "Experts-exchange" , I want to append ".com" to it so that it will become "Experts-exchange.com"
LVL 1
silaupuraAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

GJParkerCommented:
There are 2 methods to access the properties of a report object Implicit referencing which will obtain an object by name or Excplicit referenecing which will allow you to iterate through sections and objects of a report till you find the object you want.

If you look in the developers help ( Usually in C:\Program Files\Crystal Decisions\Crystal Reports n\Developer Files\Help\En)these are explained in detail

Once you have the Text object you need you can use the Object.Text property to return the text in the field or the object.SetText Method to change the text in the Text object.

If in your example "Experts-exchange" is a field returned from the database you must embed this in a text field.

Gary
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
mlmccCommented:
You could also do this with a formula.

{Table.DatabaseField} & ".com"

If there aer several actions you could use an if statement like

IF {Table.DatabaseField} = "Experts_Exchange" then
   {Table.DatabaseField} & ".com"
else if   ETC

mlmcc
0
silaupuraAuthor Commented:
ok last ques before I split points.

Now I need to send a parameter to .rpt file so that I can display custormers areawise.

eg. My report is bound to a table with all customers in the country. Now I want to display customers of a particular city. so I want something like

where city = "city_name"  facility.
0
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

mlmccCommented:
You can use a parameter and pass it to the report.  In the report the parameter is used in the SELECT EXPERT.

Another alternative is to pass a filter in
crRpt.RecordSelectionFormula = "{table.Cityfield} = '" & txtCityextBox & "'"

I prefer the latter because I can then pass complex filter without changing the report to add more parameters and if I want a full report I simply don't pass a filter.

mlmcc
0
silaupuraAuthor Commented:
Ok done.
Thanks mlmc and GJParker both. specially mlmc as u have given me what I wanted.

Actually I have only 85 points left with me. can u tell me how can I increase my points without have to purchase them so that I may ask more questions with higher points.
0
silaupuraAuthor Commented:
OOPS!!! beat me hard :(

I actually selected mlmc for the accepted answer and GJParker as 'assisted one' but how have they interchanged I donno.

Sorry mlmc.
0
mlmccCommented:
>> I  actually selected mlmc for the accepted answer and GJParker as 'assisted one' but how have they interchanged I donno.

That is the way it seems to work.  I think from my experience the last one selected becomes the Accepted Answer but I can't swear to that.

Glad I culd help

mlmcc
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Crystal Reports

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.