Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 ASP.NET
 export table/view/stored procedure as .pdf file

Author  Topic 

kyser
Starting Member

1 Post

Posted - 2002-11-22 : 12:11:55
Does anyone know how to export data in SQL Server 2000 to a pdf file?

Note: I don't won't the users to ENTER data via a pdf form (I think they're called FDF forms)...I'm going to use ASP.NET to allow the user to select the criteria he wants to search by, he then hits a "process" button and is presented with a .pdf file with the corresponding records.

The reason I want a pdf format is that 9 times out of 10 the user will then print this data, so I need control over the format of the output.

thanks in advance.

robvolk
Most Valuable Yak

15732 Posts

Posted - 2002-11-22 : 12:38:56
You can buy Adobe Acrobat, the full version, and install it. It essentially redirects printer output to a PDF file, so that the originating application (Word, Excel, HTML) generates the precise formatting and layout, and Acrobat converts it to PDF. SQL Server itself is rather limited in its formatting abilities.

Failing that, you can also try:

http://www.activePDF.com/

Go to Top of Page

Sitka
Aged Yak Warrior

571 Posts

Posted - 2002-11-22 : 16:04:30
Since you are writting asp.net forms already why not have printable dynamic webpages. It is a tough google topic to search for because every freaking web page has "printable version" links on it. The correct topic is AT-RULES @media of the CSS2 specification.

You can utilize CSS to flag and control formatting
At it's most basic in the .ASP world it goes like this

<!-- cascading style sheet used to impart dynamic printable functionality -->

<link rel="stylesheet" type="text/css" media="print" href="print.css">



NOTE the media property.

here is what would go in print.css


body {
background-color: #FFFFFF;
}
#maintext {
font-size: 10pt;
}
#navbar {
display: none;
}
#printbutton {
display: none;
}
#closebutton {
display: none;
}


then you just div tag up your asp page give it a few test tweaks and voila, you are done.


<div id="navbar">
Flash buttons and crazy colors don't print nice so DON'T print me
</div>

<div id="maintext">
PRINT ME
</div>


ASP.NET would have this same technique only a hundred times bigger, better, newer, faster (just guessing)

If the doc is not to go on paper but will be saved to a drive in a .pdf format our buddies at http://www.daneprairie.com/ have that covered for a small fee depending on your environment.

(
I can't comment on Acrobat "forms" or dynamic content generation
)


Voted best SQL forum nickname...."Tutorial-D"
Go to Top of Page

MichaelP
Jedi Yak

2489 Posts

Posted - 2002-11-22 : 16:14:37
I'm in no way associated with them, but I use Active Reports .net to export to PDF. I think you can use Crystal Reports to do it (which comes with .Net) but it's slow, hard to work with, and the licensing is realyl terrible. Crystal comes "for free" with .net, but if you are doing ASP stuff, you have to pay a TON to use it on yoru webservers.

They allow you to execute a Stored Proc etc and output it in several formats. I've used it with good success to create a pretty dynamic reporting system. I'm able to "complile" my reports as DLLs so it outputs REALLY fast.

Anyway, I'd use Active Reports.

http://www.datadynamics.com/ARNET/default.htm

Michael

<Yoda>Use the Search page you must. Find the answer you will.</Yoda>
Go to Top of Page
   

- Advertisement -