Controlling printmargins with java/jsp/html

I was wondering if there is any way to set the standard margins in browser to 0.
As for Firefox, the settings for top, bottom and both sides margins are sat to 12,7.
Is there any way for my application to set this values (including all other browsers as well) to print what I am presenting in my viewing.
I have a webpage that I want the user to get a "printer friendly" new page which controlles the margins for the print.
As for now, the print has these "standard" values to have the page centered arround white space which I want to get rid of.
The webpage itself is shown perfectly when I manually set the marings to 0, but for someone who doens't know how to set these would get the first page printed on the first side, and then the leftover at the start on page 2.
Is there a way to do this with jsp/html/java? So that the printmargins are sat to 0 at eah "printer friendly" page?
Please advice - got myself stuck here;) -,
Cincerely P�l

Then this might not be a suited javaquestion;) But do you know where to start searching for a solution. I've been googling all over the place for a hint on how to sort this out.
P�l

Similar Messages

  • Is this possible with java/JSP iview?

    I am trying to dynamically create a number of gridLayoutCells/textviews.
    I am having a problem creating the strings in my JAVA code. For example: <i>hbj1 = "<hbj:";</i>.
    This returns "".
    Can you not use certain characters in strings???
    It seems like I cannot make a string with the '<' character in it.
    I have a JSP.
    The code is, for example,...
    <hbj:content id="myContext" >
      <hbj:page title="myPage">
       <hbj:form id="myFormId" method="post" action="">
         <hbj:gridLayout id="myGridLayout">
           <b><%=MyBean.getReportList() %></b>
         </hbj:gridLayout>
       </hbj:form>
      </hbj:page>
    </hbj:content>
    My JAVA code builds a string -
    hbjFull = "";
    count = 1;
    DO
    hbj1 = "<hbj:gridLayoutCell id='myGLC3x" + Integer.toString(count) + "x2' ";
    hbj2 = " horizontalAlignment='LEFT' rowIndex=" + Integer.toString(count) + " columnIndex='2'>";
    hbj3 = "<hbj:textView id='tvReportNm" + Integer.toString(count) + "' design='STANDARD' width='250' wrapping='TRUE' encode='false' text='" + itemKey + "' /></hbj:gridLayoutCell>";
    hbjFull = hbjFull + hbj1 + hbj2 + hbj3;
    count = count + 1;
    WHILE
    <b>myBean.setReportList(hbjFull);</b>
    <i>itemKey is populated from the results of a RFC to SAP BW database.</i>

    Thanks to all...
    I really should better clarify my question.
    I am not trying to dynamically create the gridlayout/textviews. Not as in "on-the-fly".
    I want to create the layout in my doInitialization java method. Just a one time thing.
    Basically, I need a textview (gridrow) for each row that I have returned in a result set.
    Therefore...shouldn't my original idea work?
    My string is being set to my bean just fine.
    So, now I need the JSP to retrieve the value from the bean.
    My JSP code basically looks like this...
    <hbj:gridLayout id="myGridLayout2" columnSize="3" cellSpacing="5">
       <%=MyBean.getReportList() %>
    </hbj:gridLayout>
    where MyBean.getReportList() should be the value from the bean.
    I did create a javascript function that pops up an alert that shows that the value in the bean is correct. This value is:
    <hbj:gridLayoutCell id="myGridLayoutCell2x4x2" horizontalAlignment="LEFT" rowIndex="5" columnIndex="2" colSpan="80">
             <hbj:textView id="tv4" design="HEADER2" width="250" wrapping="TRUE" encode="false" text="Report 1" />      
           </hbj:gridLayoutCell>
    <hbj:gridLayoutCell id="myGridLayoutCell2x5x2" horizontalAlignment="LEFT" rowIndex="5" columnIndex="2" colSpan="80">
             <hbj:textView id="tv5" design="HEADER2" width="250" wrapping="TRUE" encode="false" text="Report 2" />      
           </hbj:gridLayoutCell>
    I guess I am just not sure how to use the value from the bean.

  • Replacement of OAF LOV with Java\JSP screens?

    Hi All,
    Am facing performance issue in one of my LOV. Query has been tuned at its best but still behaving worse.
    Got an idea of embed\invoke the jsp\java screens which can query the data faster. If anyone had already tried this, please let me know your experience. Or If you foresee any impact due to this design,please throw your opinion on this. Thanks.
    Regards, Soorya

    I would suggest to tune at the OAF side if query is already tuned.
    There are many parameters on VO wizard that can be used to tune the performance of LOV VO.
    Advanced View Object Techniques:
    •Section 35.2, "Tuning Your View Objects for Best Performance"
    http://docs.oracle.com/cd/E15051_01/web.1111/b31974/bcadvvo.htm

  • Device control software with Java?

    Hi there,
    i don't know if this is the correct forum for my answer, but I'll just give it a try.
    I am confronted with the task of developing a fat-client-software for windows-based PCs, for receiving and handling data coming from complex, lab-like devices.
    Is Java a good choice for such a task and what kind of architecture, framework, library would you recommend?
    Thanks in advance,
    Xenofon

    kajbj wrote:
    mk637 wrote:
    Can you please be more specific? What information do you need?I don't need any information. Yuo need to check if you can access those devices from Java in any way.Ok. But do you need to implement all of the communication, or do they provide client libraries that handles it for you? What languages do they in that case support?

  • Is there a way to call the windows control panel with Java?

    Or any of the other panels like dial-up networking, add/remove programs, etc.

    To open the Display Properties window, use:
    RunTime.exec("rundll32.exe shell32.dll,Control_RunDLL c:\windows\system\desk.cpl");Look in your systems folder for all the files ending in ".cpl" and replace desk.cpl with that filename.

  • Java / jsp / html

    1. <img border='0' src="C:\pic\picture1.gif">
    2. <img border='0' src="\webapps\pic\picture1.gif">
    (the path in both statements is correct)
    Hi,
    When i call the pic by the 1st method the picture (.gif) is displayed on the localhost machine but cannot be accessed from the remote machine.
    with the second mothod the localhost and the remote user both cannot see the icon.
    does any one know how to solve this problem?
    thnx

    I did try this it still doesn't work :(You tried both:
    webapps/pics/picture1.gif
    AND
    pics/picture1.gif
    Type in on the address bar: http://localhost:8080/pics/picture1.gif
    Does the image show up? If so, and pics/picture1.gif does not work, try /pics/picture1.gif.
    If it does not show up, try moving the pics folder under your ROOT webapp so it would be:
    webapps/ROOT/pics/picture1.gif
    Then try accessing with
    pics/picture1.gif
    /pics/picture1.gif
    or
    ../pics/picture1.gif

  • How to change a setting in the Java Control Panel with command line

    Hi,
    I am trying to figure out how to change a setting in the Java Control Panel with command line or with a script. I want to enable "Use SSL 2.0 compatible ClientHello format"
    I can't seem to find any documentation on how to change settings in the Java Control Panel via the command line
    Edited by: 897133 on Nov 14, 2011 7:15 AM

    OK figured it out. This is for the next person seeking the same solution.
    When you click on the Java Control Panel (found in the Control panel) in any version of Windows, it first looks for a System Wide Java Configuration (found here: C:\Windows\Sun\Java\Deployment). At this point you must be wondering why you don't have this folder (C:\Windows\Sun\Java\Deployment) or why its empty. Well, for an enterprise environment, you have to create it and place something in it - it doesn't exist by default. So you'll need a script (I used Autoit) to create the directory structure and place the the two files into it. The two files are "deployment.properties" and "deployment.config".
    Example: When you click on the Java Control Panel it first checks to see if this directory exists (C:\Windows\Sun\Java\Deployment) and then checks if there is a "deployment.config". If there is one it opens it and reads it. If it doesn't exist, Java creates user settings found here C:\Users\USERNAME\AppData\LocalLow\Sun\Java\Deployment on Windows 7.
    __deployment.config__
    It should look like this inside:
    *#deployment.config*
    *#Mon Nov 14 13:06:38 AST 2011*
    *# The First line below specifies if this config is mandatory which is simple enough*
    *# The second line just tells Java where to the properties of your Java Configuration*
    *# NOTE: These java settings will be applied to each user file and will overwrite existing ones*
    deployment.system.config.mandatory=True
    deployment.system.config=file\:C\:/WINDOWS/Sun/Java/Deployment/deployment.properties
    If you look in C:\Users\USERNAME\AppData\LocalLow\Sun\Java\Deployment on Windows 7 for example you will find "deployment.properties". You can use this as your default example and add your settings to it.
    How?
    Easy. If you want to add *"Use SSL 2.0 compatible ClientHello format"*
    Add this line:
    deployment.security.SSLv2Hello=true
    Maybe you want to disable Java update (which is a big problem for enterprises)
    Add these lines:
    deployment.javaws.autodownload=NEVER
    deployment.javaws.autodownload.locked=
    Below is a basic AutoIt script you could use (It compiles the files into the executable. When you compile the script the two Java files must be in the directory you specify in the FileInstall line, which can be anything you choose. It will also create your directory structure):
    #NoTrayIcon
    #RequireAdmin
    #Region ;**** Directives created by AutoIt3Wrapper_GUI ****
    #AutoIt3Wrapper_UseX64=n
    #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
    Func _JavaConfig()
         $ConfigFile_1 = @TempDir & "\deployment.properties"
         $ConfigFile_2 = @TempDir & "\deployment.config"
         FileInstall ("D:\My Documents\Autoit\Java config\deployment.properties", $ConfigFile_1)
    FileInstall ("D:\My Documents\Autoit\Java config\deployment.config", $ConfigFile_2)
         FileCopy($ConfigFile_1, @WindowsDir & "\Sun\Java\Deployment\", 9)
         FileCopy($ConfigFile_2, @WindowsDir & "\Sun\Java\Deployment\", 9)
         Sleep(10000)
         FileDelete(@TempDir & "\deployment.properties")
         FileDelete(@TempDir & "\deployment.config")
    EndFunc
    _JavaConfig()
    Now if you have SCUP and have setup Self Cert for your organization, you just need to create a SCUP update for JRE.
    Edited by: 897133 on Nov 16, 2011 4:53 AM

  • How to create dom treeof html page with java

    hi, all
    i met with a problem how to create dom tree of html page wih jave, that is, given a html page, how to create a dom tree of this page with java?
    thanks in advance.
    regards
    richard

    but i m using this code to create node in html file
    HTMLLIElement li = (HTMLLIElement)appHTML.createElement("LI");
    Text txt = appHTML.createTextNode(name);
    li.appendChild(txt);
    appHTML.getElementById("name").appendChild(li);
    this will display all name value which is coming from database,
    and i want to assign a hyperlink to it,
    I have id with name also so I thought that using id i will
    create javascript like
    function popup(id)
         if(id==1)
              var n1 = window.open("../list/name1.html");
         if(id==2)
              var n1 = window.open("../list/name2.html");
    this way i want to popup particular file if i can pass id value in this function
    so want hyperlink like
    name

  • Issue with passing parameters through Java-JSP in a report with cross tab

    Can anyone tell me, if there's a bug in Java SDK in passing the parameters to a report (rpt file) that has a cross tab in it ?
    I hava report that works perfectly fine
       with ODBC through IDE and also through browser (JSP page)
    (ii)    with JDBC in CR 2011 IDE
    the rpt file has a cross tab and accpts two parameters.
    When I run the JDBC report through JSP the parameters are never considered. The same report works fine when I remove the cross tab and make it a simple report.
    I have posted this to CR SDK forum and have not received any reply. This have become a blocker and because of this our delivery has been postponed. We are left with two choices,
       Re-Write the rpt files not to have cross-tabs - This would take significant effort
    OR
    (ii)  Abandon the crystal solution and try out any other java based solutions available.
    I have given the code here in this forum posting..
    CR 2011 - JDBC Report Issue in passing parameters
    TIA
    DRG
    TIA
    DRG

    Mr.James,
    Thank you for the reply.
    As I stated earlier, we have been using the latest service pack (12) when I generated the log file that is uploaded earlier.
    To confirm this further, I downloaded the complete eclipse bundle from sdn site and reran the rpt files. No change in the behaviour and the bug is reproducible.
    You are right about the parameters, we are using  {?@Direction} is: n(1.0)
    {?@BDate} is: dt(d(1973-01-01),t(00:00:00.453000000)) as parameters in JSP and we get 146 records when we directly execute the stored procedure. The date and the direction parameter values stored in design time are different. '1965-01-01' and Direction 1.
    When we run the JSP page, The parameter that is passed through the JSP page, is displayed correctly on the right top of the report view. But the data that is displayed in cross tab is not corresponding to the date and direction parameter. It corresponds to 1965-01-01 and direction 1 which are saved at design time.
    You can test this by modifying the parameter values in the JSP page that I sent earlier. You will see the displayed data will remain same irrespective of the parameter.
    Further to note, Before each trial run, I modify the parameters in JSP page, build them and redeploy so that caching does not affect the end result.
    This behaviour, we observe on all the reports that have cross-tabs. These reports work perfectly fine when rendered through ODBC-ActiveX viewer and the bug is observable only when ran through Java runtime library. We get this bug on view, export and print functionalities as well.
    Additionally we tested the same in
        With CR version 2008 instead of CR 2011.
    (ii)   Different browsers ranging from IE 7 through 9 and FF 7.
    The complete environment and various softwares that we used for this testing are,
    OS      : XP Latest updates as on Oct 2011.
    App Server: GlassFish Version 3 with Java version 1.6 and build 21
    Database server ; SQL Server 2005. SP 3 - Dev Ed.
    JTds JDBC type 4 driver version - 1.2.5  from source forge.
    Eclipse : Helios along with crystal libraries directly downloaded from SDN site.
    I am uploading the log file that is generated when rendering the rpt for view in IE 8
    Regards
    DRG

  • Java Webconsole ELResolvers for JSR not registered with the JSP container

    Trying to rebuild a LDAP server running Directory Server 6.1. Just installed Solaris 10 u9 on a SunFire V240. Loaded most recent recommended patch set dated 2011.02.02. Proceeded to load Directory Server V6.0 from native packages using JAVA ES Installer. After Directory Server installation and initialization the Java Webconsole is running but brings up a blank page login page. Note: Did not test the Webconsole prior to Directory Server installation. The errors in the /var/log/webconsole/console/console_debug_log file state:
    Feb 8, 2011 10:32:32 AM com.sun.faces.lifecycle.ELResolverInitPhaseListener populateFacesELResolverForJsp
    INFO: JSF1027: [console] The ELResolvers for JSF were not registered with the JSP container.
    Feb 8, 2011 10:32:34 AM com.sun.faces.lifecycle.Phase doPhase
    SEVERE: JSF1054: (Phase ID: RENDER_RESPONSE 6, View ID: /jsp/login/BeginLogin.jsp) Exception thrown during phase execution: javax.faces.event.PhaseEvent[source=com.sun.faces.lifecycle.LifecycleImpl@13c3b45]
    The JAVA version is: 1.6.0_22
    The cacao version is 2.2.4.1
    Kernel Patch is Generic_144488-06
    Anyone have an idea what is causing this problem for the JAVA webconsole and how to fix it?

    hi,
    it is tomcat-6.0.20, JSF-RI 2.0.2 (Mojarra)
    a whole bunch of libs and jquery4jsf (though really buggy in this manner, because all components could you rewrite for JSF2-components, etc.)
    Unfortunately it is somehow a config error, because i haven't got it earlier, since i changed PhaseListener and Authentification with JAAS (sample from Ed Burns:
    http://weblogs.java.net/blog/2006/03/07/repost-using-jaas-jsf, but with JDBC-based authentification)
    cheers,
    Istvan

  • How Can i use Html frames with  simple JSP???

    How Can i use Html frames with simple JSP???
    Actually i am creating an application in which i have used Index.html as frame.
    Noew i am trying that if i click on a link of one frame(say menu frame) the \result shoul come to some other frame(say frame named mainwindow).
    Hoe can i do like this???
    Anand Pritam

    Well i am using..
    < Base target="mainwindow">
    But it is no working is there some other way??

  • On certain web sites(with java applets embedded or rich content),sometimes browser hotkeys are beeing used with other functionality (eg.: youtube uses ctrl + tab for sliding between player controls).How can I prevent this?

    On certain web sites(with java applets embedded or rich content),sometimes browser hotkeys are beeing used with other functionality (eg.: youtube uses ctrl + tab for sliding between player controls).How can I prevent this ?

    Thanks for posting this!
    I would only mention that your definition is incomplete for this -
    Contextual selector A type of Style Sheet Selector that
    and that it's most often referred to now as a Descendent selector, not a contextual selector.  It's basically the same as the Compound selector that you have already defined....

  • Get html data with java

    Ok say I want to get some kind of data from a html page? How could it be done? Is this possible with java, or do I have to use some kind of scripting language?

    It looks like what you might be looking for is a method of getting HTTP, not HTML, data. HTML is simply text and can therefore be retrieved any way that a File could be retrieved (using a FileReader/FileWriter). HTTP, on the other hand, is the protocol that we use the most when viewing websites.
    If you're looking to make HTTP request, you may want to look into something like java.net.HttpURLConnection. Try searching these forums for HTTP, not html.

  • Replace VBX Control with Java Bean

    Hi All,
    While compiling 6i forms in 10g I got this error of VBX Control (Obsolete)
    The document says replace it with JavaBeans.
    I don’t know how to replace a VBS Control with Java Bean but this is what I did, I selected the item type as Bean Area.
    But the item do have a trigger
    begin
    control_lib.when_tab_changed(:control.tab_ctl)
    end
    The Package CONTROL_LIB is coded as below.
    Will this code work, technically I think yes, but its always better to ask experts before I move this to test...
    package body control_lib is
    g_tab_id number := 0
    procedure when_tab_changed
    (p_tab_id number) is
    l_err_txt varchar2(255);
    begin
    if :system.block_status != 'QUERY' then
    if not good_quiet_post(l_err_txt) then
    raise form_trigger_failure;
    end if
    end if
    if p_tab_id = 0 then
    rpt_ln_lib.new_tab;
    elsif p_tab_id = 1 then
    stat_lib.new_tab;
    elsif p_tab_id = 2 then
    per_acc_rl_lib.new_tab;
    end if
    g_tab_id := p_tab_id
    exception
    when form_trigger_failure then
    :control.tab_ctl := g_tab_id
    synchronize
    end when_tab_changed
    Thanks to all.
    Habeeb

    A Java bean is another technology than VBX control.
    If some document says: Replace it with java bean it certainly means to use a similar java bean with a similar functionality.
    I do not know a java bean, which runs VBX controls.
    So you surely have to look at what yout VBX does an than to look after a proper java bean (or to write an own one).

  • Help me to control the transactions from jsp to java bean

    Please anyone can guide me how to control the transactions from jsp to java bean. I am using the Websphere studio 5.1 to develop the database application. I would like to know two method to handle the database. First, I would like to know how I can control the transactions from jsp by using java bean which is auto generated for SQL statement to connect to the database. Following code are jsp and java bean.....
    // call java bean from jsp
    for (i=0;i<10;i++)
    addCourse.execute(yr,sem,stdid,course,sec);
    I write this loop in jsp to call java bean..
    here is java bean for AddCourse.java
    package com.abac.preregist.courseoperation;
    import java.sql.*;
    import com.ibm.db.beans.*;
    * This class sets the DBModify property values. It also provides
    * methods that execute your SQL statement and return
    * a DBModify reference.
    * Generated: Sep 7, 2005 3:10:24 PM
    public class AddCourse {
         private DBModify modify;
         * Constructor for a DBModify class.
         public AddCourse() {
              super();
              initializer();
         * Creates a DBModify instance and initializes its properties.
         protected void initializer() {
              modify = new DBModify();
              try {
                   modify.setDataSourceName("jdbc/ABAC/PreRegist/PRERMIS");
                   modify.setCommand(
                        "INSERT INTO informix.javacourseouttemp " +
                        "( yr, sem, studentid, courseid, section ) " +
                        "VALUES ( :yr, :sem, :studentid, :courseid, :section )");
                   DBParameterMetaData parmMetaData = modify.getParameterMetaData();
                   parmMetaData.setParameter(
                        1,
                        "yr",
                        java.sql.DatabaseMetaData.procedureColumnIn,
                        java.sql.Types.SMALLINT,
                        Short.class);
                   parmMetaData.setParameter(
                        2,
                        "sem",
                        java.sql.DatabaseMetaData.procedureColumnIn,
                        java.sql.Types.SMALLINT,
                        Short.class);
                   parmMetaData.setParameter(
                        3,
                        "studentid",
                        java.sql.DatabaseMetaData.procedureColumnIn,
                        java.sql.Types.CHAR,
                        String.class);
                   parmMetaData.setParameter(
                        4,
                        "courseid",
                        java.sql.DatabaseMetaData.procedureColumnIn,
                        java.sql.Types.CHAR,
                        String.class);
                   parmMetaData.setParameter(
                        5,
                        "section",
                        java.sql.DatabaseMetaData.procedureColumnIn,
                        java.sql.Types.SMALLINT,
                        Short.class);
              } catch (SQLException ex) {
                   ex.printStackTrace();
         * Executes the SQL statement.
         public void execute(
              String userid,
              String password,
              Short yr,
              Short sem,
              String studentid,
              String courseid,
              Short section)
              throws SQLException {
              try {
                   modify.setUsername(userid);
                   modify.setPassword(password);
                   modify.setParameter("yr", yr);
                   modify.setParameter("sem", sem);
                   modify.setParameter("studentid", studentid);
                   modify.setParameter("courseid", courseid);
                   modify.setParameter("section", section);
                   modify.execute();
              // Free resources of modify object.
              finally {
                   modify.close();
         public void execute(
                   Short yr,
                   Short sem,
                   String studentid,
                   String courseid,
                   Short section)
                   throws SQLException {
                   try {
                        //modify.setUsername(userid);
                        //modify.setPassword(password);
                        modify.setParameter("yr", yr);
                        modify.setParameter("sem", sem);
                        modify.setParameter("studentid", studentid);
                        modify.setParameter("courseid", courseid);
                        modify.setParameter("section", section);
                        modify.execute();
                   // Free resources of modify object.
                   finally {
                        modify.close();
         * Returns a DBModify reference.
         public DBModify getDBModify() {
              return modify;
    I would like to know that how can I do for autocommit from jsp. For example, the looping is 10 times which mean I will add 10 records to the db. If the last record is failed to add to db, "how can I rollback the perivious records?" or guide me to set the commit function to handle that case. Thanks a lot for take your time to read my question.

    Hello.
    The best method is using a session bean and container managed transactions. Other method is using sessions bean and the user transaction object (JTA-JTS).
    so, JDBC has transaction management too.
    good luck.

Maybe you are looking for

  • Problems purging tb_job_instance

    Hi! I have a Rights Management installation running on JBoss on Windows 2003 with MySQL. My problem is now that the tb_job_instance table has grown to 80 GB and is growing fast. I am only using short running processes, but are using a lot of watched

  • Error in SQL

    CAn any one tell me what is wrong with this statement ? 1 Alter table MU_ACCT_CR_INT_RATE_DTL ADD ( 2 constraint MU_ACCT_CR_INT_RATE_DTL_fk1 foreign key(BATCH_ID,ID) 3 references MU_ACCT_CR_INT_DTL (BATCH_ID,ID) 4 on delete cascade 5 USING index 6 TA

  • Ipad background image size

    I would like to use a background image that I have in my Photos File on my iPad. I selected it and can not resize it to fit the screen. It is currently 216 x 540 @ 72 dpi; 61kb. Does it need to be smaller? I have the same image on my iPhone 5 and it

  • IE version of JSObject?

    Is there a version of the netscape.javascript.JSObject that will work with IE? More to the point is there a platform independant version of netscape.javascript.* ?? Thanks, Chris H

  • Imported image sequences get cut off half-way through

    Hi there! I'm trying to import an image sequence (jpeg) into Premiere Pro CS4 4.2.1 and having trouble getting the clip to play in entirety. My sequence is 24 fps and the footage I'm bringing in is a 5-second piece interpreted at 12 fps. (It was shot