4

So I instantiate a new jquery ui dialog window with specified height where the content causes the scrollbar to appear. I have a print button within the dialog window that's meant to print all the content in the dialog window.

It currently only prints the rows that are visible.

Any ideas as to how i can print the whole lot?

VMAtm
  • 27,943
  • 17
  • 79
  • 125
Pankaj Agarwal
  • 11,191
  • 12
  • 43
  • 59

2 Answers2

7

Try to use css table for print, like that:
<link rel="stylesheet" type="text/css" media="print" href="print.css" />

And set height there.


Update:

Try to use jQuery.printElement jquery-plugin for your object:

$('SelectorToPrint').printElement();
VMAtm
  • 27,943
  • 17
  • 79
  • 125
0

The answer by Jason on Print the contents of a DIV and the plugin he authored worked great for me.

The following is the css I added in Print.css file that I referenced to:

@media print {
.Printable {
    display: block;
    background-color: white;
    position: fixed;
    top: 0;
    left: 0;
    margin: 0;
    padding: 15px;
    font-size: 14px;
    line-height: 18px;
}

.Printable .Content {
    height: auto;
    overflow: auto;
    width: 700px; /* my specific requirement */
    margin: 0;
    padding: 15px;
}}

 $("#Container .Printable").printThis({
        debug: false,
        importCSS: true,
        printContainer: false,
        loadCSS: "../Print.css",``
        pageTitle: "TITLE",
        removeInline: false
    });

<link href="../Print.css" rel="stylesheet" type="text/css" />
<script src="../Scripts/printThis.js"></script>
Community
  • 1
  • 1
Vijayanand Settin
  • 826
  • 11
  • 13