Solved

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

Posted on 2008-10-25
1
8,841 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

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 …
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

734 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