🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: sybase.public.powerbuilder.connectivity
1 messages
1 total messages Started by avdarie Fri, 10 Nov 2017 15:28
Re: powerbuilder how to display a pdf file after doing a SELECTBLOB from database?
#1
Author: avdarie
Date: Fri, 10 Nov 2017 15:28
101 lines
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
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads