dcsimg
Problem in opening a new window.
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   sheela_k
Posted On:   Friday, May 30, 2008 04:41 AM

The problem is , the main page is displaying some records and there is one button "Print to PDF", the user is allowed to select any no of records. When the user select some reocrds and click on "Print to PDF". The selected should be printed in a PDF file. The "Print to PDF" will call a javascript. function printQcanReport(){ commaSeparatedVessels(); var width = screen.width - 8; var height = screen.height - 8; var url="<%=request.getContextPath()%>/QcanEnquiryReport?vesselcount="+vesselcount+"&vessel_commaSeparated="+vessel_commaSeparated; windowParameters= "width="+width+ ","+ "height="+heigh   More>>

The problem is , the main page is displaying some records and there is one button "Print to PDF", the user is allowed to select any no of records. When the user select some reocrds and click on "Print to PDF". The selected should be printed in a PDF file.




The "Print to PDF" will call a javascript.




function printQcanReport(){

commaSeparatedVessels();

var width = screen.width - 8;

var height = screen.height - 8;

var url="<%=request.getContextPath()%>/QcanEnquiryReport?vesselcount="+vesselcount+"&vessel_commaSeparated="+vessel_commaSeparated;




windowParameters= "width="+width+ ","+ "height="+height+ ","+"scrollbars=yes"+ ","+"resizable=yes";




var timeStamp= new Date().getTime();

window.open(url, timestamp, windowParameters);


}




We are passing two parameters to the servlet , the size of the parameters depends on the number of records seletced by the user




var url="<%=request.getContextPath()%>/QcanEnquiryReport?vesselcount="+vesselcount+"&vessel_commaSeparated="+vessel_commaSeparated;




When the user selects more than 100 records , the url size is crossing its limit what it suppose to be, so in the servlet when we do getparameter we where not able to get the exact parameter value sent so what we did was set the parameter values to form fields(hidden)




<%= request.getContextPath() %>/QcanEnquiryReport" method="POST" target="_new">

The problem is , the main page is displaying some records and there is one button "Print to PDF", the user is allowed to select any no of records. When the user select some reocrds and click on "Print to PDF". The selected should be printed in a PDF file.




When the user selects more than 100 records , the url size is crossing its limit what it suppose to be, so in the servlet when we do getparameter we where not able to get the exact parameter value sent so what we did was, set the parameter values to form fields(hidden)




<%= request.getContextPath() %>/QcanEnquiryReport" method="POST" target="_new">








function printQcanReport(){

commaSeparatedVessels();

var width = screen.width - 8;

var height = screen.height - 8;

document.forms[2].vesselcount.value=vesselcount;

document.forms[2].vessel_commaSeparated.value=vessel_commaSeparated;

document.forms[2].submit();

}




after doing this we were able to get the whole parameter sent in the servlet, and its working fine.


the actuall problem is the window(PDF file) is getting opened in the internet explorer(browser)
the address bar(header) is also getting diplayed but we don't want this.We want the window to be proper PDF File.



Can anyone please help me ?


Thanks in advance,

Sheela
   <<Less

Re: Problem in opening a new window.

Posted By:   Anonymous  
Posted On:   Monday, June 23, 2008 02:37 AM

Dear Sheela,

The problem is within ur source code only.. Try finding out the bug.

Regards,
Raj..
About | Sitemap | Contact