dbTalk Databases Forums  

How do I store a PDF file in a field in a SQL Table?

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss How do I store a PDF file in a field in a SQL Table? in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Karen Grube
 
Posts: n/a

Default How do I store a PDF file in a field in a SQL Table? - 04-24-2005 , 01:57 PM






Hi!

Each week, we receive a two-page PDF file from UPS along with a separate
flat file (a CSV) The PDF file contains the overview of our weekly invoice
and the CSV contains the details of each shipment.

I download the file from UPS and then use DTS to import the data from the
CSV into SQL. At that point, I have a Crystal report that prints what looks
like a regular UPS invoice. The only problem is that I wind up with having
to print two things: the overview PDF invoice and my detailed invoice.

What I'd like to do is store the PDF in a field in SQL and then simply
include that field in the report header (or a subreport) of the crystal
report so that the PDF file displays as the first and second pages of the
report.

My problem is that I have absolutely no clue how to use DTS or even
VB.Net to take this PDF file sitting in a folder on our network and load it
into a SQL field. I don't even know what kind of field it should be. An
Image field? Binary? I really don't even know where to begin. I can't
even seem to find out from anyone if I can even display a stored PDF in a
Crystal report, though I know you can an image file.

Any specific suggestions, code snippets, or referrals to examples that
explictly describe how to upload and store a PDF file in a SQL field would be
greatly appreciated. Again, I'm already using DTS to upload the CSV of the
detail data. Might there be a way within DTS? If there is, I couldn't find
it. Perhaps there might be a little piece of VB Script code that I can
include in a field transformation that will upload the file. And if someone
can even tell me if you can include a pdf in a Crystal report, that would be
great too!

Thanks!! I know I can always count on someone here having a great answer.

Karen Grube
klgrube (AT) yahoo (DOT) com

PS. Just adding a hyperlink to the pdf file stored on the network from
within the report won't work. The PDF file has to display fully and be
printable the moment the report opens. It can't depend on someone having to
click on a link. That is unless someone knows how to automatically open a
hyperlink in Crystal when the report is opened.

Reply With Quote
  #2  
Old   
Darren Green
 
Posts: n/a

Default Re: How do I store a PDF file in a field in a SQL Table? - 04-25-2005 , 02:44 AM






You could use the Read File transform to load the PDF into a SQL image
column -

Read File Transformation
(http://www.sqldts.com/default.aspx?304)

Not sure that this really solves the problem, unless Crystal has PDF display
capability as well.


Darren Green
http://www.sqldts.com
http://www.sqlis.com

"Karen Grube" <KarenGrube (AT) discussions (DOT) microsoft.com> wrote

Quote:
Hi!

Each week, we receive a two-page PDF file from UPS along with a separate
flat file (a CSV) The PDF file contains the overview of our weekly
invoice
and the CSV contains the details of each shipment.

I download the file from UPS and then use DTS to import the data from
the
CSV into SQL. At that point, I have a Crystal report that prints what
looks
like a regular UPS invoice. The only problem is that I wind up with
having
to print two things: the overview PDF invoice and my detailed invoice.

What I'd like to do is store the PDF in a field in SQL and then simply
include that field in the report header (or a subreport) of the crystal
report so that the PDF file displays as the first and second pages of the
report.

My problem is that I have absolutely no clue how to use DTS or even
VB.Net to take this PDF file sitting in a folder on our network and load
it
into a SQL field. I don't even know what kind of field it should be. An
Image field? Binary? I really don't even know where to begin. I can't
even seem to find out from anyone if I can even display a stored PDF in a
Crystal report, though I know you can an image file.

Any specific suggestions, code snippets, or referrals to examples that
explictly describe how to upload and store a PDF file in a SQL field would
be
greatly appreciated. Again, I'm already using DTS to upload the CSV of
the
detail data. Might there be a way within DTS? If there is, I couldn't
find
it. Perhaps there might be a little piece of VB Script code that I can
include in a field transformation that will upload the file. And if
someone
can even tell me if you can include a pdf in a Crystal report, that would
be
great too!

Thanks!! I know I can always count on someone here having a great answer.

Karen Grube
klgrube (AT) yahoo (DOT) com

PS. Just adding a hyperlink to the pdf file stored on the network from
within the report won't work. The PDF file has to display fully and be
printable the moment the report opens. It can't depend on someone having
to
click on a link. That is unless someone knows how to automatically open a
hyperlink in Crystal when the report is opened.



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.