Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Professional For advanced ASP.NET 1.x coders. Beginning-level questions will be redirected to other forums. NOT for "classic" ASP 3 or the newer ASP.NET 2.0 and 3.5
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 29th, 2005, 03:24 AM
Authorized User
 
Join Date: Jun 2005
Posts: 97
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to aldwinenriquez
Default Creating PDF Files

How do i generate a pdf file from a dataset?
I want to display all tables in the dataset into a pdf format using c#.




Aldwin Enriquez
President,Software Engineer - Narrasoft Philippines Inc.
"When it's getting harder,push harder,never give it up!"
__________________
\"Dont you ever give up!\"
 
Old June 29th, 2005, 03:04 PM
Friend of Wrox
 
Join Date: Jul 2003
Posts: 121
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Hi,
I did not understand. Do you want to display PDF file on the page or generate one? One of the ways to consider is to generate Crystal Report based on data from your database and to convert this report into PDF format physically or programmatically.
-Dmitriy
 
Old June 30th, 2005, 05:15 AM
Authorized User
 
Join Date: Jun 2005
Posts: 97
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to aldwinenriquez
Default

I want to generate a pdf file programmatically from the dataset and send the pdf file as a WebResponse so the client user can just open or save it to their disk

Aldwin Enriquez
"Dont you ever give up!"
 
Old January 12th, 2006, 06:43 AM
Authorized User
 
Join Date: Mar 2005
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

try this code----


Response.Clear();
        Response.ContentType = "application/pdf";

        Response.AddHeader("content-disposition", "attachment;filename=FileName.pdf");

        Response.Charset = "";



      (HttpCacheability.NoCache);


        System.IO.StringWriter stringWrite = new System.IO.StringWriter();

        System.Web.UI.HtmlTextWriter htmlWrite = new HtmlTextWriter(stringWrite);

        GridView1.RenderControl(htmlWrite);

        Response.Write(stringWrite.ToString());

        Response.End();







Similar Threads
Thread Thread Starter Forum Replies Last Post
Need help w/ creating PDF files in Excel ArtDecade VB.NET 2002/2003 Basics 2 June 14th, 2006 11:06 PM
creating thumbnail for pdf files via php pritz PHP How-To 0 March 10th, 2006 04:09 AM
Creating a PDF in .Net sureshbabu VB.NET 1 June 14th, 2005 06:22 AM
Creating a PDF file niravp Classic ASP Databases 2 September 30th, 2004 07:51 PM
Creating Adobe PDF files from VBA baNTON Access VBA 3 March 11th, 2004 02:41 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.