Solved

how to use string functions to compare two string in crystal report to print conditional data ?

Posted on 2008-10-25
1
8,419 Views
Last Modified: 2012-08-14
Hi,

I have following three fields in my table and there sample data
1) Address     = 123 Street, mycity
2) Bank           = TD Bank , branch 103 , Mississauga
3) Remarks     = Money deposit in Bank
I am using sql stored procedure to populate my data for cystal report.
I want to print only one field in my report: Address or Bank depending on my Remarks field data. If I have word "Bank" in my Remarks my Bank field will be print otherwise Address only.
How can I do that in crystal report? It easy to do in VB. I have found some crystal report function like InStr and StrComp but don't know how to use them. No example found.
Thanks


0
Comment
Question by:khalidsuhail
1 Comment
 
LVL 77

Accepted Solution

by:
peter57r earned 500 total points
ID: 22806414
Create a formula field. and plsce it where you want the data to appear in your report.

If instr({Table.Remarks},"Bank")>0 then
{table.Bank}
else
{Table.Address}
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
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 …
This video discusses moving either the default database or any database to a new volume.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

757 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