T-SQL stored procedures create PDF Format files (reports)
Source: Internet
Author: User
Create | Stored procedures
Paste, only reference the Fso,pdf format can write their own, just like the logo language:
Creating a PDF from a Stored Procedure
Http://www.sqlservercentral.com/columnists/mivica/creatingapdffromastoredprocedure.asp
Do not want to register on the posted out:
Creating a PDF from a Stored Procedure
Regular columnist:m Ivica
posted:08/26/2003
More articles from this columnist
14089 Reads
Add Article to Your Virtual Briefcase (What are this?)
Article Rating Total number of votes [183]
This Content sponsored By:is SQL the Center of your universe?
Sqlcentric is a comprehensive web-based network database monitoring and alert system. -Brought to and by Pearl Knowledge Solutions, Inc.
Http://www.pearlknows.com
This is article explains how to create a a stored procedure that would in turn create a simple column based the in PDF with Out using any external tools or libraries (and their associated licensing costs!).
Sql2pdf makes a PDF in the "inserted in the" Table psopdf (nvarchar (80)). A table named Psopdf should be created.
CREATE TABLE psopdf (Code NVARCHAR (80))
After this create the stored procedure sql2pdf.
Sql2pdf. Txt
and table psopdf has to is filled with your data as shown in examples below.
At the end of the stored procedure is called using the ' file name only ' (not extension).
EXEC sql2pdf ' FileName '
The result is in your C:\ directory.
EXAMPLE 1:
Insert Psopdf (code) Select Space (m) + ' company LTD ' Insert psopdf (code) Select Spaces + ' Company address ' insert Psopdf ( Code) + ' street NAME & No ' inserts psopdf (code) SELECT ' Insert psopdf (code) Select Space + ' BILL of SALE ' Insert psopdf (code) SELECT ' Insert psopdf (code) SELECT ' Product ' + space (Ten) + ' Quantity ' + space (Ten) + ' price ' + Space (a) + ' total ' Insert psopdf (code) Select REPLACE (Spaces (), ', ' _ ') Insert Psopdf (code) SELECT ' Product1 ' + space (9 + ' 10.00 ' + space (Ten) + ' 52.30 ' + space (Ten) + ' 5230.0 ' INSERT psopdf (code) SELECT ' Product2 ' + space (9) + ' 2.00 ' + spaces ( + ' 10.00 ' + space (Ten) + ' 20.0 ' Insert psopdf (code) Select REPLACE (Space (in), ', ' _ ') Insert Psopdf (code) Select Space (50) + ' 5250.0 '
After INSERT call the stored procedure with file name Demo2.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service