Wrox Programmer Forums
|
ASP.NET 1.1 As of 10/6/2005, this forum is locked as part of the reorganization described here: http://p2p.wrox.com/topic.asp?TOPIC_ID=35394. No posts have been deleted. Open ongoing discussions from the last week have been moved to either ASP.NET 1.0 and 1.1 Beginners http://p2p.wrox.com/asp-net-1-0-1-1-basics-60/ or ASP.NET 1.0 and 1.1 Professional. http://p2p.wrox.com/forum.asp?FORUM_ID=50. See my sticky post inside for more.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.1 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 October 5th, 2004, 03:02 PM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,348
Thanks: 0
Thanked 5 Times in 5 Posts
Default

If you are doing a Crystal Report, you can easily export it to a .pdf format. I have done this many times and can supply the code if you are interested.

 
Old October 6th, 2004, 08:19 AM
Friend of Wrox
 
Join Date: Oct 2003
Posts: 218
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I'd love to check it out!

- - - - - - - - - - - - - - - - - - - - - - -
In God we trust, everything else we test.
 
Old October 6th, 2004, 08:38 AM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,348
Thanks: 0
Thanked 5 Times in 5 Posts
Default

I created a class to export the Crystal Report to a .pdf format:

Imports CrystalDecisions.Shared

Public Class ClassPrintCrystalReports
    'This sub is used to export the Crystal Report to Adobe Acrobat.

    Public Sub PrintReport(ByVal objReport As CrystalDecisions.CrystalReports.Engine.ReportDocum ent, ByVal SessionID As String, ByVal WebPage As System.Web.UI.Page)
        Dim ExpOpt As New ExportOptions()
        Dim DiskFileDestOpt As New DiskFileDestinationOptions()
        Dim ExpFile As String

        'I am using this path since I know it will exist on everyone's computer.
        ExpFile = "C:\WinNT\Temp\" + SessionID + ".pdf"

        DiskFileDestOpt.DiskFileName = ExpFile

        ExpOpt = objReport.ExportOptions
        With ExpOpt
            .DestinationOptions = DiskFileDestOpt
            .ExportDestinationType = ExportDestinationType.DiskFile
            .ExportFormatType = ExportFormatType.PortableDocFormat
        End With


        objReport.Export()

        WebPage.Response.ClearContent()
        WebPage.Response.ClearHeaders()
        WebPage.Response.ContentType = "application/pdf"
        WebPage.Response.WriteFile(ExpFile)
        WebPage.Response.Flush()
        WebPage.Response.Close()

        System.IO.File.Delete(ExpFile)

    End Sub

I hope this helps. Let me know if you have any questions.

 
Old October 6th, 2004, 08:45 AM
Friend of Wrox
 
Join Date: Oct 2003
Posts: 218
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks-

I will give this a shot later today if I can. FYI, a coworker of mine mentioned HTMLDOC http://www.easysw.com/htmldoc/ as a way of dynamically creating PDFs. I think it's also worth looking into.

- - - - - - - - - - - - - - - - - - - - - - -
In God we trust, everything else we test.
 
Old October 6th, 2004, 08:48 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 540
Thanks: 0
Thanked 4 Times in 4 Posts
Default

There is also a good book, from Wrox (cheap plug...I have no affiliation with them...) by David McAmis called Professional Crystal Reports for Visual Studio .Net that I believe you can get on Amazon for about $16. It has many examples and details about using Crystal Reports in both Windows and Web applications.

J





Similar Threads
Thread Thread Starter Forum Replies Last Post
How to output the entire content to a string sunnyman XML 6 November 29th, 2007 10:48 PM
Display pdf in content walgr2k ASP.NET 2.0 Basics 0 May 1st, 2006 05:19 PM
Output to PDF Bruce VB How-To 0 March 10th, 2005 09:01 AM
PDF output problem using XSL pulavarthi XSLT 1 November 6th, 2003 05:41 AM





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