1. Is blob field only for 1 file?
2. Is it possible to get blob data (pdf file, image file, text file, etc) and print it to default printer without open the file ?
If No 2 = Yes then please let me know the pseudocode.
You can store anything in a BLOB field, including multiple files - it's basically a bucket full of bits.
You will however need to create logarithms to store and retrieve your data from the BLOB field. To NAV, it's just a series of bits and bytes.
It's basically the same answer to your second question: you cannot just send a random quantity of bits and bytes to your printer and expect it to make sense of it. That leaves you with two options: opening the file using a dedicated program (e.g. Word) or building your own Word-decoder...
Based on your recommendation, it's very complicated if we put many files in one blob field.
In Navision standard, I can see that one field is only for 1 file otherwise system will prompt confirmation to ask user to replace existing file in blob field in case user want to import file again.
and also Navision standard will show the file and never find function to print the file directly to printer (like post + print function)
for example, if blob file is word doc, there is function to open blob file and Microsoft word will open to show blob file.
for many files, I will follow navision standard (1 blob = 1 field). it's easier to manage.
but for printing, Is there anybody has done customization sending blob file (eg. pdf, word, txt, etc) to printer for printing without opening the file?
YourRecord.CALCFIELDS(YourBLOB);
TempBLOB.BLOB := YourRecord.YourBLOB;
TempServerFileName := C419.ServerTempFileName('.pdf');
C419.BLOBExportToServerFile(TempBLOB, TempServerFileName);
//if you need it on client PC
TempClientFileName := C419.DownloadTempFile(TempServerFileName);
YourRecord.CALCFIELDS(YourBLOB);
TempBLOB.BLOB := YourRecord.YourBLOB;
TempServerFileName := C419.ServerTempFileName('.pdf');
C419.BLOBExportToServerFile(TempBLOB, TempServerFileName);
//if you need it on client PC
TempClientFileName := C419.DownloadTempFile(TempServerFileName);
edit:
I've seen that it saves in the temporaru folder again, and with a name like "__TEMP__05b8e5886d1f4332b3c150d892dbd699.tmp.pdf". My idea is to save it in a known folder to get it later for printing
Comments
You will however need to create logarithms to store and retrieve your data from the BLOB field. To NAV, it's just a series of bits and bytes.
It's basically the same answer to your second question: you cannot just send a random quantity of bits and bytes to your printer and expect it to make sense of it. That leaves you with two options: opening the file using a dedicated program (e.g. Word) or building your own Word-decoder...
I would strongly advise against the latter
Senior NAV Developer
Elbek & Vejrup
Based on your recommendation, it's very complicated if we put many files in one blob field.
In Navision standard, I can see that one field is only for 1 file otherwise system will prompt confirmation to ask user to replace existing file in blob field in case user want to import file again.
and also Navision standard will show the file and never find function to print the file directly to printer (like post + print function)
for example, if blob file is word doc, there is function to open blob file and Microsoft word will open to show blob file.
for many files, I will follow navision standard (1 blob = 1 field). it's easier to manage.
but for printing, Is there anybody has done customization sending blob file (eg. pdf, word, txt, etc) to printer for printing without opening the file?
Senior NAV Developer
Elbek & Vejrup
I will try to use the third party program (classexec)
Regards,
Angelo
When i want to print this image on report ;
1. Call CALCFIELDS(Rec."Blob Field Name"); OnPreReport
2. Put a picture box to report and set Source property Rec."Blob Field Name"
You can see the image on report
my blob field is PDF file. I dont think can use your method.
I have the same problem. How did you solve this issue?
pd: sorry for writing in an old post
Thanks, but how can I know the path of that temporary file? Something like
Where the 2492 changes everytime I restart NAV.
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03
THank you @Slawek_Guzek . I'm doing this:
BUt I get the "invalid path" error. What am I doing wrong?
to that:
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03
edit:
I've seen that it saves in the temporaru folder again, and with a name like "__TEMP__05b8e5886d1f4332b3c150d892dbd699.tmp.pdf". My idea is to save it in a known folder to get it later for printing
to that;
To a ClientFileName you choose.
Thank you all for your tips!