Solved

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

Posted on 2008-10-25
1
8,694 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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

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…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

830 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