Creating a PDF from a Stored Procedure in SQL Server

  • Can anyone help with this this stored proc?  When I open the PDF file that is created with this proc it says it has to rebuild itself, then opens fine.

    Ryan

     

  • Try some different version of a PDF Reader.You will see is it version problem?

     

  • If the report row size is greater than 80, we can not use it anymore?

    Thx

  • Try to change a table size and value of select substring(...,80)

  • No. Not useful. You can change table size. But one row in table is one line in pdf and it will be truncated. How can we do Word Wrap in pdf report?

    Thanks

  • it is truncated in this line of a procedure   select substring(...,80)  but you have to change font size.

    For wraping you should make a new procedure.It will make wrap and then insert into the table like 2 or more rows.

     

  • Great Tool, but what needs to be altered to copy pdf to network drive instead of 'C:\' ?

  •  This line of a procedure:

    SELECT @pdf = 'C:\' + @filename + '.pdf' 

  • Yes, that line is the local directory path but if I was to point it to \\servername\d\folder on another box it will not place the pdf in that folder.

  • Hi All,

    First off I would like to start by saying this SP looks brillant.  It does exactly what it says on the tin.

    I know this topic was talked about a lot at the begining of this year, but I have just come across it and was wondering was anybody been able to answer the questions many people posed throughtout the discussion?

    - An understanding of the code to create the PDF? ie a more detailed explanation of the variables?

    - The ability to add in graphics in a set location into the PDF file?

    - The ability to use an existing PDF template, with graphics/watermark (my idea here would be Co. letterhead template) and just populate the file then with text?

    I have a few questions of my own also,

    - Has anyone had any problems with this SP in a live environment?  ie crashing, using high resources etc

    - I need to generate either Word doc or PDF docs from my system when certain events transpire ie a creation of a record and changing of a status flag.  The contents of this file will be mostly static bar for name, address, date etc.  From what I can see I can achieve this easily enough by use of variables however is there a better way to achieve what I require?

    Any information anyone can provide would be greatly appreciated.

    Many thanks

    Darren

     

  • Hi,

    Darwin try to map a network drive.

    T: for example

  • This is really good.

  • How can I add image to the generated PDF? 
     
    I know images can be stored as binary objects.
     
    But is that something difficult to achieve?
     
    I am curious to find out if this is achievable.
     
    Any help or direction is appreciated.
     
    Thanks,
    Gulzar Jaggi
     
     
  • 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

     

  • Great! It works fine! Thanks

Viewing 15 posts - 61 through 75 (of 152 total)

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