Web Connection
Re: Help on PDF oand data
07/01/2009
02:18:04 AM
2OT04XL8E Show this entire thread in new window
From:
Richard Norris
To:
Paul Summerfield
Attachments:
None
Hi Paul,

Nothing wrong with the ID mechnism here, although you have to be careful with security when passing PK's across the URL. The business object represents the table in which case all the data is available. The cursor used in this case will not contain one record so the report will generate for all rows. You either need to sub select from this cursor or filter the records before passing it to the report.

Regards

Richard

Hi Richard,

Yes just using the standard wwBusiness.

I thought if I used xxxMyBO.LOAD(lnPk) it would load and sit on that record it finds

lnPk = VAL(REQUEST.QueryString("ID")) && get the ID PK

or is that incorrect ?

Paul


Hi Paul,

We would have to see the business object code to determine this one. Is this a custom object or is it based on wwBusiness? What we cannot tell from your posting is the query used or how the data is being obtained.

Regards

richard

I am having a problem with the following code, it should print a single record but it prints a list of evey record and not just one

If I generate the Cursor myself and not use my BO it works fine

Should it now just load 1 records or am i missing sometrhing ?

Paul


************************************************************************ FUNCTION reportlog() ************************************************************************ LOCAL lntemp,loReport AS wwmain lnPk = VAL(REQUEST.QueryString("ID")) && get the ID PK pcErrorMsg = "" loReport = CREATEOBJECT("wwmain") * IF !loReport.LOAD(lnPk) * ENDIF loReport.LOAD(lnPk) && load just 1 record for now *oPDF=CREATE([WWC_WWPDF]) oPDF = CREATEOBJECT("wwGhostScript") oPDF.cPrinterDriver = "Apple Color LW 12/660 PS" *** Easier Reference poDev = loReport.oData lcFile = SYS(2015) + ".pdf" lcfilter=(SERVER.oConfig.oonemain.cHTMLPagePath+"\temp\"+lcFile) oPDF.PrintReport("caselog.frx",(lcfilter)) Response.DownloadFile(SERVER.oConfig.oonemain.cHTMLPagePath+"temp\"+lcFile,; "application/pdf",) DeleteFiles(Server.oConfig.oonemain.cHTMLPagePath + "temp/*.pdf",300) ENDFUNC