?
Solved

Append text to textobject in a .rpt report using VB6

Posted on 2004-11-24
7
Medium Priority
?
541 Views
Last Modified: 2010-08-05
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"
0
Comment
Question by:silaupura
  • 3
  • 3
7 Comments
 
LVL 19

Accepted Solution

by:
GJParker earned 80 total points
ID: 12673922
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
 
LVL 101

Expert Comment

by:mlmcc
ID: 12678006
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
 
LVL 1

Author Comment

by:silaupura
ID: 12679361
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
[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

 
LVL 101

Assisted Solution

by:mlmcc
mlmcc earned 120 total points
ID: 12681453
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
 
LVL 1

Author Comment

by:silaupura
ID: 12684944
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
 
LVL 1

Author Comment

by:silaupura
ID: 12684955
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
 
LVL 101

Expert Comment

by:mlmcc
ID: 12686168
>> 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

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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 …
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 shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses

807 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