Strange number of blank chars in textfield - Oracle Application Express (APEX)

All i have a form on a table which enters information into a table, Once the information has been entered the page redirects to the report page where you can see the information. If a user clicks on the edit button he/she is redirected back to the form and can see the information and amend it.
One of the fields is a textfield which takes number, and when the user enters it with no spaces it goes into the database, and when he clicks on edit, and the form comes backup the same field comes up with spaces before the numbers, whats this all about ? 

Hi,
Do you have a format mask for that number? Remove it everywhere and try again.
I hope this could help.
Konstantin 

Yeah the format mask was causing the problem. so why is this happening. Can i not format this field ? 

Hi Ben,
Format Mask sets automatically -/+, dollar, and other signs at the front of the number.
It‘s depend of the mask. I suppose that in your case it is a -/+ sign.
It is not an easy task to control a text inside of the element. You should calculate a size, font, width, and format mask of the number to set it properly.
I use to have a JavaScript which does the task to some level. Unfortunately, I couldn’t find the script.
If you have time to find anything else to do the job I‘ll be happy to have it.
Konstantin 

I find it odd that the htmldb only supports $ as when you try the euro symbol you get a ? 

Ben,
To remove the blank space at the beginning of the number, try adding "FM" to the beginning of the format mask.
To have your local currency symbol used instead of the $ sign, try replacing the "$" in the format mask with a "L".
So, if your current format mask looks like $999,999,990.00
Try replacing it with FML999,999,990.00
Number Format elements are described here:
http://download-east.oracle.com/docs/cd/B19306_01/server.102/b14200/sql_elements004.htm#i34570
FM is described here:
http://download-east.oracle.com/docs/cd/B19306_01/server.102/b14200/sql_elements004.htm#SQLRF00216
Doug

Related

Format number as text in Excel output

Ok, here is my problem. I'm creating my template in Word. I have a field (inside a table cell) that is a char datatype, but the data is numbers. For example, 0101. The report that I am creating I want to output to Excel, but when I do, that field has the leading zero truncated and displays as 101 instead of 0101. Excel is viewing that as a number instead of text.
Any ideas on how to get around this? I've tried everything I can think of. Thanks 
Try concatenating =" at the start of the field and " at the end. This will keep all digits and keep the field as a character.
Thanks, Rob 
Or even putting a <<space>> after the formfield holding the string value in your template.
Regards, Tim 
Hi Tim and Rob.
I have such situations. May be I write something wrong.
I have such field <?TASK_CODE?>, could you write me how I must to write and where.
in the Form Field Help Text --> Status Bar --> Type your own
or Form Field Help Text --> Default Text
Best Regards
Ilya 
Next to the form field on the template just put a <<space>> character immediately after the field. When this is rendered in Excel it will be treated as a string.
Regards, Tim 
Form Field Help Text --> Default Text -- <?TASK_CODE?><<space>>
Form Field Help Text --> Status Bar --> Type your own I write <?TASK_CODE?>
May be I write something wrong.
Please, write in the my example how I must to write. 
The default text is only what appears in the template, what you put there makes no difference. So you would have:
Form Field Help Text --> Default Text
TASK_CODE
Form Field Help Text --> Status Bar --> Type your own
<?concat('_',TASK_CODE)?>
When I put an underscore or some character, it works fine. If I put an empty space, then it doesn't (i.e. ' '). You can try experimenting to see if you can get something similiar working.
Hope that helps,
Brett 
Thank you Brett for your help. You are right.
Your expression <?concat('_',TASK_CODE)?> working OK, an empty space, then it doesn't.
But after that I have problem I must edit this data and than load by means of "Data Loader" back to OEBS.
But my data in the column "TASK_CODE" are mistaken.
I must write macros in Excel, but I should like without it.
Best Regards
Ilya 
Try using an Enter. The code should look something like this:
<?concat('
',TASK_CODE)?>

Help with changing Number format to 2 decimals

Hello,
I need the number coming from my RDF to be displayed showing 2 decimals . I had posted this earlier and I tried this <?format-number:YOUR_FIELD;'9G990D00'?>
but this does not work. If its 13.5, it still shows 13.5 not 13.50. Please help. This is urgent, I am stuck... Pl help
Thanks 
I am having this same issue. If my number format does not include the decimal then the User preferences do not display consistently in the PDF output. The value in the database is 99 so my RDF is putting 99 in the value for the field which always becomes 99.00 in my RTF even if the preferences are set to NNN.NNN,00. Is there any way to set this in my RDF? Or adjust it on the RTF? I had an SR open but hit a brick wall. Has anyone else done this? 
You need to form field type to 'Text' and format the number in the field like this:
<?format-number:PRICE;’###,###.00’?>
This allows the requestor's preferred number formatting to work properly and forces two decimal places.
Hope this helps.
Donn 
Hi Don,
When I change the field on my RTF to TEXT and then try to add the
<?../../format-number:CF_REV_AMT;'###,###.00'?> my output does not get generated when I run the report in Oracle. it seems like the regular type type field and format number command are not compatible. Any suggestions on what I might be doing wrong? 
The format of an output field should not prevent your data from being generated. Shouldn't the string be '<?format-number:../../CF_REV_AMT;'###,###.00'?>' and not '<?../../format-number:CF_REV_AMT;'###,###.00'?>'?
The only thing that should cause this to error is if your number is already formatted by a preference setting, such as a European number format (like 1.000,00). The Docs state:
"To use the Oracle format mask or the Microsoft format mask, the numbers in your data
source must be in a raw format, with no formatting applied (for example: 1000.00). If the
number has been formatted for European countries (for example: 1.000,00) the format
will not work."
Does this help?
Donn

Format monetary values in web report

Hi I'm very new to Oracle Reports. It seems like its pretty straight forward to format a monetary amount with a mask in paper reports, but not as much with web based reports. How do I format dollar values in my web based reports?!?!? I must be missing something, because I wasn't able to find the ability to add a mask to a field in the web source, and its a simple property in paper based reports.
Please help.
Thanks. 
I usually put the format mask something like 'NNNGNNNGNN0D00' for amounts. N stands for a digit, G for group separator and D for decimal separator. 0 - displays 0 even if it is not a significant figure.
That's all I do. 
Thanks for your response, but I am wondering WHERE I do this...where do I enter the mask for a field in a jsp report? You can easily see where to put a format mask on a paper report, because you just right click on the field and put it in the properties. My problem is web based reports, I can't seem to locate where you put the format mask. Maybe I'm missing something really simple but I can't seem to locate where to put the mask for a field.
Thanks,
Brett

format mask

Hi
can you please help me how to use the currency format mask in apex. when i tried to use the format mask its not displaying in that format. can you let me know what to do?
Thanks
pritham 
when i tried to use the format mask its not displaying in that format. If the page item is a database column and it is populated by a row fetch, then the data will automatically be converted into the format mask.
That's pretty much the only time that the data will automatically be displayed in the supplied format. If you are populating the field via code, or a user is typing it in, the item won't change to the format. Your post doesn't provide enough information about what exactly is happening for me to be more specific. 
Its provided by user. its a text field. 
If the page item data is 'provided by the user' then the field is presumably blank when they enter the screen -- and therefore nothing is available to format. Your initial question/problem was that the data is 'not displaying in that format'. I can only assume that you mean after the user enters data and leaves the field that you expect the data to automatically switch to the currency format supplied (i.e. the user enters 1234.56 and the field changes to $1,234.56 when they exit the field). This won't happen (as you've already noticed).
If you're really looking for a dynamic change like that, you'd almost assuredly have to make use of Javascript. 
thanks mathew for your answer, can you provide me the idea with the java script so that it will change to currency format once the user enters data 
There is some code here on converting to currency via Javascript. Not mine -- not something I've tested.
http://stackoverflow.com/questions/149055/how-can-i-format-numbers-as-money-in-javascript
If you create that as a function in your header called toCurrency(p_val), then in the HTML Form Element Attributes field, you'd add something like:
onChange="this.value=toCurrrency(this.value);"

Does anyone know how to automatically insert a $ sign

Could someone please show me how to have a column automatically insert a $ sign into a column after a user enters a decimal number? In APEX.ThanksRick
Rickad wrote:
 
Could someone please show me how to have a column automatically insert a $ sign into a column after a user enters a decimal number? In APEX.
That would be a really bad idea. Monetary values should be stored in columns of type NUMBER, which cannot contain a "$" sign. If you need to include currency symbols when displaying monetary values, then in a report use the Number / Date Format column attribute with a format model that includes a currency symbol element, or otherwise compute the required display value using a conversion function.
Is this a form? Then couldn't you on the Pre Element Text portion on the page item add a $ ?? Thank you, Tony MillerLuvMuffin SoftwareRuckersville, VA
Hello TexasApexD hey could you point in the direction to where to find this option. Is this in version 4.2? Yes this is a form, and I have looked at every option on this page and can not find a 'Pre Element Text'? The only thing that I can find that looks like it would work but doesn't is this setting> where I have changed it to the top selection, for currency, but it appears to do nothing discernible but trim the .00 part of a decimal number.. Thanks for your help. 
Rickad wrote:
 
Hello TexasApexD hey could you point in the direction to where to find this option. Is this in version 4.2? Yes this is a form, and I have looked at every option on this page and can not find a 'Pre Element Text'? The only thing that I can find that looks like it would work but doesn't is this setting> where I have changed it to the top selection, for currency, but it appears to do nothing discernible but trim the .00 part of a decimal number.. Thanks for your help.
 
Those are not form properties. That is an Interactive Report column, which in normal usage would (I hope) not be where "a user enters a decimal number". It's now 15 hours since you started this thread and we're no nearer knowing what the problem is, never mind solving it. You need to explain the requirement, clearly and concisely, using standard APEX and Oracle database terminology, with no assumptions that we know what you know: how to get answers from forum
Thanks fac586, that's what I needed to do, was change the datatype on the table from varchar2 to number and then this setting worked. Thanks for your assistance.Rick

Categories

Resources