Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dilemma, help needed with label

Status
Not open for further replies.

Ambientguitar

Programmer
Apr 23, 2006
31
GB
Hi guys,

First of all I don't use Crystal too often but I have been tasked with changing a label for a customer of ours.

No matter what I try doesn't seem to work.I will explain. I have a prices table with two values in it pricelevel and unit price

pricelevel 1 is promotional price
price level 0 is retail price

The customer wants it to work like this, if there is a promotional price display that and display the retail price as scored out. if there is no promotional price the display the retail price.

I have tried joins and various other things but I'm at a lose. I did get it to work but it would only work if the product had a promotional price if it only had a price level 1 price it showed all blank??? Any help or guidance would be appreciated.

Thanks in advance!
 
As I understand it, if there is a discounted price in the database you want to show the retail prices formatted to strikethrough and then the discount price. If there is no discounted price, you want to see just the retail price.

There are a couple of ways you could do this. The approach below uses a single formula (and basic HTML coding) with that formula field set with the Text Interpretation set to HTML.

[Code (@DisplayPrice}]
'<p align="right">' +
If Isnull({Prices_Table.PriceLevel1})
Then '$ ' + ToText({Prices_Table.PriceLevel0},'#,###.##')
Else '<Strike>$ ' + ToText({Prices_Table.PriceLevel0},'#,###.##') + '</Strike>' + ' $ ' + ToText({Prices_Table.PriceLevel1},'#,###.##')
[/Code]

My HTML skills are very basic, but it does achieve what I understand to be your objective.

An alternative approach would be to use two formulas. The first would use an If-Then-Else statement to produce the "Display Price" and the second, formatted to "Strikethrough" would show the retail price if a discounted price was listed.

Hope this helps.

Cheers
Pete

 
Hi there ,

Couldn't get this to work??? Thanks for your help though.
My problem is thison most occasions there will only be a 0 price level which is normal retail price
When there is a promotion there will be a pricelevel 0 and a price level 1 in the table. This I think is what complicates it.
When there is two prices I need to display the promotional price (pricelevel1) as main price and then display the retailprice (pricelevel0) with a strike through. I hope this helps.


'5099627584593','-----','N',0,'1','2010-06-30 16:48:24.457','I',0.0000,0.0000,0.0000,'2033-01-15 23:59:59.000','0001','2013-01-17 09:53:50.138',46212,,'N',0.0000,7.0900,'2013-01-17 09:53:50.138'
 
My code assumed that the Promotional Price would be NULL if no discount was available.

Changing the code to test for a zero value instead of a null should fix it.

Cheers
Pete

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top