I have a Text Object on my report which is contains some text. What I'd like to do is add a date to the text object that will alaways show the current date. I've tried using a date field, but it is near impossible to line it up correctly.
Any ideas on how to do this? I've been told that there is a way to do this using something like &[], but I can't figure out how.
Thanks!
You can edit the date inline, double click on the text field then select the date text, you can now click on the formatting button on the toolbar and setup the date format.
You can drag any field, including special ones (Print Date for example) into text object - it will line up without problems.
Related
I have loaded an xlsx file where the original author used Microsoft Office to create the file. In the spreadsheet, there is a column of dates given in format like "DD/MM/YYYY TT:MM:SS", but they are stored as text. Furhteron, "DD/MM/YYYY TT:MM:SS" is not locale default. I cannot find a way to make LibreOffice interpret it as date. Can someone please help me to reach my aim?
Highlight the column of dates. From the menu, select Data -> Text to columns. In the dialog window that pops up, press "OK". That should do it.
I am making my very first GUI using GUIDE and I am running into a problem with one of my Edit Text boxes. The Edit Text box will require the user to enter a date using the mm/dd/yyyy format. I expect that the user will be entering the current date 99% of the time, so I would like to have the current date (in mm/dd/yyyy format) already entered in the text box for the user.
I was able to achieve something like this in Matlab's Command Window using
datestr(date, 'mm/dd/yyyy')
However, I am unsure where/how to implement this code into my GUI to get it to display the date. Any help would be greatly appreciated. Thanks!
If edit1 is the tag to the editbox, add this to OpeningFcn for the GUI -
set(handles.edit1,'String',cellstr(datestr(date, 'mm/dd/yyyy')));
Thus, today's date would show up in the editbox, once the GUI loads up.
If I understood your question right, you need to use the "String" property of your edit box with the output from datestr(date, 'mm/dd/yyyy').
For instance:
set(handles.EditBox,'String',datestr(date, 'mm/dd/yyyy'));
and that should do it. You can put this line in the Create Function of the edit box, so that when the user will open the GUI the text will already be there.
Hope that's what you meant!
I have a field year which is string type coming from db side.So I converted that to number and adding 1 more year to that to show like this:
Year:2014-2015
Below is the formula.
'Year' & ':' & tonumber({FocusOnCustomer.YEAR})&'-'&(tonumber({FocusOnCustomer.YEAR})+1)
Everything is working fine in designer.But when I view the report in cr viewer I am getting data like this.
2,014.00-2,015.00
I want to remove decimals and comas
Try:
ToText( ToNumber({FocusOnCustomer.YEAR}), "#")
Right-click on the field or formula
Select Format Field
On the Number tab, choose the format to use from the list or click Customize to create a custom format.
Click OK
Website Link
How can I remove the comma (,) from crystal report fields?
I have a field name "year" which is having a value of 2012, but when I show that value in crystal report it includes a comma, becoming 2,012.
How can I show only 2012?
In the crystal report designer view:
Right mouse click on that field, and select Format object. Select Custom Style in the Style list, and click Customize. Untick Thousands Separator, and any other unwanted formatting.
Failing that, you could try selecting the field and deleting the "," value from the property ThousandSeperator in your properties window.
try this
for formula
ToText( ToNumber({variable1}), "#" )
Try below code,
Replace (ToText ({Tablename.Year_Field}, 0),"," ,"" )
I'm just guessing but I believe you have embedded your field name into another object such as a text field.
If this is the case, double click your text box in the design view, then select your text field you are having issues with. Right click and select "Text Formatting", under the Font tab click the 'Format Formula Editor' button (the one with the X-2) to the right of the Font drop down menu. Now all you have to do is close the formula editor, then cancel the Text Format window. NOW when you right click on your year field again you will have a new option to Format the field which was previously grayed out.
Alternatively, you can remove your year field from any other object it is nested in. This will give you access to all formatting options.
NumberVar cRed;
ToText (cRed,"#")
OR
ToText({some numeric field value},"#")
The "#" has to be enclosed in parenthesis, single or double.
I am trying to customize a money field.
My goal is to achieve this format: -55,555 LEKE
But when I try to customize the currency symbol CR automatically removes the space between my price and the currency symbol (-55,555LEKE). I don't like this format. I tried everything.
Any ideas?
(Sorry for the delay, but your "crystal-reports-xi" tag isn't often used. Otherwise, someone might have answered this sooner).
Go into the Custom Style menu of your field.
Under Currency Symbol, choose Enable Currency Symbol and Fixed.
Change the position to -123$
Close the menu and left-align the field.
Now, all your currency symbols will be on the far right side of your field and the currency will be on the left. This isn't exactly what you're asking for, I know, but it's pretty close.
Alternatively,
Remove the currency symbol from your field entirely.
Make a text object with the currency symbol inside it.
Put the text object to the right of your currency field.
If you want to right-align your field and have that space between the symbol and the currency, this is the way to go.
I'm not sure what you're using to design the report, but in Visual Studio, it's possible to achieve this by modifying the CurrencySymbol property in the property list or setting it programmatically.
Format Field > Number > Customize >Currency symbol -> click on the 'x+2'
and type the following:
totext (' '&'LEKE').
in the field between the apostrophes-- ' '& type as many spaces as you require.
Then save.
Thanks for the answer.
I'd tried the first method you suggested, but it hadn't looked so pretty.
-123 LEKE
But I realized that this problem does not exist in older versions. So I put the currency symbol with Crystal Reports 7, and opened the document with Crystal Reports 11 and completed my design ;) But you should not enter the currency settings after opening with 11 or it swallows the space immediately.