Forcing a column to display x decimals
I have a dynamic HTML Spry data set, that (partly) shows up like this:
I want to force this display to show 2 decimals for certain columns, so you get figures displayed as 1.05 and 1.10 and not as 1.05 and 1.1
On other columns it may show up as 5, 5.03 and 5.5 but I want them shown as 5.00, 5.03 and 5.50.
With mySQL that is no problem using the FORMAT statement, but how to achieve this in a dynamic HTML table? Converting to strings is no option, because sorting on strings would show 87 before 9.
Actually I turned to Alex July for help and despite Ben's suggestion, he specifically advised me to use HTML in my case, so I followed Alex's advice, hence the HTML page now.
I have a php page with the recordset and that is all. No other content. The query contains all the formatting needed. That page was used to create the Spry dataset but the formatting is not copied to the Spry dataset.
One field is of type ENUM and contains the values 5.00, 5.01, 5.02, 5.03 and 5.5. I can live with the fact that 5.5 does not contain a last second 0 as decimal. The other fields are FLOAT with length of 6.2 and 5.1 respectively.
The query is: SELECT *, FORMAT(`RPI`,2) As RPI,`CPU`*`Cores` As Phys_Cores, `OS_disks`+`Project_disks`+`Output_disks` as Disks, FORMAT(`Gain`,1) As Gain FROM `Personal_data`,`Benchmark_results` WHERE Personal_data.Ref_ID = Benchmark_results.Ref_ID ORDER BY Total, RPI ASC
I'm not sure why Alex advised to use HTML and not XML, as both you and Ben suggested. Probably because of my noobishness and uttter lack of expertise in this field.
Still have to figure out the queries, but here is the initial result: http://ppbm5.com/DB-PPBM5-3.php
Similar Messages
-
Forcing a number to display without decimals or rounding
I am performing a mathimatical calculation, and I want to use
the result in another calculation. For exampl, my result may be
10.678. I want to use the number 10 in my next calculation, not 11
or 10.678. Is there a mask or function that will allow me to cut my
number off at the decimal place without rounding?int() is always popular.
-
Can I modify the column "Net Price" of purchase order to display 3 decimals
Dear expert,
Can I modify the column "Net Price" of purchase order to display 3 decimals?
Looking forward to your reply.
Many thanks.
Best Regards,
MerryHi,
You can easily change ur decimal place in OY04 by seeting number of decimal place to ur currency.
But be careful as it cause a huge effect to ur finance documents, read system message carefully before applying.
Regards
ManUfacTuReR -
Can you force a column to text so it doesn't truncate the leading 0
Many of our part numbers start with 0. When we export an APEX report to Excel, it truncates the leading 0. Is it possible to force a column to text so that it brings the 0 into excel?
thanks
AngieAngie,
There is a way around this if you are using an interactive report. Consider the following SQL.
with test_data as(
select '012345' part_num from dual
union all
select '054321' part_num from dual
union all
select '098765' part_num from dual
union all
select '076853' part_num from dual
select td.part_num part_num_display
, '="' || td.part_num || '"' part_num_download
from test_data tdI have a part_num_display and a part_num_download column. The reason for two columns is because I am going to display one column when the report is rendered in the web browser and display the other when there is a request to download the report. You will notice that i concatenated some characters to the beginning and end of the part_num_download column. This is so the column produces a value which looks like this ="012345". This is an excel expression to set the value of the cell to whatever is in between the quotation marks. The only thing left to do now is to add the conditions to the columns.
Go into your report attributes and then click on the display column and set the condition to: Request != Expression 1 and set Expression 1 to CSV.
Lastly go to the download column and set its display condition to Request = Expression 1 and set Expression 1 to CSV.
This tells the interactive report which column to render for either situation. I had to use this method for numbers with precision greather than two decimal places.
Cheers,
Tyson Jouglet -
Report column breaking - display text centred in cell
Hi,
I am looking for some help achieving the following:
I have a report which has column breaks on the first three columns. Currently, when the report is displayed, the first column value is displayed in the top row with the rows underneath blank and so on for columns 2 and 3. Then the data for the other columns is displayed as normal.
What I want to do is have the column values that are used in the break spanning the rows they break over so the text is displayed centred (vertically)
ie:
Col1 Col2 Col3 Col4 Col5
dat1 dat2
dat2 dat3
val1 val2 val3 dat4 dat5
dat6 dat7
dat8 dat9
val2 xx xxx xx xx
________________________________________________ (Hope this works in ascii!!!) - Col1,2,3 etc are the columns - ignore the vals and dats - they're just data placeholders.
All help much appreciated! :)Hi,
Something like: http://htmldb.oracle.com/pls/otn/f?p=33642:112 ?
If so, see: Re: How to achieve Page/Form/Report layout?
Andy -
Hiding a column when displaying an alv
Hi Gurus,
Shortly I have these things :
1) A node with some attributes like customer_no, customer_name, status etc.
2) A view which contains an element(viewcontainerelement) and this displays the node.
This node is in CONTEXT of my view and in componentcontroller.
Now i want to hide some attributes(columns) when displaying this alv. Can anybody help me?
Thanks..Hi,
When i write that code, it gives me an error message :
data: lr_salv_column type ref to cl_salv_wd_column,
lr_salv_table type ref to cl_salv_wd_config_table.
lr_salv_column = lr_salv_table-if_salv_wd_column_settings~get_column( 'm_no' ).
lr_salv_column->set_visible( if_wdl_core=>visibility_blank ).
Error message:
"Class "CL_MAINV_CTR" does not contain an interface
"LR_SALV_TABLE-IF_SALV_WD_COLUMN_SETTINGS". "
"Mainv" is the name of my view.
I am new at WDA, please give me detailed information.
Thanks
Edited by: Adil Gündüz on Sep 22, 2008 11:13 AM -
How to force Portal not to display item content for a custom item
Hi,
I've read in several places questions about rendering an Item in a custom way, without letting portal
display the item content, if you read along I've discovered a SIMPLE WAY to force portal not to
display the content item.
As per bugs and requests on metalink it seemed that in many versions of Oracle Portal (mine is 9.0.4.1)
this is impossible, since even if we remove the "Item Content" from the list of displayed attributes in the
region, Portal does display it anyway, just after every other Attribute.
- Re: using an item type procedure
- Metalink BUG # 3998251 "ENH: SHOULD BE ABLE TO HIDE "ITEM CONTENT" FOR TEXT ITEMS OR NEED A NEW ITEM TYP" and is being looked into internally whether it is feasible to include this in future releases.
- Metalink Doc ID: Note:290534.1 Subject: Unable to Hide the "Item Content" Attribute for a Text Item
Mine scenario was the usual one:
-oracle portal 9.4.0.1
-a custom item based on custom text (so as to have the RTE to edit HTML).
-A few attributes that help me define the class of an enclosing DIV tag that I wanted to put (a class and an ID)
-A plsql call associated to the custom item, with the flag "display inline" checked
-The dirty HTML generated by the built-in Oracle RTE (with BODY and HTML tags enclosing the actual HTML)
-The region that will contain the item is set so that just the "Function Call" is (or should be) displayed
I wanted to control entirely the display of the item text, while enclosing it in a custom DIV tag.
After a few tries, one of which involved forcing an HTML comment around the item content that Portal stubbornly
displayed, I've discovered this simple way. I don't know hom much this way is portable, but is done entirely with the APIs.
In the stored procedure that displays the item, that I encolose, i just do:
1) retrieved the ITEM querying WWSBR_ALL_ITEMS;
2) updated the ITEM via WWSBR_API.MODIFY_ITEM, passing as display_otpion the value WWSBR_API.FULL_SCREEN!!
Here I try a little explanation:
An item just created has FULLSCREEN=1 and INPLACE=0. This way the stored procedure is executed
AND the item content is displayed.
WIth the modify_item, the item gets FULLSCREEN=1 and INPLACE=2 !! This seems strange since the docs
tells that inplace can be 0 or 1. But this works.
I've played with the WWV_THINGS table directlry, and setting INPLACE to 0, 2 or 3 works as well, while
if it is set to 1, it behave the usual way.
The trick is to have FULLSCREEN to 1 while INPLACE is not set to 1.. and this was the easiest solution.
I'd like to receive a feedback from Oracle regarding this behaviour.
Bye
Walter
--- This is the procedure ---
CREATE OR REPLACE PROCEDURE show_item_mod(itemid in varchar2, styleid in varchar2,
styleclass in varchar2) IS
html CLOB;
idx1 number;
idx2 number := 0;
item portal.wwsbr_all_items%rowtype;
BEGIN
--retrieve item content
select * into item from portal.wwsbr_all_items where id=itemid;
html := item.text;
--check if text body contains "dirty" tags as put by Oracle RTE editor
--and strips text from <BODY> to </BODY>
idx1 := instr(html,'<BODY>');
if(idx1 > 0) then
--strip text of broken tags
idx2 := instr(html,'</BODY>');
html := substr(html,idx1+6,idx2-idx1-6);
end if;
--check if this is first time we enter this procedure
--or if text has changed
if(item.description is null or idx2 != 0) then
--update filename so next time we won't enter the IF branch
--update DIPLSAY OPTION to FUllSCREEN
--update text, if this was changed
idx1 := portal.wwsbr_api.modify_item(
p_master_item_id => item.masterid,
p_item_id => itemid,
p_caid => item.caid,
p_folder_id => item.folder_id,
p_display_name => item.display_name,
p_region_id => item.folder_region_id,
p_display_option => portal.WWSBR_API.FULL_SCREEN,
p_category_id => item.category_id,
p_category_caid => item.category_caid,
p_author => item.author,
--p_description => item.description ,
p_keywords => item.keywords ,
p_text => html ,
p_folderlink_id => item.folder_link_id ,
p_folderlink_caid => item.folder_link_caid ,
p_publish_date => item.publish_date ,
p_expire_mode => item.expiremode,
--p_file_filename => 'Changed!',
p_description=> 'changed!',
p_addnewversion => FALSE,
p_access_level => portal.wwsbr_api.FOLDER_ACCESS
-- process cache invalidation messages
portal.wwpro_api_invalidation.execute_cache_invalidation;
end if;
htp.prn('<div ');
if(styleclass is not null) then
htp.prn(' class="' || styleclass || '" ');
end if;
if(styleid is not null) then
htp.prn(' id="' || styleid || '" ');
end if;
htp.prn('>');
htp.p(html);
htp.p('</div>');
END show_item_mod;
/Hi,
I've read in several places questions about rendering an Item in a custom way, without letting portal
display the item content, if you read along I've discovered a SIMPLE WAY to force portal not to
display the content item.
As per bugs and requests on metalink it seemed that in many versions of Oracle Portal (mine is 9.0.4.1)
this is impossible, since even if we remove the "Item Content" from the list of displayed attributes in the
region, Portal does display it anyway, just after every other Attribute.
- Re: using an item type procedure
- Metalink BUG # 3998251 "ENH: SHOULD BE ABLE TO HIDE "ITEM CONTENT" FOR TEXT ITEMS OR NEED A NEW ITEM TYP" and is being looked into internally whether it is feasible to include this in future releases.
- Metalink Doc ID: Note:290534.1 Subject: Unable to Hide the "Item Content" Attribute for a Text Item
Mine scenario was the usual one:
-oracle portal 9.4.0.1
-a custom item based on custom text (so as to have the RTE to edit HTML).
-A few attributes that help me define the class of an enclosing DIV tag that I wanted to put (a class and an ID)
-A plsql call associated to the custom item, with the flag "display inline" checked
-The dirty HTML generated by the built-in Oracle RTE (with BODY and HTML tags enclosing the actual HTML)
-The region that will contain the item is set so that just the "Function Call" is (or should be) displayed
I wanted to control entirely the display of the item text, while enclosing it in a custom DIV tag.
After a few tries, one of which involved forcing an HTML comment around the item content that Portal stubbornly
displayed, I've discovered this simple way. I don't know hom much this way is portable, but is done entirely with the APIs.
In the stored procedure that displays the item, that I encolose, i just do:
1) retrieved the ITEM querying WWSBR_ALL_ITEMS;
2) updated the ITEM via WWSBR_API.MODIFY_ITEM, passing as display_otpion the value WWSBR_API.FULL_SCREEN!!
Here I try a little explanation:
An item just created has FULLSCREEN=1 and INPLACE=0. This way the stored procedure is executed
AND the item content is displayed.
WIth the modify_item, the item gets FULLSCREEN=1 and INPLACE=2 !! This seems strange since the docs
tells that inplace can be 0 or 1. But this works.
I've played with the WWV_THINGS table directlry, and setting INPLACE to 0, 2 or 3 works as well, while
if it is set to 1, it behave the usual way.
The trick is to have FULLSCREEN to 1 while INPLACE is not set to 1.. and this was the easiest solution.
I'd like to receive a feedback from Oracle regarding this behaviour.
Bye
Walter
--- This is the procedure ---
CREATE OR REPLACE PROCEDURE show_item_mod(itemid in varchar2, styleid in varchar2,
styleclass in varchar2) IS
html CLOB;
idx1 number;
idx2 number := 0;
item portal.wwsbr_all_items%rowtype;
BEGIN
--retrieve item content
select * into item from portal.wwsbr_all_items where id=itemid;
html := item.text;
--check if text body contains "dirty" tags as put by Oracle RTE editor
--and strips text from <BODY> to </BODY>
idx1 := instr(html,'<BODY>');
if(idx1 > 0) then
--strip text of broken tags
idx2 := instr(html,'</BODY>');
html := substr(html,idx1+6,idx2-idx1-6);
end if;
--check if this is first time we enter this procedure
--or if text has changed
if(item.description is null or idx2 != 0) then
--update filename so next time we won't enter the IF branch
--update DIPLSAY OPTION to FUllSCREEN
--update text, if this was changed
idx1 := portal.wwsbr_api.modify_item(
p_master_item_id => item.masterid,
p_item_id => itemid,
p_caid => item.caid,
p_folder_id => item.folder_id,
p_display_name => item.display_name,
p_region_id => item.folder_region_id,
p_display_option => portal.WWSBR_API.FULL_SCREEN,
p_category_id => item.category_id,
p_category_caid => item.category_caid,
p_author => item.author,
--p_description => item.description ,
p_keywords => item.keywords ,
p_text => html ,
p_folderlink_id => item.folder_link_id ,
p_folderlink_caid => item.folder_link_caid ,
p_publish_date => item.publish_date ,
p_expire_mode => item.expiremode,
--p_file_filename => 'Changed!',
p_description=> 'changed!',
p_addnewversion => FALSE,
p_access_level => portal.wwsbr_api.FOLDER_ACCESS
-- process cache invalidation messages
portal.wwpro_api_invalidation.execute_cache_invalidation;
end if;
htp.prn('<div ');
if(styleclass is not null) then
htp.prn(' class="' || styleclass || '" ');
end if;
if(styleid is not null) then
htp.prn(' id="' || styleid || '" ');
end if;
htp.prn('>');
htp.p(html);
htp.p('</div>');
END show_item_mod;
/ -
Blob Column to display Picture
Hello,
i have crated a table name Product , and i kept one column type Blob to upload pics for product. using wizard i created form with report.
i can see the brows option on form but i can not see picture in report which is created durring wizard.
how can i show the picture in report ? can anyone help me.
Thanks,
SuhaibSuhaib,
<li> Check if the image function is fetching the images correctly by opening the image Location(fetched by the procedure) in a new browser tab
It would be like, http//<your server>:<port>/<dad conf>/<schema>.<image fetch function>?<parameters >=
In Andy's application this would be
>http://apex.oracle.com/pls/otn/ATDSCHEMA.DISPLAY_IMAGE?inID=77
<li> Check the report column's display type and change it to standard report column. -
Hi experts,
I amusing column chart, its having 100 line of date, but when i preview its showing all the 100 line of data, but i need scroll right to see the columns first 10 columns should display, then i have to scroll n see the data, how to achieve this
thanksHi Russel,
Use the range slider to achieve this, give 1 in beginning range and 10 to end range value.
hope this helps!!!! -
How to get LOV column's DISPLAY value in IR report?
Hi,
I would like to get LOV column's DISPLAY value to trigger another javascript function. Could you please provide any hint?
For example, there is one IR report with 2 column, DEPT_NAME & SHOW.
The DEPT_NAME type is LOV .
The SHOW column is one link image, when clicking it , I would like to fire a javascript to get DEPT_NAME 's display value.
I know I can use #DEPT_NAME# to get the return value of LOV. However, how to get current row's DEPT_NAME's display value?
Thanks in advance.
Ray
Edited by: 最爱用中文 on 2013-4-11 下午4:14Is there any way you can create a table join, instead of using LOV as your display type?
That way you can select the name of the department in your IR query, display it as text, and then easily reference it as #DEPARTMENT_NAME#, for example. -
Force a column in the query output for FYPD when no data exists
Hi ,
I have a requirement, data available in the cube
<b>FYPD-----Costcenter---- Emp#----StartPD---EndPd--
Amt</b>
2007001-----123456 789---2007004-2008012--
$10
In the variable input screen FYPD range is entered ex: 2007001 - 200704
expected report output;
<b>costcenter--Emp# -StartPD---EndPdAmt- 2007001-- 2007002 -
2007003----
2007004 (Columns KF's)</b>
23456--78920070042008012$10000--
1.
The 0 and 1s are calculated based on Start& End Pd. If STARTPD <= FYPD<= ENDPD
Then output = 1 else 0.
Problems:
1. How to force columns for 2007002 to 200704 when there is no data in the cube for those periods?
2.If somehow we are able to force the columns how to use the column header in the formula to calculate 1 or 0?
Any idea?????If you add some kind of calculation behind your KF that is based on a field that exists for all records it should be fine. This can be a formula variable based on an characteristic attribute like (mat weight/mat weight).
If you're saying you want a 0 to show up when there are no records in the cube for the characteristics in question then it may be more difficult.
Please clarify -
Column that displays a thumbnail shows red X if no thumbnail exists in IE
Hi,
I have a column that displays a thumbnail jpg for a product in a shopping cart.
If a thumbnail was not loaded it shows the outer size of where the jpg would be seen and has a doc gif with a red X in IE but not Firefox.
I have IE 7
I am using APEX 4.0 and the column is actually the product ID and then has the
BLOB Download Format Mask
IMAGE:PD_PRODUCTS:THUMB_NAIL:PRODUCT_ID::MIME_TYPE:THUMBNAIL_NAME:UPLOADED_ON::attachment:Download
so using a decode doesn't work because it still is passing the null to the column item.
I tried a condition for the IR report saying #IMAGE# is not null but kidda knew that wouldn't work...
??????????? How do I not display anything the product ID is null??
thanks, BillHi,
Taken from demonstration application
decode(nvl(dbms_lob.getlength(p.product_image),0),0,null,'<img src="'||apex_util.get_blob_file_src('P6_PRODUCT_IMAGE',p.product_id)||'" />') img Regards,
Jari
Edited by: jarola on Sep 9, 2010 9:48 AM -
Hiding few columns before displaying alv grid output
Hi All,
I struck up at hiding few columns before displaying alv output. I have used used FM: REUSE_ALV_GRID_DISPLAY. By using this i am displaying 29 fields to the output. But before displaying the output i want to hide few columns among them, and also those fields have to be avialable for further selection by the user by using layout.
Kindly help me in this,
Regards
Srinivas KHi,
In field catalog set NO_OUT='X' for all the columns you want to hide. They will be available when changing layout for ALV, so you can show them at any time.
Regards
Marcin -
Customize Which Column to Display from UDT in UDF when Linked to UDT
Problem:
I have a UDF that links to a UDT. The problem is that when I select the UDF, it only displayes the columns from the UDT Code & Name. And for our purposes Code & Name are meaningless data points.
Question:
Can I choose which column is displayed from the UDT in the UDF?
Please see the attached image. THANKS!Hi,
This is SAP B1 standard behavior, But you can change name as terminal code. Other wise you can detach the UDT from UDF and then assign one FMS in the UDF for serach terminal code instead of code and name.
Hope this will work.
Regards
Sridharan -
How to force JTree to not display the leaves
Hi
Is there anyway to force JTree to not display the "end nodes" so to speak.
What I want is that if a node is a leaf and is not allowed to have children
I do not want the JTree to display them.
I need this to build a component for a custom file system view like Windows Explorer
which contains a tree with folders on the left and and contents of the currently selected( expanded)
folder on the right. But Explorer does not display any files in the left pane, only folders.
So I need to implement the same in my componentThis will give you some things to think aboutimport java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.tree.*;
import javax.swing.event.*;
import java.util.*;
public class Test3 extends JFrame {
Vector nodes = new Vector();
DefaultMutableTreeNode root = new DefaultMutableTreeNode("Root");
DefaultTreeModel dtm = new DefaultTreeModel(root);
JTree jt = new JTree(dtm);
JCheckBox jcb = new JCheckBox("Allow Expansion");
Random r = new Random();
int nodeCount=0;
public Test3() {
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
Container content = getContentPane();
addNodes(root,0);
content.add(jcb, BorderLayout.NORTH);
content.add(new JScrollPane(jt), BorderLayout.CENTER);
jt.addTreeWillExpandListener(new TreeWillExpandListener() {
public void treeWillCollapse(TreeExpansionEvent tse) {}
public void treeWillExpand(TreeExpansionEvent tse) throws ExpandVetoException{
if (jcb.isSelected()) return;
TreeNode tn = (TreeNode)tse.getPath().getLastPathComponent();
Enumeration e = tn.children();
boolean expand = false;
while (!expand && e.hasMoreElements()) {
if (((TreeNode)e.nextElement()).getChildCount()!=0) expand = true;
if (!expand) throw new ExpandVetoException(tse);
setSize(400, 400);
private void addNodes(DefaultMutableTreeNode parent, int level) {
int cnt = r.nextInt(3)+3-level;
for (int i=0; i<cnt; i++) {
DefaultMutableTreeNode node = new DefaultMutableTreeNode("Node"+nodeCount++);
parent.add(node);
nodes.add(node);
addNodes(node, level+1);
public static void main(String[] args) { new Test3().setVisible(true); }
}
Maybe you are looking for
-
Preview showing one page as blank in PDF
This is Preview 5.0.3, on OS X version 10.6.6. I have a multi-page PDF file, and Preview is displaying one of the pages as blank. I can highlight the text that should be displayed, copy it, and past it into a text file. The page is correctly displaye
-
Use of transient fields in Collections Framework?
Hi all, I've been playing around with the reflection API for introspecting various members of the Collection Framework (CF). It turns out that many of the fields used by the members of the CF use the transient fields for their data-storage. For examp
-
Run Webdypro Java application by default
Hi , Is that possible to run a Webdynpro Java application by default when User logs into Portal? Actual requirement is that we need to assign Users with different ume groups once User login to portal depending on some User attributes. I am thinking a
-
Photoshop 5.5 will not install
HD suffered a glitch. replaced it with a new HD and reinstalled all programs from original CD and diskettes. All programs installed well except Photoshop 5.5. When the CD is inserted the auto run screen comes on and when clicking in install Photoshop
-
RFC Enabling a Function Module
Hi Friends I need to remote enable a Function Module( for RFCs ) which was already developed some years ago. I need to know what all things I need to take care of when remote enabling such a Function Module. Thanks ~S