Skip to Content
0
Dec 11, 2013 at 11:49 AM

Textarea print issue

33 Views

Hi,

In my application I have so many text areas in table as columns.In that i have given row length 5 for the textarea.

When I take a print to that application I am getting only 5 rows with scrollbar even it have more rows those are not printing in a table .

I am using below code to get the data when click on print.

var printLayoutPrintButton = new sap.m.Button(this.createId('idprintLayoutPrintButton'), {

width : '90%',

icon : "images/print.jpg",

press: function(){

var newWin=window.open('');

newWin.document.open();;

newWin.document.write("<html><head><style>@page{size: A4 landscape;margin: 42pt 12pt;} </style></head><body>" +

$("#idAppraisalForm1--mainLayout > div:nth-child(1)").html()+ $("#idAppraisalForm1--mainLayout > div:nth-child(2)").html() + $("#idAppraisalForm1--mainLayout > div:nth-child(3)").html()+'<hr style="page-break-after:always"/>'+ $("#idAppraisalForm1--mainLayout > div:nth-child(4)").html() + $("#idAppraisalForm1--mainLayout > div:nth-child(5)").html() + $("#idAppraisalForm1--mainLayout > div:nth-child(6)").html()+ $("#idAppraisalForm1--mainLayout > div:nth-child(7)").html() +"</body>");

newWin.print();

newWin.document.close();

setTimeout(function(){newWin.close();},10);

}

});

After print that application my output is like below.

Please find the attached html file. In this I can solve this issue.But coming to SAPUI5 I am in confusion where and how I can apply code to get the total data in text area when print that one?

In this code using $("#idAppraisalForm1--mainLayout > div:nth-child(6)").html() I am getting all html code and placing this value in that page.Before placing that I want to parse that code to find the textarea and apply below code to solve this issue just like in attached html file.

childWindow.document.write(document.getElementById('targetTextArea').value.replace(/\n/gi,'<br>'));

Is it possible to do like that?

Please help me to solve this one.

Thanks&Regards

Sridevi

Attachments

print.html.zip (545 B)
printissue.jpg (15.8 kB)