9 Replies Latest reply: Dec 13, 2012 9:15 AM by Jitendra RSS

    show database image in place of logo position

    Jitendra
      Hi All,
      I have different users from different country .
      I am storing the images in a blob column into the table.
      
      suppose user from UK logged in then i need to show the image stored for that user on a page at company logo position(at top of the page).
      if user from other country logged in then show image related to that user on the logo position(at top of the page).
      
      My problem is how to show the image from table at top of the page (at logo position).
      
      I think  we can do this by editing template.
      Apex Version : 4.1
      DB version : 11.2.0.3.0

      Please help me on this.

      Regards,
      Jitendra
        • 1. Re: show database image in place of logo position
          VC
          Jitendra wrote:
          Hi All,
          Create an application item called F_LOGO
          I have different users from different country .
          I am storing the images into the table.
          In your login page add a new process or amend the existing process to populate the application item F_LOGO with appropriate image name.
          //example
          IF COUNTRY = 'UK' THEN
             :F_LOGO := 'uk.png';
          ELSE
             :F_LOGO := 'someimage.png';
          END IF
          suppose user from UK logged in then i need to show the image stored for that user on a page at company logo position(at top of the page).
          if user from other country logged in then show image related to that user on the logo position(at top of the page).
          
          My problem is how to show the image from table at top of the page (at logo position).
          
          I think  we can do this by editing template.
          No, Go to shared components > logo section > in logo field enter *&F_LOGO.*

          Please note that you may have to include the static path/procedure call before *&F_LOGO.*
          Example: #WORKSPACE_IMAGES#&F_LOGO.

          Thanks,
          Vikram
          • 2. Re: show database image in place of logo position
            fac586
            VC wrote:
            Jitendra wrote:
            Hi All,
            Create an application item called F_LOGO
            I have different users from different country .
            I am storing the images into the table.
            In your login page add a new process or amend the existing process to populate the application item F_LOGO with appropriate image name.
            //example
            IF COUNTRY = 'UK' THEN
            :F_LOGO := 'uk.png';
            ELSE
            :F_LOGO := 'someimage.png';
            END IF
            suppose user from UK logged in then i need to show the image stored for that user on a page at company logo position(at top of the page).
            if user from other country logged in then show image related to that user on the logo position(at top of the page).
            
            My problem is how to show the image from table at top of the page (at logo position).
            
            I think  we can do this by editing template.
            No, Go to shared components > logo section > in logo field enter *&F_LOGO.*

            Please note that you may have to include the static patch/procedure call before *&F_LOGO.*
            Example: #WORKSPACE_IMAGES#&F_LOGO.
            But they're storing the images in a BLOB column in a custom table, not the APEX repository...
            • 3. Re: show database image in place of logo position
              Jitendra
              Hi VC,

              Thanks for the quick reply

              I have already written the process on page load to fetch the image on application item.
              please see the code below.
              begin
              SELECT ICON into :F125_IMG
              FROM SUPPLIER S,UNITY_USER UU,COMPANY_USERS LCU
              WHERE S.ID=LCU.SUPPLIERID
              AND LCU.USERID=UU.ID
              and upper(uu.logonname)=upper(v('APP_USER'));
              
              exception when others then
              :F125_IMG:='logo.png';
              end;
              
              // but i am not getting where to place the application item F125_IMG so this will reflect as a logo on my page.
              Thanks,
              Jitendra
              • 4. Re: show database image in place of logo position
                Jitendra
                Hi fac586,
                But they're storing the images in a BLOB column in a custom table, not the APEX repository...
                Yes you are correct.


                Thats the problem,
                how can i display the images from database at logo position.


                Regards,
                Jitendra
                • 5. Re: show database image in place of logo position
                  VC
                  Jitendra wrote:
                  Hi fac586,
                  But they're storing the images in a BLOB column in a custom table, not the APEX repository...
                  Yes you are correct.


                  Thats the problem,
                  how can i display the images from database at logo position.


                  Regards,
                  Jitendra
                  Create a database procedure to print the image from your blob column

                  See this example http://blog.hilandco.com/2010/05/how-to-show-blob-type-column-as-image.html

                  You will need to add something like below in your logo field

                  my_image_display?p_image_id=&F_LOGO.
                  • 6. Re: show database image in place of logo position
                    fac586
                    Jitendra wrote:
                    Hi All,

                    I have different users from different country .
                    I am storing the images into the table.

                    suppose user from UK logged in then i need to show the image stored for that user on a page at company logo position(at top of the page).
                    if user from other country logged in then show image related to that user on the logo position(at top of the page).

                    My problem is how to show the image from table at top of the page (at logo position).

                    I think we can do this by editing template.
                    Please don't use <tt>\
                    ...\
                    </tt> tags for content that isn't code or sample output.

                    It depends on how you determine which country the user is from and how you look up the image.

                    One obvious way to do it is to edit the page templates and move an otherwise unused region position placeholder (<tt>#REGION_POSITION_nn#</tt>) to the logo position. Then create a Page Zero Dynamic PL/SQL region at that region position and use <tt>APEX_UTIL.GET_BLOB_FILE_SRC </tt> to create the HTML to display the image.
                    • 7. Re: show database image in place of logo position
                      VC
                      fac586 wrote:
                      VC wrote:
                      Jitendra wrote:
                      Hi All,
                      Create an application item called F_LOGO
                      I have different users from different country .
                      I am storing the images into the table.
                      In your login page add a new process or amend the existing process to populate the application item F_LOGO with appropriate image name.
                      //example
                      IF COUNTRY = 'UK' THEN
                      :F_LOGO := 'uk.png';
                      ELSE
                      :F_LOGO := 'someimage.png';
                      END IF
                      suppose user from UK logged in then i need to show the image stored for that user on a page at company logo position(at top of the page).
                      if user from other country logged in then show image related to that user on the logo position(at top of the page).
                      
                      My problem is how to show the image from table at top of the page (at logo position).
                      
                      I think  we can do this by editing template.
                      No, Go to shared components > logo section > in logo field enter *&F_LOGO.*

                      Please note that you may have to include the static path/procedure call before *&F_LOGO.*
                      Example: #WORKSPACE_IMAGES#&F_LOGO.
                      But they're storing the images in a BLOB column in a custom table, not the APEX repository...
                      @Paul - I thought OP might know how to get the image from a blob, But I did mention that saying to include static path/procedure call
                      • 8. Re: show database image in place of logo position
                        Jitendra
                        Thanks VC and fac586 ,

                        I will try the solution suggested by both of you.

                        and then let you know.


                        Thanks and Regards,
                        Jitendra
                        • 9. Re: show database image in place of logo position
                          Jitendra
                          Hi VC, fac586,

                          Thanks for the solution.

                          I did this by another way.

                          Created one Html region on page Zero
                          Template - Borderless Region - No Title.
                          Dispaly point - After header.

                          Then i have created Display image type item
                          Based on - BLOB Column returned by SQL statement
                          SQL Statement - i fetched BLOB column  according to the user.


                          This works for me.
                          It is showing country logo according to the user.


                          Regards,
                          Jitendra