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#
Related
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.
I'm creating a jasper report using iReports 5.2.0 and I want to display the report file name in it.
Can't find any variable that has that information and I would like to get an alternative to pass it in the parameters.
How can I do it?
When you design your report, make a new PARAMETER named, for instance: NAME_REPORT.
After that, put a TextField in your report, for example, in your Title section, and
put as value of your TextField the parameter like a expression: $P{NAME_REPORT}
When you preview your report, ask you to give a value to this parameter and then, you see the title with the name
of your report file.
In your java code you will do somethink like that:
parameters.put("NAME_REPORT", "myreport.jrxml");
.....
JasperFillManager.fillReport(report, parameters, connection)
.....
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:
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.
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.