Please be aware that the content in SAP SQL Anywhere Forum will be migrated to the SAP Community in June and this forum will be retired.

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

asked 02 Nov '20, 02:47

Tomaz's gravatar image

Tomaz
166101220
accept rate: 0%

1

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.

(02 Nov '20, 03:52) Vlad
Replies hidden

...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 :)

(03 Nov '20, 16:02) Breck Carter

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 :)

(03 Nov '20, 16:15) Breck Carter

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.

(04 Nov '20, 03:27) Volker Barth
1

Are you saying something different from what I said?

External Environment: "... can fall over in a heap without taking dbsrv17.exe down with it."

External Call Interface: "... an absolute nightmare to build, debug and test ..."

Or are you saying what I wrote was completely confusing?

Well, yeah, it was that :)

(04 Nov '20, 08:13) Breck Carter

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 :)

(04 Nov '20, 08:22) Volker Barth

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.

(07 Nov '20, 17:16) Ibrahim
Replies hidden

could you send us a photo how the bill should look like, then maybe I can give a hand

(07 Nov '20, 17:18) Ibrahim
showing 3 of 8 show all flat view
Be the first one to answer this question!
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×125

question asked: 02 Nov '20, 02:47

question was seen: 1,220 times

last updated: 07 Nov '20, 17:18