Basic question: Is it possible to import a pdf file in to a blob object and open the pdf file on a Form? And does the large fields transfer slow between 2 tables (does the DB move the file or just change the pointer or something)?
I guess you need to use "OCX" for opening the pdf and "FILE" for the import am I right on those?
Thanks beforehand
K.S.
Answers
Importing can be done blob.IMPORT(FileName).
Opening can be done with hyperlink. first you have to EXPORT content of blob field with EXPORT to some temp file and then use this temp file in HYPERLINK command.
bostjanl
Nice! Cheers for the quick ansver
I made the code for the import and it goes fine, the table even shows asterisk after the import on the row column, but
when I try to export the thingy
(doing it like this cause its list form):
OnPush()...
IF GET(mytable.linenmbr) THEN BEGIN //testing that there is the line and getting the pos.
mytable.thefile.EXPORT(c:\temp\file.pdf);
MESSAGE('Yay it worked!');
HYPERLINK(c:\temp\file.pdf);
END;
Cant get the "Yay it worked!" you know :-k
How can I be sure there is data in the field, doesnt that asterisk mark it, and how do I know the compy imported in file.pdf and not file.pdf.bmp or file.pdf.txt ?
I don't know the structure of your table but this to me "visually" does not seem to be
1.testing that there is a line
2.getting the position
if you are going to use a MESSAGE to test if it's working I would test
mytable & linenmbr to see if they have a value
I would think use a FIND
or if mytable.Get(Linenmber)
http://www.BiloBeauty.com
http://www.autismspeaks.org
The table is populated with rows from xml file, every row has that linenbr.
On the list form, which shows the imported files rows are sorted by that number and when you use a button on the form you get the line where your cursor is in at that moment.
the message is there just to show it works now, you get the line where the pdf is located and on that record I'm opening trying to export the blob to a pdf file and then open it with hyper link.
Now you want to export & print it.
sample/
HASVALUE will check if it exists or not, but you need to CALCFIELDS else HASVALUE will not work. If I remember correctly
http://www.BiloBeauty.com
http://www.autismspeaks.org
as discussed here..
http://www.mibuso.com/forum/viewtopic.php?t=23783
http://www.BiloBeauty.com
http://www.autismspeaks.org
Got the export working like this.
yourtable.calcfields returnet error that there was no line so I user rec for it so I get the current record where the cursor was.
Thanks everyone for help ^^
Rec.CALCFIELDS(Rec.PDFliite);
IF Rec.PDFliite.HASVALUE
THEN BEGIN
Rec.PDFliite.EXPORT('c:\temp\temp.pdf',FALSE);
HYPERLINK('c:\temp\temp.pdf');
END;
http://www.BiloBeauty.com
http://www.autismspeaks.org