7 Replies Latest reply on Oct 4, 2011 6:55 AM by v.bannur

    Printing content of a modal Panel

      Hi all,
      i have a preview page where it popup's a modal panel and displays some information.Now i want print the content the modal contains.When i simply
      use a commandlink with an onclick call to the window.print() then it prints
      only the underlying content it can see and the half of the modal panel.When i move the modal as left as i can in the screen it prints the modal on top of the
      background page but only the part that is viewable.The modal is more than 2
      pages length.what i want 2 do is to print the content of the modal.I tried various solutions..including creation of a print.css...but still had no luck with it.
      From what i discovered while googling it,is that many browsers(Gecko mostly based) have a well known bug for floating elements inside the page.Anyone
      had luck with it.Plz reply asap.!!!

      regards

        • 1. Re: Printing content of a modal Panel
          nbelaevski

          Hello,

          You can try this code snippet:

          <style type="text/css">
          @media print {
           body > * {
           display: none;
           }
          
           body > .rich-modalpanel {
           display: block;
           }
          
           .rich-mpnl_panel, .rich-mpnl_panel > div {
           position: static !important;
           }
          
           .rich-mpnl-mask-div, .rich-mpnl-shadow {
           display: none !important;
           }
          }
          </style>

          Note: it won't work in IE6.

          • 2. Re: Printing content of a modal Panel

            Hi,
            thanks for the reply,i have already done what you suggested..i was lacking the position : static.Still the problem remains now because the content inside the modal is more than one page long...so when i print it seems that it can't
            understand that there are more than 1 page to print..i tried inserting page breaks but still have no luck with it.

            Thanks in advance for any suggestion
            regards
            Nick

            • 3. Re: Printing content of a modal Panel
              nbelaevski

               

              <style type="text/css">
              @media print {
               body > * {
               display: none;
               }
              
               body > .rich-modalpanel {
               display: block;
               }
              
               .rich-mpnl_panel, .rich-mpnl_panel > div {
               position: static !important;
               }
              
               .rich-mpnl-mask-div, .rich-mpnl-shadow {
               display: none !important;
               }
              
               .rich-mp-content {
               overflow: visible !important;
               width: auto !important;
               height: auto !important;
               }
              }
              </style>


              • 4. Re: Printing content of a modal Panel

                Thanks for the reply.Problem solved.What i was missing was the last css
                class definition you gave me.The rest i have already tried.I must inform the
                rest of the community that it also works for IE7.Haven't tried in Opera or Safari.

                best regards
                Nick

                • 5. Re: Printing content of a modal Panel
                  nbelaevski

                   

                  "shadukan" wrote:
                  Thanks for the reply.Problem solved.What i was missing was the last css
                  class definition you gave me.The rest i have already tried.I must inform the
                  rest of the community that it also works for IE7.Haven't tried in Opera or Safari.

                  best regards
                  Nick


                  IE7 supports these selectors in standards-compliant mode only, so if this doesn't work please make sure you've added proper doctype to the page.

                  • 6. Re: Printing content of a modal Panel
                    sebekk23

                    THX for solution ;)

                    • 7. Re: Printing content of a modal Panel
                      v.bannur

                      Hi Nick,

                       

                      I have created sample page with popup for print functionality. As per your above post I have added @Media print css. Still the pop right hand side is chopped off

                      As shown in an attached print preview. I also attached whole code and screen shot. Please let me know what I have missed out.