Getting the first character in crystal report - crystal-reports

I am creating a crystal report where the receipt number is written as V0000001 or N0000001. I want to get the first character because that is what differentiates these receipt numbers. There is label that says VAT Or No for receipt number V0000001, and a label that says NON VAT Or No. for N0000001.
Basically like this.
case V: VAT Or No:. V0000001
case N: NON-VAT Or No:. N0000001
I think that switch statement would be best, but I don't know how to write it.
The main question is, how would I change the label depending on the first character of the receipt number?
Thanks.

Write something like this:
If Left ("V0000001", 1)='V'
then "VAT OR NO"
Else If Left ("N000001", 1)='N'
Then "NON-VAT OR No"

Related

How to reach the end of a chain of cells

I have a file with two sheets:
sheet_A
A B
1 Mr. Joe USD
sheet_B
A B
1 =sheet_A.A1 ???
sheet_B.B1 shall show the value USD. I know i could get it easily with =sheet_A.B1 but I do not want that.
If I enter into sheet_B.B1 =ADDRESS(ROW();COLUMN()-1) I get the output $C$1 and with =INDIRECT(ADDRESS(ROW();COLUMN()-1)) Mr. Joe.
How can I "navigate" through a chain sheet_B.B1 - sheet_B.A1 - sheet_A.A1 - sheet_A.B1?
Edit 1
Maybe I need something like this
=OFFSET(FORMULA(ADDRESS(ROW();COLUMN()-1);0;1)#
sheet_B.B2 shall show the content of sheet_A.B2 in relation of the value in sheet_B.A1
Here are two possibilities. Either formula produces USD in sheet_B.B1.
=INDIRECT(ADDRESS(ROW();COLUMN();;;"sheet_A"))
=VLOOKUP(A1;$sheet_A.A1:B1;2)
Documentation: ADDRESS, VLOOKUP.
EDIT:
One more idea: The following produces the string "=sheet_A.A1", which could be parsed for the sheet name and cell address. Perhaps you would like to use it to refer to sheet_A.B1.
=FORMULA(INDIRECT(ADDRESS(ROW();COLUMN()-1)))
However, as I commented, there is probably an easier way for what you are trying to accomplish.
Documentation: FORMULA.
EDIT 2:
Here is the formula you requested. It uses REPLACE to remove = at the beginning of the string.
=OFFSET(INDIRECT(REPLACE(FORMULA(INDIRECT(ADDRESS(ROW();COLUMN()-1)));1;1;""));0;1)

Crystal Reports XI - Only show Details lines ending in 'C'

Hopefully a straight forwards question.
I have a Report that runs from a stock system, it prints to show all the products in a customers order, as well as a general 'Thank you for your order..' message.
In the details section it currently shows Product and Product Description for everything within that order.
I have a new client though who wants another version of this report, one which only shows the details lines where the Product Code ends in the letter 'C'.
I'm guessing I need to suppress the details section but I'm not sure what Formula I should be using.
I also can't say for certain that all their product codes will remain the same length. I think about 95% of them will be 8 characters, but any 'special edition' versions may have extra characters in.
Thanks in advance for your help.
A suppression formula needs to return a Boolean value, so a formula checking the last character in your Product Code field should do it:
right(trim({ProductCode}),1) = 'C'
To make it work for a single client, you could do something like this (warning: I'm rusty with Crystal syntax - take it with a grain of salt):
IF {CustomerCode} = 123
THEN right(trim({ProductCode}),1) = 'C'
ELSE false
right(trim({ProductCode})) <> 'C'

Euro/currency sign after amount in SugarCRM

I want to move the euro/currency symbol in the sugarcrm quotes pdf's.
It is actually before the amount, but it has to be printed out after the amount.
Is it possible?
Example:
€4444 <- wrong
4444€ <- correct
Regarding this page:
http://www.evertype.com/standards/euro/formats.html
it seems that €4444 format is the correct one for Italy.
But the way I come to your post looking for the same issue.
Regards.

How to send email to multiple addresses in range of cells that updates weekly?

I am a novice at programming. I have setup a google spreadsheet that will send a weekly email reminder to those who have upcoming assignments. The spreadsheet automatically pulls the 4 email addresses of those who are assigned each week and places them in A1, B1, A2, B2 (i.e. A1:B2). I want the script to find the 4 email addresses (that change each week) and send the same email to all four of them.
When I hardcode the cc recipients into the MailApp line, it works fine. But because the recipients list changes weekly I want to reference the cells A1:B2 instead. When I try to do that, I get an Invalid Email error. The debugger shows that var ccrecipients is picking up the right cells, but I think the problem is that it returns it as an array instead of as a string. That's as far as I'm able to reason through it.
A few snippets of my code:
var ccrecipients = sheet.getRange('A1:B2').getValues();
MailApp.sendEmail(recipients, subject, "", {htmlBody: message, cc: ccrecipients});
Thanks in advance for your help. I've relied heavily on these forums to put together the code that I have. I've always been able to find an answer, until this one. Thanks!
Your observation is almost correct, sheet.getRange('A1:B2').getValues(); return an array of arrays, something like [[A1,B1],[A2,B2]] A & B representing the values in the cells to simplify my example.
And what you need in the end is a "flat" string with all the needed recipients separated by commas "A1,B1,A2,B2".
The simplest way to do that is to flatten the whole thing,that will create a string with comma separations and that's exactly what we need.
sheet.getRange('A1:B2').getValues().toString();
That should do the trick ;-)

Crystal Formula to exclude if value does not contain a certain format

I'm trying to exclude any value from a certain field (table.value) that does not match this format AA#####A. Example if they entered APT12345T, or PT12345PT and No Value then I want to exclude it from the report. It needs to match example AP12345P. What selection formula can I use to accomplish this.
Any help is greatly appreciated
Thanks in advance.
try reading Crystal's help topics on the mid() and isnumeric() functions.
here's an example from the help file:
Examples The following example is applicable to both Basic and Crystal
syntax:
Mid("abcdef", 3, 2)
Returns "cd".
so, in your case, you want to strip your value into three pieces,
mid(table.value,1,2)
mid(table.value,3,5)
mid(table.value,8,1)
and build up a three-part boolean variable where:
the first piece is not numeric(), or between 'AA' and 'ZZ', or however
else you want to test for letters,
the second part isnumeric(), and
the third part passes the same test as the first part.
where are you getting stuck?
something like this:
not isnumeric(mid({table.field},1,2)) and
isnumeric(mid({table.field},3,5) and
not isnumeric(mid({table.field},8,1))