Displaying html stored in a database table in a region

Hi All,
I would like to pass html to regions on the page which is stored in a database table.
I have got this working for simple html (call a packaged function to get the html and then in a PL/SQL Anonymous Block htp.p(f_get_html(:P1_param1,'REGION1')); to display it within the region ) but what I would also like to take the html generated for charts/graphs etc out of the application and also put them into the database table so that the position on the page can be determined by database tables.(i.e. have a page with lots of regions and assign html to them at runtime). I am struggling with substituting all the necessary parameters into the HTML returned from the database and how it should be formatted.
Any help appreciated and if I get any further I will update the post

I have actually managed to achive this now. When I get chance I will post the code.
The idea is that a page could have say 6 regions and depending on choices made (i.e. selected project or the individual user permissions) there are regions which you would want to display and regions you dont. Also, you may want to move regions around the page so that the important ones for that user or project etc. are at the top.
You can then, on entering a page, query database tables to decide what is to be displayed in region1, region 2 etc. and then getting the html from the database for that region and displaying it.
I have successfully done this now with embedded Oracle Reports showing graphs which look better than the SVG graphs and are more flexible.

Similar Messages

  • Display HTML stored in the database

    Hi
    CREATE TABLE source
    (sql_text CLOB
    The content of sql_text is text surrounded by various HTML-tags.
    Which options do I have for displaying sql_text formatted according to the HTML-tags? In other words how can I get apex to send the content of sql_text to the browser with out escaping the tags?
    Marius

    Since I haven't found a way to list a report (more than one row from the database), I ended up using a Display as Text (does not save state) and the following SQL as source
    SELECT CONCATINATION(CURSOR(SELECT somecolumn FROM sometable ORDER BY order_key)) FROM DUAL;
    CREATE OR REPLACE FUNCTION CONCATINATION(l_cursor IN SYS_REFCURSOR, seperator IN VARCHAR2 default '<BR>') RETURN clob
    IS
    string clob;
    sub_string clob;
    BEGIN
    LOOP
    FETCH l_cursor INTO sub_string;
    EXIT WHEN l_cursor%notfound;
    IF l_cursor%ROWCOUNT = 1 THEN
    string := sub_string;
    ELSE
    string := string || seperator || sub_string;
    END IF;
    END LOOP;
    RETURN string;
    END;
    Edited by: Marius2 on Mar 23, 2009 8:37 PM
    Fixed a small bug

  • Evaluation of html stored in the database

    Hello everyone, here is my story.
    I have html stored in the database that I am using in regions. The region is a pl/sql anonymous block with code similar to this.
    DECLARE
    testt varchar(30000);
    BEGIN
    SELECT Main_Page_Image_Zone INTO testt FROM htmltable where Main_Page_Image_Zone IS NOT NULL;
    htp.p(testt);
    END;
    It draws in and displays the html great. The only problem is apex isn't evaluating the html. I have an image that is drawing from #workspace_images#, but instead of translating this to something useful, I get a red x. It is trying to find the image as #workspace_images#...The html being drawn in isn't being evaluated like I want it to (I want it to translate #workspace_Images#). Any ideas how to evaluate this html?
    Here is what the image location is supposed to look like
    http://127.0.0.1:8080/apex/wwv_flow_file_mgr.get_file?p_security_group_id=6933527329162765&p_fname=fmw.gif
    Instead this shows up:
    http://127.0.0.1:8080/apex/f?p=104:12:617607226208594:::::#WORKSPACE_IMAGES#fmw.gif
    This is stored in the database (ignore the .)
    <.img src="#WORKSPACE_IMAGES#fmw.gif" width="697" height="439" border="0" usemap="#Map" />

    However
    Replacing occurences of '#WORKSPACE_IMAGES' with 'WORKSPACE_IMAGES' in the database
    and then applying the replace function on the column works.
    select replace(f1,'WORKSPACEIMAGES','&WORKSPACE_IMAGES.') into str from temp_tab;
    Again, don't know why !

  • Display HTML stored in a table

    Hello,
    I want to display HTML Code which is stored in a table.
    Now I have a display as text item and there the HTML is not rendered properly...
    So what must i do to show the HTML Code properly?
    What kind of item should I use?
    Thank you,
    Tim

    Thank you Carsten,
    I had the wrong Item.
    I used "display as text (saves state)"....
    Regards,
    Tim

  • Can Discoverer have link to display documents stored outside the database?

    I posted a message some time ago called "Possible for Discoverer to display BLOB type documents stored in database?" and got great answer.
    Now our customers are asking if it is possible, from Discoverer, to link somehow to a file stored outside the database on the Unix file system and get their computer to display it? Can anyone tell me if this is possible please?
    The only thing I've seen in the documentation that may be related is in Oracle Business Intelligence Discoverer Configuration Guide, section 10.6 List of Discoverer user preferences. It says there that Discoverer preference ProtocolList can be set so that Discoverer hyperlinks can be set to use protocols such as telnet, but the default is HTTP, HTTPS, and FTP.
    THank you in advance if you can help.
    Regards,
    Julie.

    Hi Rod,
    I have tried the second method: "create a Oracle directory pointing to the Unix directory containing the files". I have had success with it, but I'd be grateful if you could advise me if you would have done this the same way as described below:
    I put two Word docs and two text docs called clob_test1.txt, clob_test2.txt, blob_test1.doc, blob_test2 in the Unix directory corresponding to an Oracle directory called 'EIF'. I thought an extrenal table was needed so that Discoverer would have an object to write a queruy against. So I created a file called lob_test_data.txt with the following contents:
    1,01-JAN-2006,text/plain,clob_test1.txt
    2,02-JAN-2006,text/plain,clob_test2.txt
    3,01-JAN-2006,application/msword,blob_test1.doc
    4,02-JAN-2006,application/msword,blob_test2.
    THen I created an external table using the following DDL:
    CREATE TABLE jum_temp_lob_tab (
    file_id NUMBER(10),
    date_content DATE,
    mime_type VARCHAR2(100),
    blob_content BLOB
    ORGANIZATION EXTERNAL
    TYPE ORACLE_LOADER
    DEFAULT DIRECTORY EIF
    ACCESS PARAMETERS
    RECORDS DELIMITED BY NEWLINE
    BADFILE EIF:'lob_tab_%a_%p.bad'
    LOGFILE EIF:'lob_tab_%a_%p.log'
    FIELDS TERMINATED BY ','
    MISSING FIELD VALUES ARE NULL
    file_id CHAR(10),
    date_content CHAR(11) DATE_FORMAT DATE MASK "DD-MON-YYYY",
    mime_type CHAR(100),
    blob_filename CHAR(100)
    COLUMN TRANSFORMS (blob_content FROM LOBFILE (blob_filename) FROM (EIF) BLOB)
    LOCATION ('lob_test_data.txt')
    PARALLEL 2
    REJECT LIMIT UNLIMITED
    then created a Discoverer End User Layer folder against this external table, and used exactly the same technique as we did for downloading the BLOB from the database table (creating a new folder item containing a URL calling a database procedure which calls the Oracle code to download the doc). THis worked, but sometimes my PC didn't seem to know that the Word docs were Word docs and it needed to launch Word. Other times it did manage to do this OK. It always displayed the two .txt files as HTML docs.
    Just wondered if you'd be good enough to critique this approach.
    THank you, Julie.

  • Authorization scheme for users stored in a database table?

    Hello!
    I'm trying to find out how to make an authorization scheme for database users.
    I first made an authentication scheme for my current application, I named it "Authentication for database accounts", and the scheme type is "Database Accounts".
    A word of explanation:_
    I have a table in my database, named "USERS". Inside this table, I have the following columns:
    - USERID (NUMBER)
    - USERNAME (VARCHAR2(50))
    - PASSWORD (VARCHAR2(50))
    - EMAIL (VARCHAR2(200))
    For this question, I'll take an example user. The username is USER and the password is USER. Email and UserID don't matter here, but let's just say the UserID is 1.
    What I want:_
    When you go to the application, and you are requested to log in (page 101), then I want a user to be able to log in with the data that has been stored in the USERS table.
    So, on the login page, the user will enter USER as username, and USER as password. The authorization scheme then needs to check whether or not this username and password match the data in the USERS table. If it does, then it must sign the user in with the credentials the user entered (those being USER and USER).
    I also want the UserID to be stored somewhere in the application (if possible, in an application item).
    How do I do this? I've never made an authorization scheme before... I'm not too good with PL/SQL either, but I'm working on that part.
    Any help is greatly appreciated.

    I'm trying to find out how to make an authorization scheme for database users. I think there may be some confusion here. An authorization scheme gives the user access to different parts of an Apex Application. Database users are the users that you use to login to the database, for example with sqlplus.
    From the rest of your post it sounds like you need a custom authentication scheme to validate users against a custom table. For this you need to create a custom authentication scheme and select use my custom function to authenticate. Exactly how you set up the authentication scheme depends on the version of Apex you are using. But an example of validate user function you could use is given below:
    function validate_login (
       p_username   in   varchar2
    , p_password   in   varchar2) return boolean
    is
    v_result varchar2(1);
    begin
    select null into v_result
    from USERS
    where userid = p_username
    and password = p_password;
    return true;
    when no_data_found then return false;
    end validate_login;Once the user has successfully logged on the userid will be in the APP_USER apex substitution string.
    And for Application Express Account Credentials, does this mean an admin must make each new user by hand?If you using Apex account credentials the user details are stored within the Apex tables. You can create users using the Apex admin application or by using the APEX_UTIL.create_user api.
    Rod West

  • How to display Column Names of a Database Table in JSP

    Dear All,
    I want to display all the attribute names(column names) of a database table on JSP.
    [ ex:  mytable contains : ( EmpId,EmpName,Dept ). This should be display as  EmpId--text box                    
    EmpName--text box
    Dept----textbox
    please note , i don't want to display values,but only column names

    Yeah make use of methods like
    ResultSet DatabaseMetaData.getColumns(String catalog, String schemaPattern, String tableName, String columnNamePattern)
    else use
    String ResultMetaData.getColumnName(int column_index)
    search google i'm sure u wud get thousands of example on it... :)

  • Looking for a value in a list stored in a database table field

    Hello,
    I have a field in a database table that contains a comma
    separated list on numbers. In my CFQUERY I am attempting to extract
    records from the database table where a parsed number is present in
    the comma separated list. I have tried the code below, but it is
    throwing an error.
    variables.publicationID is the number that I am looking for
    in the database table field.
    publicationList is the name of the database table field
    containing the comma separated list of numbers.
    where <cfqueryparam value="#variables.publicationID#"
    cfsqltype="cf_sql_integer"> in publicationList
    Can anybody help?
    Many thanks,
    smnbin

    The only way to do it with the data model you currently have
    is as follows:
    WHERE publicationList LIKE '#variables.publicationID#' OR
    publicationList LIKE '#variables.publicationID#,%' OR
    publicationList LIKE '%,#variables.publicationID#,%' OR
    publicationList LIKE '%,#variables.publicationID#'
    You need to check for 4 cases:
    it's the only ID in the list
    it's the first ID in the list
    it's in the middle of the list
    it's the last ID in the list.
    The better solution would be to replace this comma-delimited
    list with a mapping table, where each row in this mapping table
    contains a reference to the main table as well as a single
    publicationID.

  • Text file storing in a database table

    I have a text file, that contains so many lines in it,..
    Now the problem is that.. I want to store my text file with the pl/sql code in a database table....
    plz suggest, how to create a table and how to store that text file in a database table.....

    The following code is tested and get the correct result (forms 10.1.2.0):
    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    SQL> create table tclob  (col_lob clob);
    Table created.
    Declare
      file  TEXT_IO.FILE_TYPE;
      text  varchar2(10000);
      L$Clob CLOB;
    Begin
      -- prepare CLOB object --
      dbms_lob.createtemporary( L$Clob, TRUE ) ;
      -- open text file --
      file := TEXT_IO.FOPEN( 'c:\forms.css', 'R' ) ;
      If TEXT_IO.IS_OPEN( file) Then
        -- start reazding file --
         Begin
           Loop
             TEXT_IO.GET_LINE( file, text );
             -- add the line to the CLOB variable --
                dbms_lob.writeappend (L$Clob, length(text), text);
           End loop;
        Exception
          when no_data_found then
            -- end of text file --
            TEXT_IO.FCLOSE(file);
          when others then
           null;
        End ;
        -- store the CLOB in the database --
        --Update tclob Set col_lob = L$Clob ;
        insert into tclob (col_lob) values (L$Clob);
        forms_ddl('commit');
           dbms_lob.freetemporary( L$Clob ) ;
      End if ;
    exception
         when others then
         message(error_code || '-' || error_text);
    End;Francois

  • How to display Images stored in a database using javascript

    Hi.
    I have some images stored in a table and I need to display them using javascript. The images are stored in BLOB columns: I would like to know if I can put them on a directory and then get it from there using BFILENAME function.
    Any suggestion?
    Regards,
    Jeannine

    Hi All,
    Yes DuraiRaja - i am using the document.getElementById(' ').
    In my app, I have a Main controller calling a View - Default.HTM,
    This Default.HTM, in turn loads up three trays T1, T2, T3 and these tray elements in turn call up the controllers ctrl1, ctrl2, ctrl3 associated to them.
    CTRL1 calls a view - View1 - V1.htm, which has the below code.
    And on the below page all that i am trying to do is validate if "FieldVal" is blank or not.
    I get an error on IE as "Object required"
    I get a HTTP 501/505 error when i try to upload the code.
    Thanks all !

  • Display images stored in the database

    I have images stored in the databse. I followed the steps provided in the oracle documentation. Now i want to retrive the image from the database into a java object that can be dislayed in , say, a JLabel. I am able to retrieve the image from the database into the OrdImage in the oracle.java.ord package and view the properties of the image. But unable to retrive the image as such to be displayed.
    Thanking You
    vinay

    This might help...
    import javax.imageio.*;
    import javax.imageio.stream.*;
    import javax.swing.*;
    import java.awt.*;
    import java.sql.*;
    import java.io.*;
    import oracle.jdbc.driver.*;
    import oracle.sql.* ;
    import oracle.ord.im.*;
    import java.awt.event.*;
    public class HelloDBImage implements ActionListener{
    OracleConnection con = null;
    JLabel label = null;
    String textFieldString = "Image ID entered";
    public void actionPerformed(ActionEvent e)
    String prefix = "You typed \"";
    if (e.getActionCommand().equals(textFieldString))
    JTextField source = (JTextField)e.getSource();
    ImageIcon imgIcon = createImageIcon(source.getText());
    if (null != imgIcon)
    // Create image Label
    label.setText(null);
    label.setIcon(imgIcon);
    else
    label.setIcon(null);
    label.setText("Image not found! ");
    source.setText("");
    label.repaint();
    //actionLabel.setText(prefix + source.getText() + "\"");
    public ImageIcon createImageIcon(String key)
    Image image = null;
    ImageIcon imgIcon = null;
    try
         // Connect to the database if necessary
    if (null == con) con = connect();
    // Create Input Stream from DB image.
    InputStream is = new BufferedInputStream(
    getDBInputStream(con, key));
    if (null != is)
    // Create Image from Image Input Stream
    ImageInputStream iis = ImageIO.createImageInputStream(is);
    image = ImageIO.read(iis);
    // Create Image Icon from ImageInputStream
    if (null != image) imgIcon = new ImageIcon(image);
    } catch (Exception e)
    System.out.println("exception raised " + e);
         e.printStackTrace();
    return imgIcon;
    public Component createPanelAndContents(String key)
    // Create the image label
    ImageIcon imgIcon = createImageIcon(key);
    if (null != imgIcon)
    // Create image Label
    label = new JLabel(imgIcon);
    else
    label = new JLabel("Image not found! ");
    // Create layout
    GridBagLayout gridBag = new GridBagLayout();
    // Create panel to draw in
    JPanel pane = new JPanel();
    pane.setLayout(gridBag);
    GridBagConstraints c = new GridBagConstraints();
    JScrollPane scrollPane = new JScrollPane(label,
    JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
    JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
    c.fill = GridBagConstraints.BOTH;
    c.weightx = 1.0;
    c.weighty = 1.0;
    gridBag.setConstraints(scrollPane, c);
    c.gridwidth = GridBagConstraints.REMAINDER;
    c.fill = GridBagConstraints.HORIZONTAL;
    scrollPane.setMinimumSize(new Dimension(300, 300));
    pane.add(scrollPane, c);
    // Add a text field and label to get anoter image
    JTextField textField = new JTextField(10);
    textField.setActionCommand(textFieldString);
    textField.addActionListener(this);
    // Add fields for input
    JLabel promptLabel = new JLabel("Please enter DB key: ");
         pane.add(promptLabel);
    pane.add(textField, c);
    return pane;
    public static void main(String[] args)
    String key = "1";
    try
    UIManager.setLookAndFeel(
    UIManager.getCrossPlatformLookAndFeelClassName());
    } catch (Exception e) { }
    //Create the top-level container and add contents to it.
    JFrame frame = new JFrame("SwingApplication");
    HelloDBImage app = new HelloDBImage();
    if ((args.length > 0) && (args[0] != null)) key = args[0];
    System.out.print("length= " + args.length + "/" );
    if (args.length > 0) System.out.println(args[0]);
    Component contents = app.createPanelAndContents(key);
    frame.getContentPane().add(contents, BorderLayout.CENTER);
    //Finish setting up the frame, and show it.
    frame.addWindowListener(new WindowAdapter() {
    public void windowClosing(WindowEvent e) {
    System.exit(0);
    frame.pack();
    frame.setVisible(true);
    public InputStream getDBInputStream(OracleConnection con, String key)
    InputStream is = null;
    try
         int index = 0;
         Statement s = con.createStatement();
         OracleResultSet rs =
         (OracleResultSet)s.executeQuery("select * from images " +
    "where item_id = " + key );
         if (rs.next()) // Just get first image if more than 1.
         index = rs.getInt(1);
         OrdImage imgObj =
    (OrdImage) rs.getCustomDatum(2, OrdImage.getFactory());
    is = imgObj.getContent().getBinaryStream();
    catch(Exception e)
    System.out.println("exception raised " + e);
    e.printStackTrace();
    return is;
    public OracleConnection connect() throws Exception
    String connectString;
    Class.forName ("oracle.jdbc.driver.OracleDriver");
    connectString = "jdbc:oracle:oci8:@orcl";
    OracleConnection con = (OracleConnection)
    DriverManager.getConnection(connectString,"scott",
                        "tiger");
    con.setAutoCommit(false);
    return con;

  • Message-mappings: stored in which database-table?

    Hello everybody,
    I want to code some ABAP to check some message-mappings.
    Does anybody know in which DB-tables the mapping including the mapping steps are stored?
    Thanks a lot.
    Regards Mario

    Hi Muller,
    Check these tables,
    <b>/SAPDMC/LSOMAP</b>                 Field Mapping
    <b>/SAPTRX/SCAOTMAP              </b>
    <b>/SAPTRX/SCCNDMAP              </b>  <b>/SAPTRX/SCEVTMAP              </b>
    <b>/SAPTRX/SCFUNMAP              </b> /<b>SAPTRX/SCSOMAP               </b>
    or Just say map in SE11 and u will get a list..
    Regfards,
    Sridhar

  • Additional receipts Information  stored in which database table

    Hi All,
    I Know addtional receipts can be controled VIA  table V_T706B1_B.
    But when we have to activae the link under Travel Expense Manager ->Trip receipts ->Additio Receipts Information -> Additional Receipts Information via transaction FITVFELD.
    I want to know , If I make change to this field what is the background table the changes will be stored.
    Thanks in advance,

    Hello,
    One thing is that if someone is customizing in ESS then the transaction is FITVFELD_WEB.
    The whole tab related customization are stored in the table T706S.
    When you open the transaction FITVFELD_WEB or FITVFELD then it opens the trip schema.
    Double click on the trip schema. Then you will see the many check box and fields to be filled.
    Press F1 on that field and you will get the table name for the text.
    If you want to check who made this changes then go to SE03 transaction and in object type write 'TABU' and then in front of that in the text field write the table name for which you want to check.
    you will get all the users who have made the changes in that table entries. you can then catch him.

  • Notification Comments are storing in which database table?

    Hi All,
    Can anyone help me to find the table name in which notification comments are storing (like checklist notification or Leave approval notification)

    Hi All,
    Can anyone help me to find the table name in which notification comments are storing (like checklist notification or Leave approval notification)

  • Poplist and displaying corresponding values from the database table

    Hi
    I have a poplist in a control block, the values of which are populated using a procedure. This is called in when-new-form-instance.
    This part works fine and values are filled in the poplist when form is opened..
    The datablock is based on a view. 3 columns from the view are selected to be displayed.
    Also the databock is filled with all values (for selected columns)
    Now when the poplist value is changed, I need the values in the datablock to be changed as well, but this is not happening.
    In my when-list-changed trigger, I have:
    go_block('datablock');
    execute_query;Please tell , where and what should I add to display the datablock values as per the poplist value.
    i.e, something like,
    select col1,col2,col3 from <view> where col4 =:control.col4
    Note:I tried in the where clause property of the block, but then nothing is displayed in the datablock
    Thanks

    This does not work , either..
    Before, when I changed the values from the list, it was still displaying same data on datablock always(all records)
    Now when I give this code,data is displayed in datablock only once(first time when the form opens)
    I have defined the Query data source type property on data block as "Table" but infact this datablock is based on a view..is this correct?
    Anything else I could try?

Maybe you are looking for