Forum Stats

  • 3,855,344 Users
  • 2,264,499 Discussions
  • 7,905,975 Comments

Discussions

How to Adjust Oracle Forms Size According To Screen Resolution.

MWaseem
MWaseem Member Posts: 200 Blue Ribbon
edited Jul 17, 2019 2:25AM in Forms

How to Adjust Oracle Forms Size According To Screen Resolution. i.e. In individual oracle forms 12.2.1.3.0 How i could set the CLientDPI value to adjust the screen resolution.

There is two tasks involved.

1) Getting the Screen Resolution.

2) Setting the Client DPI Value according to the screen resolution.

Setting the ClientDPI value in the below way is working for me.

http://machine:port/forms/frmservlet?config=form&ClientDPI=120   

Gary_AMWaseemF.MatzMika14

Best Answer

  • Michael Ferrante-Oracle
    Michael Ferrante-Oracle Senior Principal Product Manager USMember Posts: 7,414 Employee
    edited Nov 1, 2018 9:33AM Answer ✓

    There are several ways you could do this.  Which you use will depend on your use case and skill level.

    Option 1:

    If you are using Internet Explorer 11, you could use Java Script to detect the screen height/width then pass that information into the URL for Forms.  Here is an example of how to get that information:

    https://www.w3schools.com/jsref/prop_screen_width.asp

    Option 2:

    This would work regardless of IE or not.  You could use WebUtil to detect the screen resolution after the form starts then immediately make whatever changes you wanted.  The downside to this approach is that the user would see the form render smaller but then change to the larger size.  That said, the process should happen very quickly.

    Option 3:

    You could offer multiple links for users to select.  Maybe "Large screen", "Medium screen", "Small screen", etc.  Based on the link they choose they would get the chosen result.

    Option 4:

    Adding a "Settings" option into your application is also a nice feature.  In it you could offer the user an option to set their form size, colors, font size, etc.  You can then store this information in a table so that every time that user logs in those settings would be reused.  If you did something like this, I recommend adding an option to allow them to "Use these setting for future startup."  In other words, maybe they don't want to store the selected settings permanently.

    There are likely many other ways this could be done.  These were just a few examples I could think of off the top of my head.


    Michael Ferrante

    Senior Principal Product Manager

    Oracle

    Twitter: @OracleFormsPM

    Gary_AMWaseemMWaseem

Answers

  • Michael Ferrante-Oracle
    Michael Ferrante-Oracle Senior Principal Product Manager USMember Posts: 7,414 Employee
    edited Nov 1, 2018 9:33AM Answer ✓

    There are several ways you could do this.  Which you use will depend on your use case and skill level.

    Option 1:

    If you are using Internet Explorer 11, you could use Java Script to detect the screen height/width then pass that information into the URL for Forms.  Here is an example of how to get that information:

    https://www.w3schools.com/jsref/prop_screen_width.asp

    Option 2:

    This would work regardless of IE or not.  You could use WebUtil to detect the screen resolution after the form starts then immediately make whatever changes you wanted.  The downside to this approach is that the user would see the form render smaller but then change to the larger size.  That said, the process should happen very quickly.

    Option 3:

    You could offer multiple links for users to select.  Maybe "Large screen", "Medium screen", "Small screen", etc.  Based on the link they choose they would get the chosen result.

    Option 4:

    Adding a "Settings" option into your application is also a nice feature.  In it you could offer the user an option to set their form size, colors, font size, etc.  You can then store this information in a table so that every time that user logs in those settings would be reused.  If you did something like this, I recommend adding an option to allow them to "Use these setting for future startup."  In other words, maybe they don't want to store the selected settings permanently.

    There are likely many other ways this could be done.  These were just a few examples I could think of off the top of my head.


    Michael Ferrante

    Senior Principal Product Manager

    Oracle

    Twitter: @OracleFormsPM

    Gary_AMWaseemMWaseem
  • MWaseem
    MWaseem Member Posts: 200 Blue Ribbon
    edited Nov 2, 2018 1:29AM

    Sir thanks for your response.

    If I choose option 2.

    You said

    "You could use WebUtil to detect the screen resolution after the form starts then immediately make whatever changes you wanted. "

    Is it possible to set the ClientDPI value in forms trigger like When-new-forms instance

    Mika14
  • Michael Ferrante-Oracle
    Michael Ferrante-Oracle Senior Principal Product Manager USMember Posts: 7,414 Employee
    edited Nov 2, 2018 10:17AM

    No.  clientDPI is an applet parameter that must be detected prior to the form loading.  However, I like the idea and will discuss with development as a possible new feature for a future release.


    Michael Ferrante

    Senior Principal Product Manager

    Oracle

    Twitter: @OracleFormsPM

    F.MatzMWaseemMWaseemMika14
  • Naryan
    Naryan Member Posts: 1 Green Ribbon

    Dear sir

    I went through all the replies. I also face the same situation. Here, users have different monitor size. The clientdpi increases the forms size both horizontally and vertically. Is there anyway we can increase the screen size only horizontally

  • Michael Ferrante-Oracle
    Michael Ferrante-Oracle Senior Principal Product Manager USMember Posts: 7,414 Employee

    @Naryan As I mentioned, if you are trying to set the Forms clientDPI setting, the desired value must be passed in (e.g. on URL) upon requesting the form to start and not after. Further, clientDPI is actually a bit mis-represented in Forms in that what is referred to as clientDPI is actually the PPI (pixels per inch) value. Regardless, the size cannot be changed as a measurement of height/width.

    If you want to adjust your form in a granular way, as you have described you can do it programmatically only your own. Use GET_APPLICATION_PROPERTY to get the display size at startup. Using that information you can decide how to adjust other objects in your application. For example this will return the display size and assign each value to a global variable. (The use of a global was simply part of an example and is not the only approach possible).

    In a PRE-FORM trigger:

    :global.displayHeight := GET_APPLICATION_PROPERTY (DISPLAY_HEIGHT);
    :global.displayWidth := GET_APPLICATION_PROPERTY (DISPLAY_WIDTH);
    



    Michael Ferrante

    Senior Principal Product Manager

    Oracle

    Twitter: @OracleFormsPM