CRM 2011+ SSRS Report + Currency Formatting - ssrs-2008

I have created a ssrs report in CRM online using BIDS.
Generated well but those currency field which is negative shows on the report with bracket.
All positive currency fields showing well on the report but negative currency field is showing with bracket like "(value)" on the report.
May do this like "-$value" or something else.
Please help.

You need to change the settings inside the placeholder properties, right click on the field in Design mode and you can choose also the format for negative values

You can try setting the textbox Format property using an explicit format string, something like:
$#,#;-$#,#;$0
To edit a textbox Format property click on the textbox then edit the Format value in the Properties tab:

Related

Crystal Reports XI, formatted number always show currency symbol

I have a crystal report designed using XI and used in a .NET windows application. I have fields that use a custom format with the example of "(55,555.56)". When the report is run, it always shows the currency symbol.
In the designer, format editor for that field, the only properties that are checked are "Thousands separator" and "Leading zero". Everything else is NOT checked including "Enable currency symbol".
Why is the currency symbol being shown and how do I fix this?
Note: The database the report pulls the data from is a MS Access and the field type is Currency.
Use this: CDbl(currency number).
Theres a good document on Crystal Conversions:
Type Conversion chart
Go into the Custom Style menu of your field.
Under Currency Symbol, choose Disable Currency Symbol and Fixed.

Crystal Reports String Extraction from Access Memo Field

I have a Memo field which contains the following string "#Gift Card Number", I need to remove all the text in the Memo field up to and including "#Gift Card Number" leaving me with the card number which I can then format as a bar code.
"#Gift Card Number" may or may not occur in the string so I only want to report the field if it does occur.
The Memo field will contain line feeds and "#Gift Card Number" will always be on the last line.
Thank you in advance for any assistance
Please follow these steps:
If you are binding datatable as a datasource to a report, then make sure that you extract the number in the c# code itself.
Use this link to extract number from string
Another link to extract
To know how to bind crystal report to a datatable, Please go through the
How to bind crystal report to a datatable in C#

Return different datatypes crystal formula

I have a requirement where depending on the parameter selected the table field should be displayed as text or date. For eg, if the user selects a true, the OriginDate field which is a datetime type should be displayed as a date in the report else should be displayed as a text. I tried creating a formula an doing something like below, and then placing the formula in the details section of the report but it doesnt work due to different datatypes returned.
if {?Mailmerge}=true then
ToText({Travel.OriginDatetime}, "M/d/yy")
else
{Travel.OriginDatetime}
Is there a way I can accompalish the above requirement so that I do not end up creating 2 reports one with field displayed as text and other as date?
Try creating a formula that returns your field as a string totext({Travel.OriginDateTime},"M/d/yy") and overlay it with the original field {Travel.OriginDateTime} and conditionally suppress them based on the value of {?MailMerge} such that only one shows in any one instance of the report.
If I'm following you, you want to only show M/d/yy when ?MailMerge is true, otherwise yuo want to show the full date?
You can't show different datatypes in the same formula, so just convert them both parts of the conditional statement into strings:
if {?Mailmerge}=true then
ToText({Travel.OriginDatetime}, "M/d/yy") // 8/30/12
else
ToText({Travel.OriginDatetime}, "M/d/yy hh:mm:ss") // 8/30/12 02:06:00
I don't know what exactly your dates look like in the database, but you can use the above as a guideline into formatting your date based on the ?MailMerge parameter.

Suppressing (Hiding) data when exporting in Crystal Reports 2011

I am using the Crystal Reports 2011 designer just to test it out. I need to be able to hide certain components, e.g. a sub-report, when exporting to different formats like Excel or .pdf. I'm guessing this can be achieved through the Suppress field with a formula, but I can't find the right syntax. Needs to be something like this:
If ExportFormat="Excel" then Suppress
Else if ExportFormat="PDF" then Show
It doesn't seem like there is a variable to represent the ExportFormat type when using expressions in Crystal Reports.
It is possible to overcome this problem by setting a parameter programmatically during an export event i.e. create a parameter #ExportFormat and during the export event set this parameter depending on the type of export e.g. if the export taking place is to Excel, set #ExportFormat="Excel". Then the following expression can be used to suppress a control:
{?#ExportFormat}='Excel'
You got it almost completely right:
If ExportFormat='Excel' then TRUE
Else if ExportFormat='PDF' then FALSE
This formula goes into the suppress formula. (You need to click this small button with the "x-2" and pencil on it...)

'This field name is not known' error (Crystal Reports)

Here is a strange problem I have run into.
My record select formula is as follows, I have dumbed it down for purposes of this error:
reportDocument.RecordSelectionFormula = " {#ClientName} = 'Smith' "
If I copy this exact selection statement into Crystal it previews fine, but when run from .NET I get
'This field name is not known'.
The problem is occurring at the #ClientName formula field.
#ClientName simply contains:
formula = {aw_illust.CL1LNAM}
I can also set it to just a blank string (formula = "") and it still gives
'This field name is not known.'
Here is the strange part, if I bypass the formula and put the formula text straight into .NET everything works fine.
reportDocument.RecordSelectionFormula = " {aw_illust.CL1LNAM} = 'Smith' "
That is the same record selection, except with the '#ClientName' formula replaced with '{aw_illust.CL1LNAM}'. It just happens on this one report, I have many other Crystal Reports working with formulas referenced in .NET just fine. Any ideas?
Most likely you are not using your {#ClientName} formula anywhere on report; Crystal Reports tends to ignore unused fields, formulas etc. Place {#ClientName} field somewhere in report (header or some similar section) and suppress it - this way you don't mess up report design, but CR should know about that formula afterwards.
Which syntax has the formula? If it is crystal syntax then change it to basic syntax. Or change the content of the formula to crystal syntax (without "formula =")
You could create a parameter like {?ClientName} and set that from .NET, and then put a select formula in Crystal like {#ClientName} = {?ClientName}.
Can you save the report with the selection criteria you'd like then display what the reportDocument class sees using something like:
TextBox1.text = reportDocument.RecordSelectionFormula
This would confirm that your syntax is correct.
Same happened with me when I copied existing report to be used as the new one, You can first open report in report viewer ,In my case
but the query that loading report has no selection with name DateLocal Transaction so I got this error, the resolve is to either use only those that are require (Extras has nothing to do with the error) or rename selection value in query.