Creating a PDF from a Stored Procedure in SQL Server

  • jairamkumar01

    SSC Rookie

    Points: 26

    I used this procedure it is good, but according to my requirement for text formatting in PDF. kindly suggest how can do.

  • Jeff Moden

    SSC Guru

    Points: 995703

    jairamkumar01 - Wednesday, November 15, 2017 12:44 AM

    I used this procedure it is good, but according to my requirement for text formatting in PDF. kindly suggest how can do.

    You need to tell us what your "requirement" is before anyone can actually suggest how to meet your "requirement".

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column.
    "If you think its expensive to hire a professional to do the job, wait until you hire an amateur."--Red Adair
    "Change is inevitable... change for the better is not."

    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • jairamkumar01

    SSC Rookie

    Points: 26

    There are following requirement:
    1- Text Formatting in some place like bold , underline
    2- Some dynamic data display like address or name there length are  flexible. How it's set in fixed width
    3- How it possible to support HTML tag on PDF

  • Jeff Moden

    SSC Guru

    Points: 995703

    jairamkumar01 - Friday, November 17, 2017 11:07 PM

    There are following requirement:
    1- Text Formatting in some place like bold , underline
    2- Some dynamic data display like address or name there length are  flexible. How it's set in fixed width
    3- How it possible to support HTML tag on PDF

    I guess the original author has gone missing.  They haven't responded to any of the questions the others have had in quite some time.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column.
    "If you think its expensive to hire a professional to do the job, wait until you hire an amateur."--Red Adair
    "Change is inevitable... change for the better is not."

    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • Eric M Russell

    SSC Guru

    Points: 125057

    This would actually be a good interview question. If the candidate laughs or responds only with raised eyebrows, then they answered correctly.

    "Do not seek to follow in the footsteps of the wise. Instead, seek what they sought." - Matsuo Basho

  • Jeff Moden

    SSC Guru

    Points: 995703

    Eric M Russell - Monday, November 20, 2017 12:30 PM

    This would actually be a good interview question. If the candidate laughs or responds only with raised eyebrows, then they answered correctly.

    BWAAA-HAAA!!!  That would make it an "advanced" question... heh... right after the GETDATE() question. 😉

    To your point (or at least I think it's a part of your point), there's an awful lot of code out there that does things like this correctly and with full functionality such as page breaks, headers, foots, page numbers, graphic hot spots, the whole nine yards.  Some of them are free and some only cost something like 20 bucks.  If you want to go enterprise class, you can do that too and not have to worry about doing things like installing WORD (or parts of it) on your SQL Server.

    I'm all for doing things in T-SQL but creating PDFs using T-SQL isn't one of the things that I think should be done using only T-SQL.  There are just too many good and properly tested methods that T-SQL could call or send a "Merge File" to.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column.
    "If you think its expensive to hire a professional to do the job, wait until you hire an amateur."--Red Adair
    "Change is inevitable... change for the better is not."

    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • Eric M Russell

    SSC Guru

    Points: 125057

    Dating back to 2002, SSRS has had export to PDF functionality. I'd use that.

    "Do not seek to follow in the footsteps of the wise. Instead, seek what they sought." - Matsuo Basho

  • rabreus

    Grasshopper

    Points: 15

    Hi there! how can i set page orientation? thanks!

  • Gregory Brown

    SSC Veteran

    Points: 238

    Natalia-252090 - Tuesday, February 28, 2006 11:35 AM

    Works awesome. Specially after adding bug fixes suggested by blinard and ivica to prevent data from being truncated: use smaller fonts,  seting in table #pdf code nvarchar(400)  setting @trenutnired nvarchar(400) However I would like to know if it's possible:

     - add in graphics into file / or use templates with graphics/watermark - add fonts, bold, colors, etc - insert created file on the fly into database as a Blob without storing locally - wrapping text inside  if anyone have solution - please post the code! Thanks!Natalia 

    Did anyone ever figure out a way to change the font color or font face?  Thanks

  • thandapani.p

    Grasshopper

    Points: 17

    mivica - Sunday, July 27, 2003 12:00 AM

    Comments posted to this topic are about the content posted at http://www.sqlservercentral.com/columnists/mivica/creatingapdffromastoredprocedure.asp

    Can you explain how to use html tags inside of this procedure which you post.?
    because i have used this procedure for creating PDF inside the PDF i have to highlighted some texts and has to include images at all.

  • Jeff Moden

    SSC Guru

    Points: 995703

    For those longing for additional information on this article and code, the author hasn't even logged into SQLServerCentral.com in the last 11 years and has never made a reply to his own article discussion (this thread) nor any post.  I suspect the author has left the building.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column.
    "If you think its expensive to hire a professional to do the job, wait until you hire an amateur."--Red Adair
    "Change is inevitable... change for the better is not."

    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • mmaningol70

    SSC Rookie

    Points: 27

    Very use full procedure, Thanks author.

  • mynksoni

    Newbie

    Points: 1

    Does the same can be done for generating PDF file using Oracle PL/SQL ?

     

  • Sue_H

    SSC Guru

    Points: 90555

    mynksoni wrote:

    Does the same can be done for generating PDF file using Oracle PL/SQL ?  

    No, not using the same stored procedure. If you do a search, you will find links to some ways to do it in Oracle.

    Sue

Viewing 14 posts - 136 through 149 (of 149 total)

You must be logged in to reply to this topic. Login to reply