How to display download link with get_blob or get_blob_file_src ?

Hello there,
I am struggling to display a download link in a SQL query report.
Based on the requirement, I have to create a sql query report that the source contains a series of union select query.
Example here
WITH current_engagement AS (
SELECT defendant_id, engagement_id, pn, ethnicity, date_joined_aodt_court, case_manager_name
, participation_conditions, discharge_conditions
FROM engagement
WHERE defendant_id = :PXX_DEF
AND date_joined IS NOT NULL
AND ( date_terminated IS NULL OR to_date(date_joined,'DD/MM/YYYY') > to_date(sysdate,'DD/MM/YYYY'))
AND active = 1 AND ROWNUM = 1
ORDER BY defendant_id DESC
SELECT def.first_name, def.middle_name, def.surname, to_char(def.pn) AS "PN", to_char(def.nhi_number) AS "NHI"
,ce.ethnicity, to_char(ce.date_joined) as "DATE_JOINED ", ce.case_manager_name, ce.participation_conditions, ce.discharge_conditions
FROM defendant def INNER JOIN current_engagement ce
ON def.def_id = ce.defendant_id
UNION ALL
select ' <b>2. Phase Number</b>' , '<b>Date Started</b>' , '<b>Date Finised</b>' , '<b>Notes</b>' , null
,null , null , null , null , null
from dual
UNION ALL
SELECT TO_CHAR(NVL(ph.phase_number,'No Phase Found')), TO_CHAR(ph.date_started, 'DD/MM/YYYY'), TO_CHAR(ph.date_finished, 'DD/MM/YYYY'), ph.notes, null
, null , null , null , null , null
FROM phase_membership ph INNER JOIN current_engagement ce
ON ph.mpm_eng_id = ce.engagement_id
WHERE to_date(ph.date_started,'DD/MM/YYYY') <= TO_DATE(sysdate,'DD/MM/YYYY')
AND ( ph.date_finished IS NULL
OR TO_DATE(ph.date_finished, 'DD/MM/YYYY') >= TO_DATE(sysdate,'DD/MM/YYYY') )
AND ph.active = 1
UNION ALL
--more selects
-- then the last select is to list all related documents with download links
select '<b>6. Document Date</b>' , '<b>Document Type</b>' , '<b>Description</b>' , '<b>Download</b>'
, null ,null , null , null , null , null
from dual
UNION ALL
SELECT TO_CHAR(doc.date_received), doc.document_type, doc.comments, TO_CHAR(dbms_lob.getlength(doc.UPLOADED_FILE))
, null ,null , null , null , null , null
FROM document doc INNER JOIN current_engagement ce
ON doc.d_eng_id = ce.engagement_id
WHERE doc.active = 1
This report is generated fine.
But the requirement also ask to display a download link. And because it is union selects, all following selects must be the same as the first select column data types.
In this case, it has to be CHAR. Otherwise, it will generate error as below
ORA-01790: expression must have same datatype as corresponding expression
So I follow the GET_BLOB_FILE_SRC Function step from
http://docs.oracle.com/cd/E14373_01/apirefs.32/e13369/apex_util.htm#AEAPI129
I turn my last select into
SELECT TO_CHAR(doc.date_received), doc.document_type, doc.comments,
CASE WHEN NVL(dbms_lob.getlength(doc.UPLOADED_FILE),0) = 0
THEN NULL
ELSE
'Download'
END
, null ,null , null , null , null , null
FROM document doc INNER JOIN current_engagement ce
ON doc.d_eng_id = ce.engagement_id
WHERE doc.active = 1
Which the result inside the hreg is
http://app_address_here/f?p=208:48:1303335952329758:::::
while if I use Interactive report the link is
http://app_address_here/apex_util.get_blob?s=1303335952329758&a=208&c=66645817090447568&p=48&k1=12&k2=&ck=A18D20D407435BD649EA3399EC27BC00&rt=CR
and it works well.
I do a research and know that get_blob_file_source link to the source of the column / field name located in the first parameter.
So I had put the UPLOADED_FILE column, DOCUMENT table in the source of the column PN.
But it still does not show anything that close to the correct one that is generated by interactive report.
If anyone has any ideas, please help. If I need to manually write using get_blob , please give me an example.
I urgently need to do this report.
The version of APEX we use is Application Express 4.0.2.00.07
And I cannot ask for an upgrade to 4.2 till the end of next year.
Please help.
Thanks a lot in advance.
Ann.

Hi Ann,
Here you can see and download the example :
http://apex.oracle.com/pls/apex/f?p=63066:1
Please let me know if you need access the work space.
Hint, Please read the FAQ section. had you put your thread in a better format, you would have gotten a quicker response :)
Regards,
Fateh

Similar Messages

  • How to generate download links of packages through Pacman

    Hello World
    I have installed Arch base in virtual box before physical install. I have synchronized pacman database with pacman -Syy command. Now I want to install other stuff like x ,gnome, sound etc. Please tell me how to generate download link for any any package and all its dependencies to a text file with Pacman so that i can download it with wget on some other computer and then transfer it back to my system.
    Thanks
    Last edited by cadcrazy (2008-09-23 03:33:08)

    man pacman wrote:-p, --print-uris
               Print out URIs for each package that will be installed, including
               any dependencies yet to be installed. These can be piped to a file
               and downloaded at a later time, using a program like wget.

  • How to make downloadable links in Adobe Muse

    I am new to website design and am trying to figure out how to make downloadable links for some PDF flyers, PSD templates I am creating.   Not sure if "downloadable links" is the correct term for what I'm trying to say but in a nutshell I am creating Business Flyer's in PDF form and Photoshop PSD template files that I would like to be able to have my users click a link that allows them to download them right to their desktop.  Any help would really be appreciated!

    Hi caybar10gaming,
    I had the same question as you and was searching online for how to add "downloadable links" as well so your not alone in that lol. Anyways, I found this video that explains how to do this. I hope this helps you, as it did me. Good Luck  
    http://tv.adobe.com/watch/muse-feature-tour/add-and-link-to-any-type-of-file/
    -Caitlin

  • How to add a Link with children in the SuiteLink bar?

    Hello,
    I have developed a code to add a new link in the SuiteLink bar using delegate control that works as expected. Now I want to include a new link
    but with children, I have tried many options in my code but with not luck.
    What I need in the SuiteLink bar is something like:
    My Services   Newsfeed  OneDrive  Sites
        Service 1
        Service 2
        Service 3
    Any idea on how to achieve this?
    Thanks,
    Daniel
    Daniel Villacis

    Hi,
    According to your post, my understanding is that you want to add sublink in the top navigation bar.
    There is an article about this issue, it contains the steps about how to create a link with sublink in the top navigation bar, you can have a look at it.
    http://www.helpmeonsharepoint.com/2012/03/custom-sharepoint-top-menu-and.html
    Thanks,
    Jason
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Jason Guo
    TechNet Community Support

  • How to display archive link picture in pdf

    Hi, Experts
      I create a pdf form using tcode SFP, and create a graphics element in the form,
    but i don't want to use the MIME object to disaplay,because our pictures are archive link.
    How to display archive link picture in pdf form?
    Thanks you very much!
    Ken.li
    Edited by: Ken.Li on Nov 17, 2009 3:50 AM
    Edited by: Ken.Li on Nov 17, 2009 4:30 AM

    Hello,
    I can recommend you go through the tutorial called How Tou2026 Integrate ADOBE form on WebdynPro for ABAP and Deploy it on portal by Bhawanidutt Dabral. Ignore the fact it uses WD, I have tried the proposed solution how to load in the picture on a simple offline/ print form. Look around for this tutorial.
    It propose to use the FM as follows:
    CALL METHOD cl_ssf_xsf_utilities=>get_bds_graphic_as_bmp
        EXPORTING
          p_object       = c_graphics
          p_name         = lv_pernr1
          p_id           = c_bmap
          p_btype        = c_bcol
        RECEIVING
          p_bmp          = ls_z_if_test_cv-im_photo
        EXCEPTIONS
          not_found      = 1
          internal_error = 2
          OTHERS         = 3.
    It passes the picture as XSTRING into the form and there you bind this data stream to a Image Field (not an Image!!! check this twice). Don´t forget to check the checbox to include picture data into the form file.
    Hope this helps, Otto

  • How to make email link with a button with AC2 in flash cs3?

    How to make email link with a button with AC2 in flash cs3?
    I wrote this, but it does not work:
    btn_emailinfo.on (release) {
    getURL("mailto:"[email protected]");
    }

    I am guessing you put that on a frame?
    If so, the syntax is as follows:
    btn_emailinfo.onRelease = function(){
    getURL("mailto:[email protected]");
    Though, if you are placing it directly on the button itself,
    the syntax is:
    on(release){
    getURL("mailto:[email protected]");
    }

  • How to display polygons both with line contour and filled interior?

    How to display polygons both with line contour and filled interior?
    Java3D 1.3, Java 1.4.1-rc

    Hi,
    I just started with Java3D last week.
    I assume you mean drawing polygons with outlines (wireframe) in one color and polygon face filling with another color. If so, I've got the same question! (I usually think of "contour" to refers to plotting surface intensity of independent data like temperature or elevation, but I don't think you mean this.)
    The only solution I've found so far is to make two shapes with the same geometry.
    Here's an example - an outlined and filled cube. I made it using a generalize class DualShape which is two shapes with the same geometry, but one filled and one as a line.
    It works, although I can't say I understand the setPolygonOffset(), knowing what value to set. Without the command, the depthbuffer can't consistently decide which should be in front between the fills and lines so it looks bad.
    I certainly think it would be nicer to do both internally, like:
    pa.setPolygonMode(pa.POLYGON_LINE || pa.POLYGON_FILL);
    And then have setFillColor and setLineColor for each.
    I don't know why they don't allow this - maybe OpenGL can't do it like this so Java3D follows.
    If anyone has any better ideas I'd like to hear about it.
    Tom Ruen
    class DualCube extends DualShape // cube with outline and fill colors
    public DualCube(float ax, float ay, float az, //cube lower corner
    float bx, float by, float bz, //cube upper corner
    float br, float bg, float bb, //border color
    float fr, float fg, float fb) //fill color
    setGeometry(new CubeGeometry(ax,ay,az,bx,by,bz),br,bg,bb,fr,fg,fb);
    class DualShape extends BranchGroup //general shape with outline and fill colors
    Appearance ap1,ap2;
    PolygonAttributes pa1,pa2;
    ColoringAttributes ca1,ca2;
    Shape3D s1,s2;
    public void setGeometry(Geometry geo, float br, float bg, float bb, float fr, float fg, float fb)
    //filled shape:
    addChild(s1=new Shape3D(geo, ap1=new Appearance()));
    ap1.setPolygonAttributes(pa1=new PolygonAttributes()); pa1.setPolygonMode(pa1.POLYGON_FILL);
    ap1.setColoringAttributes(ca1=new ColoringAttributes()); ca1.setColor(fr,fg,fb);
    //lined (wire) shape:
    addChild(s2=new Shape3D(geo, ap2=new Appearance()));
    ap2.setPolygonAttributes(pa2=new PolygonAttributes()); pa2.setPolygonMode(pa2.POLYGON_LINE);
    ap2.setColoringAttributes(ca2=new ColoringAttributes()); ca2.setColor(br,bg,bb);
    pa2.setPolygonOffset(-1000); //Uncertain what "float" value to use!
    class CubeGeometry extends IndexedQuadArray //cube geometry data
    private static final int[] faces =
    0,3,2,1,
    0,1,5,4,
    1,2,6,5,
    2,3,7,6,
    3,0,4,7,
    4,5,6,7
    private static float[] verts = new float[24];
    public CubeGeometry(float ax, float ay, float az, //lower limit
    float bx, float by, float bz) //upper limit
    super(8, IndexedQuadArray.COORDINATES , 24);
    int n;
    n=0; verts[n]=ax; verts[n+1]=ay; verts[n+2]=az;
    n=3; verts[n]=bx; verts[n+1]=ay; verts[n+2]=az;
    n=6; verts[n]=bx; verts[n+1]=by; verts[n+2]=az;
    n=9; verts[n]=ax; verts[n+1]=by; verts[n+2]=az;
    n=12; verts[n]=ax; verts[n+1]=ay; verts[n+2]=bz;
    n=15; verts[n]=bx; verts[n+1]=ay; verts[n+2]=bz;
    n=18; verts[n]=bx; verts[n+1]=by; verts[n+2]=bz;
    n=21; verts[n]=ax; verts[n+1]=by; verts[n+2]=bz;
    setCoordinates(0, verts);
    setCoordinateIndices(0, faces);

  • HT1222 How do I download itunes with a MSVCR80.dll error message?

    How do I download itunes with a MSVCR80.dll error message?

    Solving the iTunes Installation Problems in Windows
    1. Apple has posted their solution here: iTunes 11.1.4 for Windows- Unable to install or open - MSVCR80 issue.
    2. If the Apple article does not fully resolve the problem for you, then try Troubleshooting issues with iTunes for Windows updates - MSVCR80.
    iTunes 11.1.4 for Windows- Tips for Unable to install or open - MSVCR80

  • How to display a cursor with sand glass ?

    I would like to know how to display a cursor with sand glass I am performing a long operation ?
    Thanks in advance.

    As long as you are using anything that extends Component...
    this.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
    doLongOperation();
    this.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));Hope this helps,
    Radish21
    PS the API is ALWAYS your friend
    http://java.sun.com/j2se/1.4.1/docs/api/
    http://java.sun.com/j2se/1.4.1/docs/api/java/awt/Cursor.html

  • How can display the link Personalize

    In the portal I am displaying the links:
    I have the role of admon.
    Help, Logoff in Head Area(MastHead) How can display the link Personalize?
    Regards

    Assign yourself eu_role.
    Thanks
    Prashant

  • How to display many Links like text with multi lines?

    I need to:
    1)display many links in one container like text
    2)each link have onClick event Handler
    Example:
    Link1 SomeLink2 Link3 \*
    Link4 AnatherLink5            \*
    AndOneMoreLink6              \*
    \* - right border of container
    i'v tried TileGroup, but it has colums.... Group - overlapped links in one place.... and so on.
    Any ideas how to do it?

    I think you overlooked some of the possibilities provided by Apex.
    For instance you can create a simple HTML region where you put the links as you prefer (makes sense if they are a fixed number and you need a special formatting).
    You can also create Lists (see shared components). Lists are specifically meant for links, like Task lists in the Apex Builder itself, but you cannot build them dynamically, so you must know in advance each and every static link.
    Or you can create a report if links come as result of a query which is good for building them dynamically.
    A fourth option is a PL/SQL region outputting HTP calls where you have total control over every aspect.
    Flavio
    http://oraclequirks.blogspot.com

  • Please Help::How to display a Map with LIsts as Keys and Values using JSTL

    Hi,
    I need some assistance on how to display a Map in JSP using struts or core JSTL. I have a HashMap which has a List of keys and each key maps to a value of an ArrayList.i.e I have an ArrayList of taxCodes and each taxCode maps to a value of taxDetails which is an ArrayList of details for for that particular taxCode. I have some trouble to display each taxCode then display taxDetails for each taxCode. Here is my code below:
    OrderDetails.java
    package orderitems;
    import java.sql.*;
    import java.util.*;
    public class OrderDetails {
        private LineOder lineOrder;
        private Map lineItems;
        //returns an item number, key_item, from its unique keys
        public int getItemNumber(int key_item, String key_year,
                String key_office,String key_client,String key_company){
            Connection conn = null;
            Statement stat = null;
            ResultSet rst = null;
            int itmNum = 0;
             * key_item a unique number for an item.
             * key_year,key_office,key_client,key_company unique keys
             * for each order where this key_item is taken
             * from.
            String select = "SELECT key_item FROM "+
                    Constants.WEB_TABLE +" WHERE key_item = " + key_item +
                    " AND key_year = '" + key_year + "'" +
                    " AND key_office = '" + key_office + "'" +
                    " AND key_client = '" + key_client + "'" +
                    " AND key_company = '" + key_company +"'";
            DbConnection dbConn = new DbConnection();
            try {
                conn = dbConn.getDbConnection(Constants.WEB_JNDI);
                stat = conn.createStatement();
                rst = stat.executeQuery(select);
                if(rst.next()){
                    itmNum = Integer.parseInt(rst.getString("key_item"));
            } catch (SQLException ex) {
                ex.printStackTrace();
            } finally{
                SQLHelper.cleanUp(rst, stat, conn);
            return itmNum;
        //get a list of item number(item codes)
        public List getAllItemNumbers(String key_year,
                String key_office,String key_client,String key_company){
            List itemNumbers = new ArrayList();
            LineItem itemNumber = null;
            Connection conn = null;
            Statement stat = null;
            ResultSet rst = null;
            String select = "SELECT key_item FROM "+ Constants.WEB_TABLE +
                    " WHERE key_year = '" + key_year + "'" +
                    " AND key_office = '" + key_office + "'" +
                    " AND key_client = '" + key_client + "'" +
                    " AND key_company = '" + key_company + "'";
            DbConnection dbConn = new DbConnection();
            try {
                conn = dbConn.getDbConnection(Constants.WEB_JNDI);
                stat = conn.createStatement();
                rst = stat.executeQuery(select);
                while(rst.next()){
                    itemNumber = new LineItem();
                    itemNumber.setKey_item(Integer.parseInt(rst.getString("key_item")));
                    itemNumbers.add(itemNumber);
            } catch (SQLException ex) {
                ex.printStackTrace();
            } finally{
                SQLHelper.cleanUp(rst, stat, conn);
            return itemNumbers;
        //get a list of tax codes
        public List getAllTaxCodes(int key_item, String key_year,
                String key_office,String key_client,String key_company){
            Connection conn = null;
            Statement stat = null;
            ResultSet rst = null;
            ItemTax taxCode;
            List taxCodes = new ArrayList();
            int itemNum = getItemNumber(key_item, key_year,
                    key_office,key_client,key_company);
            String select = "SELECT key_tax_code FROM "+
                    Constants.WEB_TABLE +" WHERE key_item = " + itemNum +
                    " AND key_year = '" + key_year + "'" +
                    " AND key_office = '" + key_office + "'" +
                    " AND key_client = '" + key_client + "'" +
                    " AND key_company = '" + key_company +"'";
            DbConnection dbConn = new DbConnection();
            try {
                conn = dbConn.getDbConnection(Constants.WEB_JNDI);
                stat = conn.createStatement();
                rst = stat.executeQuery(select);
                while(rst.next()){
                    taxCode = new ItemTax();
                    taxCode.setKey_tax_code(rst.getString("key_tax_code"));
                    taxCodes.add(taxCode);
            } catch (SQLException ex) {
                ex.printStackTrace();
            } finally{
                SQLHelper.cleanUp(rst, stat, conn);
            return taxCodes;
        /////This methode returns a Map which am trying to display in JSP
        //use tax code to get tax details
        public Map getItemTaxDetails(String key_year,String key_office,
                String key_client,String key_company,int key_item){
            ItemTax taxDetail = null;
            List taxDetails = new ArrayList();
            List itemTaxCodes = new ArrayList();
            Map itemTaxDetails = new HashMap();
            Connection conn = null;
            Statement stat = null;
            ResultSet rst = null;
            //get a list of all tax codes of an item with a
            //given item number
            itemTaxCodes = getAllTaxCodes(key_item,key_year,
                    key_office,key_client,key_company);
            DbConnection dbConn = new DbConnection();
            try {
                conn = dbConn.getDbConnection(Constants.WEB_JNDI);
                stat = conn.createStatement();
                for(Iterator taxCodeIter= itemTaxCodes.iterator(); taxCodeIter.hasNext();){
                    ItemTax itemTaxCode = (ItemTax)taxCodeIter.next();
                    String taxCode = itemTaxCode.getKey_tax_code();
                    String select = "SELECT tax_type,tax_value," +
                            "tax_limit_val FROM "+ Constants.WEB_TABLE +
                            " WHERE key_item = "+ key_item +
                            " AND key_year = '" + key_year + "'" +
                            " AND key_office = '" + key_office + "'" +
                            " AND key_client = '" + key_client + "'" +
                            " AND key_company = '" + key_company +"'" +
                            " AND key_tax_code = '" + taxCode + "'";
                    rst = stat.executeQuery(select);
                    while(rst.next()){
                        taxDetail = new ItemTax();
                        //records to be displayed only
                        taxDetail.setKey_item(Integer.parseInt(rst.getString("key_item")));
                        taxDetail.setTax_value(rst.getString("tax_value"));
                        taxDetail.setTax_limit_val(Float.parseFloat(rst.getString("tax_limit_val")));
                        //////other details records ommited//////////////////////////
                        taxDetails.add(taxDetail);////An ArrayList of taxDetails for each taxCode
                     * A HashMap which has all taxCodes of an item as its keys
                     * and an ArrayList of taxdetails as its values.
                     * I return this for display in a JSP.
                    itemTaxDetails.put(taxCode,taxDetails);
                System.out.println();
                System.out.println("*********CONSOLE OUTPUT*************");//display on console
                Set set = itemTaxDetails.keySet();
                Iterator iter = set.iterator();
                System.out.println("Key\t\tValue\r\n");
                while (iter.hasNext()) {
                    Object taxCode=iter.next();
                    Object details=itemTaxDetails.get(taxCode);
                    System.out.println(taxCode +"\t" + details);
                System.out.println("************************************");
            } catch (SQLException ex) {
                ex.printStackTrace();
            } finally{
                SQLHelper.cleanUp(rst, stat, conn);
            return itemTaxDetails;
        //details of an item with all its taxes
        public List getAllItemDetails(String key_year,
                String key_office,String key_client,String key_company){
            List lineItems = new ArrayList();
            List itemNumbers = new ArrayList();
            Map taxDetails = new HashMap();
            LineItem item = null;
            Connection conn = null;
            Statement stat = null;
            ResultSet rst = null;
            //A list of all item numbers in the declaration
            itemNumbers = getAllItemNumbers(key_year,
                    key_office,key_client,key_company);
            DbConnection dbConn = new DbConnection();
            try {
                conn = dbConn.getDbConnection(Constants.WEB_JNDI);
                stat = conn.createStatement();
                for(Iterator itemIter= itemNumbers.iterator(); itemIter.hasNext();){
                    LineItem itemNum = (LineItem)itemIter.next();
                    int itemNumber = itemNum.getKey_item();
                    String select = "SELECT item_description,item_mass," +
                            "item_cost" +
                            " FROM " + Constants.WEB_TABLE +
                            " WHERE key_year = '"+key_year+"'" +
                            " AND key_office = '"+key_office+ "'"+
                            " AND key_client = '"+key_client+ "'"+
                            " AND key_company = '"+key_company+ "'"+
                            " AND key_item = " + itemNumber;
                    rst = stat.executeQuery(select);
                    while(rst.next()){
                        item = new LineItem();
                        item.setItem_description(rst.getString("item_description"));
                        item.setItem_mass(Float.parseFloat(rst.getString("item_mass")));
                        item.setKey_item(Integer.parseInt(rst.getString("item_cost")));
                        //////other details records ommited//////////////////////////
                        /* A HashMap of all itemTaxeCodes as its keys and an
                         * ArrayList of itemTaxedetails as its values
                        taxDetails = getItemTaxDetails(item.getKey_year(),item.getKey_office(),
                                item.getKey_client(),item.getKey_company(),item.getKey_item());
                        //item tax details
                        item.setItmTaxes(taxDetails);
                        //list of items with tax details
                        lineItems.add(item);
            } catch (SQLException ex) {
                ex.printStackTrace();
            } finally{
                SQLHelper.cleanUp(rst, stat, conn);
            return lineItems;
        public Set getOrders(String key_year,String key_office,
                String key_client,String key_company){
            List lineItems = new ArrayList();
            Set lineOrders = new HashSet();
            Connection conn = null;
            Statement stat = null;
            ResultSet rst = null;
            LineOder lineOrder = null;
            String select = "SELECT * FROM " + Constants.WEB_TABLE +
                    " WHERE key_year = '" + key_year + "'" +
                    " AND key_office = '" + key_office + "'" +
                    " AND key_client = '" + key_client + "'" +
                    " AND key_company = '" + key_company + "'";
            DbConnection dbConn = new DbConnection();
            try {
                conn = dbConn.getDbConnection(Constants.WEB_JNDI);
                stat = conn.createStatement();
                rst = stat.executeQuery(select);
                while(rst.next()){
                    lineOrder = new LineOder();
                    lineOrder.setKey_year(rst.getString("key_year"));
                    lineOrder.setKey_office(rst.getString("key_office"));
                    lineOrder.setKey_client(rst.getString("key_client"));
                    lineOrder.setKey_company(rst.getString("key_company"));
                    ////list of items with all their details
                    lineItems = getAllItemDetails(lineOrder.getKey_year(),lineOrder.getKey_office(),
                            lineOrder.getKey_client(),lineOrder.getKey_company());
                    //setting item details
                    lineOrder.setItems(lineItems);
                    //a list of order with all details
                    lineOrders.add(lineOrder);
            } catch (SQLException ex) {
                ex.printStackTrace();
            } finally{
                SQLHelper.cleanUp(rst, stat, conn);
            return lineOrders;
    Controller.java
    package orderitems;
    import java.io.*;
    import java.util.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class Controller extends HttpServlet {
        private Map taxDetails = new HashMap();
        private OrderDetails orderDetails = null;
        protected void processRequest(HttpServletRequest request,
                HttpServletResponse response)throws
                ServletException, IOException {
            response.setContentType("text/html;charset=UTF-8");
            String key_year = "2007";
            String key_office = "VZX00";
            String key_company = "DG20";
            String key_client =  "ZI001";
            int key_item = 1;
            String nextView = "/taxdetails_list.jsp";
            orderDetails = new OrderDetails();
            taxDetails = orderDetails.getItemTaxDetails(key_year,key_office,
                    key_company,key_client,key_item);
            //Store the collection objects into HTTP Request
            request.setAttribute("taxDetails", taxDetails);
            RequestDispatcher reqstDisp =
                    getServletContext().getRequestDispatcher(nextView);
            reqstDisp.forward(request,response);
        protected void doGet(HttpServletRequest request,
                HttpServletResponse response)throws
                ServletException, IOException {
            processRequest(request, response);
        protected void doPost(HttpServletRequest request,
                HttpServletResponse response)throws
                ServletException, IOException {
            processRequest(request, response);
    taxdetails_list.jsp
    <%@page contentType="text/html"%>
    <%@page pageEncoding="UTF-8"%>
    <%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
        <head>
            <title>Simple Tax Detail Diaplay ::</title>
            <link rel="stylesheet" type="text/css" href="imgs/orders.css"/>
        </head>
        <body>
            <jsp:useBean id="taxDetails" class="java.util.HashMap" scope="request"/>
            <table>
                <c:forEach items="${taxDetails}" var="hMap">
                    <tr>
                        <td><c:out value="${hMap.key}" /></td>
                        <!--td><%--c:out value="${hMap.value}" /--%></td-->
                    </tr>
                </c:forEach>
            </table>
        </body>
    </html>am displaying taxCodes(in this case i have VAT and ICD) fine but cant figure out how to display a list of value for each taxCode.Here is the output am getting
    both in my JSP and on the console:
    *******************************CONSOLE OUTPUT****************************
    Key          Value
    ICD     [orderItems.ItemTax@13e6226, orderItems.ItemTax@9dca26]
    VAT [orderItems.ItemTax@13e6226, orderItems.ItemTax@9dca26]
    Edited by: aiEx on Oct 8, 2007 6:54 AM

    hi evnafets,
    yes i need a nested for loop.I have tried your advice but my bean properties are not found.Am getting this error:
    javax.servlet.ServletException: Unable to find a value for "key_item" in object of class "java.lang.String" using operator "."
    I have tried this as stated earlier in the post:I have tried to make the method getItemTaxDetails return a List and get the returned list value as taxDetails. I then tested to display this list on JSP and its displaying fine.
    public List getItemTaxDetails(String key_year,String key_office,
                String key_client,String key_company,int key_item){
            ItemTax taxDetail = null;
            List taxDetails = new ArrayList();
            List itemTaxCodes = new ArrayList();
            Map itemTaxDetails = new HashMap();
            Connection conn = null;
            Statement stat = null;
            ResultSet rst = null;
            //get a list of all tax codes of an item with a
            //given item number
            itemTaxCodes = getAllTaxCodes(key_item,key_year,
                    key_office,key_client,key_company);
            DbConnection dbConn = new DbConnection();
            try {
                conn = dbConn.getDbConnection(Constants.WEB_JNDI);
                stat = conn.createStatement();
                for(Iterator taxCodeIter= itemTaxCodes.iterator(); taxCodeIter.hasNext();){
                    ItemTax itemTaxCode = (ItemTax)taxCodeIter.next();
                    String taxCode = itemTaxCode.getKey_tax_code();
                    String select = "SELECT tax_type,tax_value," +
                            "tax_limit_val FROM "+ Constants.WEB_TABLE +
                            " WHERE key_item = "+ key_item +
                            " AND key_year = '" + key_year + "'" +
                            " AND key_office = '" + key_office + "'" +
                            " AND key_client = '" + key_client + "'" +
                            " AND key_company = '" + key_company +"'" +
                            " AND key_tax_code = '" + taxCode + "'";
                    rst = stat.executeQuery(select);
                    while(rst.next()){
                        taxDetail = new ItemTax();
                        //records to be displayed only
                        taxDetail.setKey_item(Integer.parseInt(rst.getString("key_item")));
                        taxDetail.setTax_value(rst.getString("tax_value"));
                        taxDetail.setTax_limit_val(Float.parseFloat(rst.getString("tax_limit_val")));
                        //////other details records ommited//////////////////////////
                        taxDetails.add(taxDetail);////An ArrayList of taxDetails for each taxCode
                     * A HashMap which has all taxCodes of an item as its keys
                     * and an ArrayList of taxdetails as its values.
                     * I return this for display in a JSP.
                    itemTaxDetails.put(taxCode,taxDetails);
            } catch (SQLException ex) {
                ex.printStackTrace();
            } finally{
                SQLHelper.cleanUp(rst, stat, conn);
            //return itemTaxDetails;
            return taxDetails;
        }And my JSP
    taxdetails_list.jsp
    <%@page contentType="text/html"%>
    <%@page pageEncoding="UTF-8"%>
    <%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
            <link rel="stylesheet" type="text/css" href="imgs/orders.css"/>
        </head>
        <body>
            <table>
                <c:forEach var="curRecord" items="${taxDetails}" varStatus="rowCounter">
                        <c:choose>
                            <c:when test="${rowCounter.count % 2 == 0}">
                                <c:set var="rowStyle" scope="page" value="odd" />
                            </c:when>
                            <c:otherwise>
                                <c:set var="rowStyle" scope="page" value="even" />
                            </c:otherwise>
                        </c:choose>
                        <tr class="${rowStyle}">
                            <td>${curRecord.key_item}</td>
                            <td>${curRecord.tax_value}</td>
                            <td>${curRecord.tax_limit_val}</td>
                        </tr>
                    </c:forEach>
            </table>
        </body>
    </html>I can't see where am going wrong even with your advice.Please help.
    Thnx.

  • Download link with parameters.

    I've created a generic download function that takes a couple of parameters. The function works but now I'm trying to find out how to provide a download link that has the parameters filled in based on some page items.
    Page items:
    P38_export_type: The user can select what kind of data to download
    P38_filename: The user can provide a filename
    What I've tried is to create a button: Redirect to URL
    #OWNER#.download_my_file?p_application_id=&APP_ID.&p_filenaam=&P38_FILENAME.&p_functie=Statistiek&p_parameter1=&P38_EXPORT_TYPE.
    Although this creates a link, the parameters are filled on page load. This is to early, I need the values at the time the button is pressed.
    Any ideas how to do this?

    Hi thanks,
    In the meantime I figured out something similar.
    function my_redirect ()
      redirect(html_GetElement('P38_OWNER').value+".download_my_file?p_application_id="+html_GetElement('pFlowId').value+"&p_filenaam="+html_GetElement('P38_BESTAND').value+"&p_functie=Statistiek&p_parameter1="+html_GetElement('P38_SOORT_EXPORT').value);
    } I struggled a bit with the owner value before I decided to put it in a hidden field. Passing it as a variable is a better idea.
    It seems that accessing the item values can be done in several ways.
    redirect or location.href=URL ? any preference?

  • How to display a linked multi-page pdf?

    I am a DW newbie building a small website for my book design business. I would like to show book design samples as spreads in a multi-page pdf (set up with page display set to two-up)  linked to thumbnail images on a web page. I have created the links, but the pdf either opens in another window as single page, or (in Firefox) triggers a dialog box which asks to either dowload or open in Acrobat. Is the display of pdfs always dictated by the client browser settings or is there a DW behavior or widget that can accomplish this? Any other ideas on how best to display these samples? DW CS5.5, Mac OS 10.6.8.

    Thanks for your reply. I think I have what I need now: I can export pdfs out of InDesign as spreads, and then the pdf reader in the browser sees that spread in the linked pdf as a single page. Should have thought of that sooner. Would be nice if there was some way to control the display of linked pdfs with code rather than be at the mercy of the client browser.

  • How to display 2 layouts with 2 different Header and Footer in a template.

    Hi,
    I am using XML Publisher 5.5. I have created one template which is having two layouts. I am using <?Start: Body?> and <?end body?> for displaying Headers and footers. Now my problem is, I need to display first layout with it's associated Header and footer and then second layout with other header and footer. But the two layouts should come in single template file. How is it possible?. Is there any work around? Please help me as this is the urgent requirement to my client.
    Thanks.
    Siva.

    No problem. Select Insert -> Break from the menu bar. Then select a "Section Break" - Next page.
    Header 1
    <?start:body?>
    Page 1
    <?end: body?>
    Footer 1
    ==================Section Break (Next Page)=================
    Header 2
    <?start:body?>
    Page 2
    <?end: body?>
    Footer 2
    Worked like a charm.
    Klaus

Maybe you are looking for

  • Encoding and compression in After Effects (Problems with some colors and some effects))

    Hello dear friends, I would like to export an openning title video for a movie, which is about 2,45 seconds long and 22 GB (Uncompressed) The footage is 1920X1080. There are a lot of effects, such as, alpha chanel clips of smoke, explossions and stuf

  • How can I create a BlobInputStream (=where do I find the oracle.ord.media package)?

    import oracle.ord.media.jai.io.*; Hello, does anybody know where I can download this package? I need it to create a BlobInputStream and then a RenderedImage from a Stream. BlobInputStream inStream = new BlobInputStream(blob); RenderedImage image = JA

  • Contacts Side Bar: I Downloaded it but I am unable to install it.

    I am using Windows 8.1 and Chrome. I have been very happy with Mozilla Thunderbird but I have had a problem installing the contacts sidebar. I tried to use the same process as I did when I added a calendar but to no avail. I'm one of those guys who n

  • Can the CBO optimizer be slow ?

    Hi, i have a strange problem with a query. The first time i execute the query it takes 3 or 4 seconds to be executed. The query has a correct plan (i use the FIRST_ROWS hint) and the second time i execute it then the response is quite immediate. I ha

  • Laptop powers up, immidiatel​y shuts off

    Hi I have a dv6-6165tx which has been working fine for almost 2 yrs until today. I dont use the laptop frequently. It is running on win 7 x64 it came with, and updated drivers. I tried to run my laptop after a week of gap but it did not start. When I