PDA

View Full Version : Pop-up aspx w/ embedded PDF


DiaH
01-21-2004, 05:19 PM
I have the following script I'm calling server side through an image button:

Dim sb As New StringBuilder

sb.Append("<script> var NewWindow;")
sb.Append("NewWindow = window.open(")
sb.Append("'../../legacyreports/reportprinter.aspx?RPPLID={" & Me.txtPreproposalID.Text)
sb.Append("}&RO=" & Session("DODReadonly") & "&RPT=rptPreproposal&Type=PDF")
sb.Append("','Report','toolbar=yes,menubar=yes,resizable=yes,maximize=yes'); NewWindow.focus();")
sb.Append("</script>")

If Not IsStartupScriptRegistered("OpenNew") Then
RegisterStartupScript("OpenNew", sb.ToString())
End If

The pop-up window is not keeping focus. It gets focus for like a split second then goes behind the parent window. How do I get this to stay on top? I editted the reportprinter.aspx to have an onload and onblur events to set focus to itself but that doesn't work either.

Any suggestions would be appreciated.

Thanks,
Dia

A1ien51
01-21-2004, 06:08 PM
try adding a focus code on the pop up windo and see if that works, or try using a setTimeout on the parent to call the child window.

Eric

glenngv
01-22-2004, 04:55 AM
The popup already has the focus code:

sb.Append(" ','Report','toolbar=yes,menubar=yes,resizable=yes,
maximize=yes'); NewWindow.focus();")

DiaH, maybe you have a window.focus() (after opening the popup) in the parent page?

DiaH
01-22-2004, 02:44 PM
I wish having a "window.focus()" in the parent page was the problem. I have no other focus statements anywhere. I had the "NewWindow.focus();" after the rest of the append statement but it still didn't work.

glenngv
01-23-2004, 02:43 AM
Maybe you have an opener.focus() in the popup page?

DiaH
01-28-2004, 02:22 PM
Unfortunately, no. I have nothing in the child page b/c it actually is an empty page that crystal reports uses to put the pdf report in.

Perhaps its a CR integration issue?

glenngv
01-29-2004, 02:16 AM
How does the crystal report put the pdf report? Does it create a pdf or html document. If possible, can you post the generated content of the popup?