Pdf import and open

Kisu
Member Posts: 381
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
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.
0
Answers
-
Kisu wrote: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
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.
bostjanl0 -
Hmm couldn't get this one working.
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?
K.S.0 -
Hyperlink works, still something with inport or export thoK.S.0
-
Kisu wrote:IF GET(mytable.linenmbr) THEN BEGIN //testing that there is the line and getting the pos.
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)0 -
Savatage wrote:Kisu wrote:IF GET(mytable.linenmbr) THEN BEGIN //testing that there is the line and getting the pos.
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
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.K.S.0 -
OK step back - I thought you imported something into a blob field.
Now you want to export & print it.
sample/yourTable.CALCFIELDS(yourBLOBfield); IF yourTABLE.yourBLOBfield.HASVALUE THEN BEGIN yourTABLE.yourBLOBfield.EXPORT('c:\temp\file.pdf',false); HYPERLINK('c:\temp\file.pdf'); END;
HASVALUE will check if it exists or not, but you need to CALCFIELDS else HASVALUE will not work. If I remember correctly0 -
Another train of thought would be to use LINKS if it's not important to save the PDF IN NAV.
as discussed here..
http://www.mibuso.com/forum/viewtopic.php?t=237830 -
Sorted
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;Savatage wrote:OK step back - I thought you imported something into a blob field.
Now you want to export & print it.
sample/yourTable.CALCFIELDS(yourBLOBfield); IF yourTABLE.yourBLOBfield.HASVALUE THEN BEGIN yourTABLE.yourBLOBfield.EXPORT('c:\temp\file.pdf',false); HYPERLINK('c:\temp\file.pdf'); END;
HASVALUE will check if it exists or not, but you need to CALCFIELDS else HASVALUE will not work. If I remember correctlyK.S.0 -
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions