Hello everyone! I'am looking for solution to generate PDF file in stored procedure in Sqlany 17 database and save it to local filesystem or send it by email. I would like to generate PDF invoice from data in database and send it to the customer end of day. Thanks for any help! Regards Tomaz |
Quite simple: you find a library that generates PDF, and use it as an external interface: https://help.sap.com/viewer/98ad9ec940e2465695685d98e308dff5/17.0/en-US/81612b906ce2101484c8b12be85d71f7.html
But I think it is better to delegate this job to an application server, rather than make the database single point of failure.
...or use an "External Environment" instead of the "External Call (DLL) Interface"...
https://help.sap.com/viewer/98ad9ec940e2465695685d98e308dff5/17.0/en-US/816081ea6ce2101490e68dcd4382ea63.html
That way (at least theoretically) your "PDF feature" can fall over in a heap without taking dbsrv17.exe down with it.
Personally speaking, absolutely none of this stuff is "quite simple"... the external call interface code inside Foxhound was an absolute nightmare to build, debug and test, and it was nowhere near as ambitious as a "PDF feature"... however, I am well aware of my C deficiencies :)
There is at least one other person on this forum who has done something nearby if not similar... attention [redacted], you know who you are, Jim :)
Well, as you already have stated, external environments are not restricted to libraries in C/C++ but allow to use code from other common languages/environments like Java, .NET, Perl, PHP or JavaScript, too.
Are you saying something different from what I said?
Or are you saying what I wrote was completely confusing?
Well, yeah, it was that :)
I just wanted to point out that External Environments do not need C knowledge, in case that was not clear from the comment itself. All good :)
If it is related to generating a simple bill, then you can write your procedure in a way so that you can format the bill directly in the procedure itself (in terms of white spaces and empty lines), (having that all texts on the bill have the same font size and type).
Later you can unload the output of this procedure in an excel file, and then you can find another external mechanism to save this excel file as pdf.
could you send us a photo how the bill should look like, then maybe I can give a hand