cancel
Showing results for 
Search instead for 
Did you mean: 

how to hide buttion while print bsp page

former_member459142
Participant
0 Kudos

hi experts

I am printing my bsp page , button also coming in print layout. i want to hide buttons in printout

plz suggest me how to do .

thanks

Accepted Solutions (1)

Accepted Solutions (1)

former_member459142
Participant
0 Kudos

Thanks Durairaj & stefan

<b>@Durairaj</b>

I am using htmlb button control so i cant define CLASS in button bcoz there is no CLASS attribute in htmlb button .

<b>@stefan</b>

I tried with ur code but i am not able to run this jscript , i tried but didnt run ,

PLZ tel me in better way

This is my button control


<htmlb:button id            = "MyprintButton"
              text          = "Print"
              tooltip       = "Click here to print"
              onClientClick = "javascript:window.print()"
              design        = "small"
              width         = "50" />

Thanks

RieSe
Contributor
0 Kudos

Hi,

you have to define the css class like



      <s t y l e type="text/css" media="print">
        .noPrint{display:none}
      </ s t y l e>

You can place this in your head section.
When you have to put a inline tag span around the button tag like.
 
          <s p a n class = "noPrint">
          <htmlb: button ..../>
        </ s p a n >
    
 

As you may try out, the button will be not printed

Best regards, Stefan

former_member459142
Participant
0 Kudos

Thanks Stefan

Problem solved

Answers (2)

Answers (2)

RieSe
Contributor
0 Kudos

Hi,

i assume, that you use bsp extensions. In this case the above mentioned solution must be enhanced.

Have a look at jquery (jquery.com, or google). Use this library and include it in your page, using


      <htmlb:headInclude />
      reference to tthe jquery script file

...
         
             $(document).ready(function(){

$("#button_id").addClass("dontprint");



          });
      

where button_id is the id of your button and dontprint is the class mentioned by

athavanraja
Active Contributor
0 Kudos

use style sheet


<style type="text/css" media="print">
.dontprint{display:none}
</style>

now apply dontprint class to all your buttons which you dont want to get printed.