Wrox Programmer Forums
|
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics 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 July 3rd, 2007, 01:05 AM
Authorized User
 
Join Date: Jul 2007
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default Same data showing in PDF

Same data showing in PDF when i am exporing from crystal report viewer. I am using .net 2003 and inbuilt crystal report and i am using asp.net with vb.net for my web page creation.

it works fine without exporting. The problem arises only with the exporting.
my code is

this following code generates crystal report

Dim crReportDocument As New ReportDocument

        Dim crtableLogoninfos As New TableLogOnInfos
        Dim crtableLogoninfo As New TableLogOnInfo
        Dim crConnectionInfo As New ConnectionInfo
        Dim CrTables As Tables
        Dim CrTable As Table
        Dim TableCounter
        Dim Fname As String

        crReportDocument.Load(Server.MapPath("No Wise Report.rpt"))
        CrTables = crReportDocument.Database.Tables

        For Each CrTable In CrTables
            With crConnectionInfo
                .ServerName = ConfigurationSettings.AppSettings("servername")
                .DatabaseName = "service"
                .UserID = "sa"
                .Password = ""
            End With
        Next

        CrystalReportViewer1.ReportSource = crReportDocument
        If Request("call_no") <> "" Then
            CrystalReportViewer1.SelectionFormula = "{call_booking.call_no} = " & CInt(Request("call_no")) & ""
        Else
            CrystalReportViewer1.SelectionFormula = "{call_report.report_no} = '" & Request("report_no") & "'"
        End If

        CrystalReportViewer1.RefreshReport()



this following code is to export pdf


Fname = "c:\" & Session.SessionID.ToString & ".pdf"

        crDiskFileDestinationOptions = New DiskFileDestinationOptions
        crDiskFileDestinationOptions.DiskFileName = Fname
        crExportOptions = crReportDocument.ExportOptions

        With crExportOptions
            .DestinationOptions = crDiskFileDestinationOptions
            .ExportDestinationType = ExportDestinationType.DiskFile
            .ExportFormatType = ExportFormatType.PortableDocFormat
        End With

        crReportDocument.Export()

        crReportDocument.Export()
        crReportDocument.Close()

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

        System.IO.File.Delete(Fname)


please i want the solution soon. thank u


 
Old July 3rd, 2007, 01:10 AM
Friend of Wrox
 
Join Date: Aug 2004
Posts: 550
Thanks: 0
Thanked 1 Time in 1 Post
Default

Why do you guys cross post, you would get the same answer in any of the sections...

http://p2p.wrox.com/topic.asp?TOPIC_ID=62483

Regards
Mike

Don't expect too much, too soon.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Crystal not showing data tgraham Crystal Reports 4 September 9th, 2009 02:46 AM
Incomplete Data Showing rameshjha ADO.NET 0 June 20th, 2006 06:46 AM
expporting data from a Excel file and showing it reguengos Excel VBA 8 March 4th, 2005 05:51 PM
Combox not showing data when criteria is changed Mitch Access 2 September 10th, 2004 11:54 AM
DataList Is not showing Data using ASP.NET and C# kmazumdar ADO.NET 5 August 20th, 2004 10:18 AM





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