NetTalk Central

NetTalk Web Server => Web Server - Ask For Help => Topic started by: sukhendu on November 05, 2012, 12:34:47 PM

Title: How to set page name on PDF Report when target frame is '_blank'
Post by: sukhendu on November 05, 2012, 12:34:47 PM
On a report filter memory form I have a button that runs a report (CPCS) and creates a pdf report and displays it on a new page.  The page name shows the url, I would prefer an appropriate name as the page name. How (or which embed point) do I set the name of this page?   Target frame is set to '_blank' on the OnClick tab of the report button.

Thanks,
Sukhendu
Title: Re: How to set page name on PDF Report when target frame is '_blank'
Post by: Stu on November 05, 2012, 04:08:29 PM
Hi Sukhendu,

Haven't had any CPCS experience, but with PDFTools + NetWebReport, you change the filename (usually loc:PDFName) of the report after it's automatically set.

I'd find out what CPCS uses to set the filename, then right-click source and search for it. Then after it's automatically set, set it to whatever you like.

BUT .. If you asking about changing to a url (not a filename), then I'd have to ask WHY? If it's just for beautification purposes then it's missing the functionality of what is happening.

Some web browsers might not display it in a tab, but download it (depending on the settings). Some might ask to open it in adobe (or your default viewer) itself. It all depends on the browser your user is using .. and for most folk, that's a big variable.

Title: Re: How to set page name on PDF Report when target frame is '_blank'
Post by: Bruce on November 05, 2012, 09:00:24 PM
Hi Sukendu,

Because this is a PDF file (ie not HTML) there is no place to set the "page name". So it takes the URL as the page name.
the only way to change that would be to change the URL (which is what Stu though you were doing.)

You could experiment with setting the content disposition header - I haven't tried that though on reports so I'm not sure what exactly will happen. Look at the File Download example, I think one of the procedures there plays with the content disposition.

cheers
Bruce

Title: Re: How to set page name on PDF Report when target frame is '_blank'
Post by: sukhendu on November 06, 2012, 08:13:08 AM
Thank you Stu and Bruce.

The tab on the browser shows the correct report name, but the report name us preceded with the url (e.g. localhost:1200/MyReportName).  I'm trying to strip the url portion of the page name. 

Content disposition -- on the file download example it shows on the NetWebPage procedure.  I have NetWeb memory form for report filter and then the CPCS report.  Which procedure and at what embed point should I try p_web.HeaderDetails.ContentDisposition = 'myReportName'?

Sukhendu

Title: Re: How to set page name on PDF Report when target frame is '_blank'
Post by: Stu on November 06, 2012, 04:31:47 PM
Hi Sukhendu,

I'd say in the WebHandler proc, probably under the ProcessLink embed.
Title: Re: How to set page name on PDF Report when target frame is '_blank'
Post by: Bruce on November 06, 2012, 07:08:10 PM
hmm - yes possibly in WebHandler, but I think you may be able to get away ith placing it in the Report procedure itself. somewhere near the setup code. (Search for p_web in the generated source.)

cheers
Bruce