Article View: sybase.public.powerbuilder.connectivity
Article #1Re: powerbuilder how to display a pdf file after doing a SELECTBLOB from database?
From: avdarie
Date: Fri, 10 Nov 2017 15:28
Date: Fri, 10 Nov 2017 15:28
101 lines
4218 bytes
4218 bytes
El miércoles, 27 de abril de 2016, 20:39:24 (UTC+2), joj...@gmail.com escribió:
> PowerBuilder::: how to display a pdf file after doing a SELECTBLOB from database?
>
Hi, found you a method??. I need to open pdf from db but I don´t found a way without create the a file and open after.
Thanks,
Andrei Darie
> I was able to insert PDF file to DB, what is a simple way to show it on the screen after retrieving it from the DB ?
>
>
> sample code:
>
> //TFS1
>
> blob blank_blob
> blob blob_temp
> blob lb_file
> blob lb_our_blob
> blob lb_tot_b
> blob total_blob
> boolean ib_wordopen
> integer li_counter
> integer li_filenum
> integer li_rtn
> integer result
> long ll_ext
> long ll_ret
> long ll_row
> long ll_rtn
> OLEObject myoleobject
> string ls_key
> string ls_type
>
> ll_row = dw_query.getrow()
> ls_key = dw_query.GetItemString(ll_row, "inqnum" )
> ll_ext = dw_query.GetItemNumber(ll_row, "ext_key")
> ll_ret = ids_attachpricefile.retrieve(ls_key, ll_ext)
>
> IF ll_ret > 0 THEN
> ls_type = ids_attachpricefile.Getitemstring(1, "type")
> ELSE
> MessageBox("File Error", "There is no Notes attached file for this RFQ.")
> RETURN
> END IF
>
> EXECUTE IMMEDIATE "SET TEXTSIZE 32765"
> USING sqlca;
>
> SELECTBLOB attpdf
> INTO :total_blob
> FROM mfg.RFQ_PRICING_FILE
> WHERE record_key = :ls_key
> AND ext_key = :ll_ext
> USING sqlca;
>
> ll_rtn = LenA(total_blob)
>
> IF IsNull(ll_rtn) THEN
> MessageBox("File Error", "There is no RFQ file attached file for this RFQ.")
> RETURN
> END IF
>
> IF sqlca.sqlcode <> 0 THEN
> MessageBox("connect error", "Unable to open the attached file.")
> RETURN
> END IF
>
> integer li_test
>
> CHOOSE CASE ls_type
> CASE doctype_Pdf
> myoleobject.ObjectData = total_blob
> //// oleobject_1.ObjectData =total_blob
> //// oleobject_1.event constructor( )
> // ll_ret = dw_attpricefile.retrieve(ls_key, ll_ext)
> // dw_attpricefile.Modify("total_blob.OleClass = 'AcroExch.Document'")
> // // dw_attpricefile.Modify("tableblob.OleClass = 'AcroExch.Document'")
> //
> // li_test = dw_attpricefile.OLEActivate(1, "attpdf", 0)
> CASE doctype_Doc, doctype_Txt
> ll_ret = dw_attnote.retrieve(ls_key, ll_ext)
> dw_attnote.Modify("total_blob.OleClass = 'Word.Document'")
> dw_attnote.OLEActivate(1, "attword", 0)
> CASE doctype_Xls
> ll_ret = dw_attnote.retrieve(ls_key, ll_ext)
> dw_attnote.Modify("total_blob.OleClass = 'Excel.Document'")
> dw_attnote.OLEActivate(1, "attexcel", 0)
> CASE doctype_Ppt
> ll_ret = dw_attnote.retrieve(ls_key, ll_ext)
> dw_attnote.Modify("total_blob.OleClass = 'PowerPoint.Document'")
> dw_attnote.OLEActivate(1, "attppt", 0)
> END CHOOSE
Technical Details
Message-ID:
<89b36333-d147-43ae-86bf-1ae457edb27d@googlegroups.com>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp-sybase.public.powerbuilder.connectivity.(1470).mbox.7z!not-for-mailReferences:
<06a9596a-6c89-46cd-85e6-54de6b553acf@googlegroups.com>Show Full Headers
Complete Article Headers
Message-ID: <89b36333-d147-43ae-86bf-1ae457edb27d@googlegroups.com> Subject: Re: powerbuilder how to display a pdf file after doing a SELECTBLOB from database? Date: Fri, 10 Nov 2017 15:28:11 +0000 From: avdarie@gmail.com References: <06a9596a-6c89-46cd-85e6-54de6b553acf@googlegroups.com> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp-sybase.public.powerbuilder.connectivity.(1470).mbox.7z!not-for-mail X-Received: by 10.237.37.157 with SMTP id x29mr7211754qtc.0.1510327691672; X-Received: by 10.31.165.204 with SMTP id o195mr718694vke.4.1510327691438; Newsgroups: sybase.public.powerbuilder.connectivity In-Reply-To: <06a9596a-6c89-46cd-85e6-54de6b553acf@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=80.254.154.105; posting-account=4QgMMgoAAACHz3MjNV2RgDXGj9GNsYF4 NNTP-Posting-Host: 80.254.154.105 User-Agent: G2/1.0 MIME-Version: 1.0 Injection-Date: Fri, 10 Nov 2017 15:28:11 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Received-Bytes: 4144 X-Received-Body-CRC: 2311058004