Wrox Programmer Forums
|
BOOK: Professional Crystal Reports for VS.NET
This is the forum to discuss the Wrox book Professional Crystal Reports for Visual Studio .NET by David McAmis; ISBN: 9780764544033
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional Crystal Reports for VS.NET 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 December 3rd, 2004, 03:00 AM
Registered User
 
Join Date: Dec 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to kalyanb Send a message via Yahoo to kalyanb
Default Crystal Report export problem

Hi All,

   I am developing a web aplication where I can generate the reports and export them into PDF and save it on my hard drive. All my reports are saved on the hard disk and i just call the report that i need to be generated programatically. I have no problem in generating the reports some reports. But the reports that need a stored procedure to be executed do not work. Can anybody please tell me why this is happening.

I am pasting my code down here.

Dim oraConn As OleDbConnection
        oraConn = New OleDbConnection("Provider=MSDAORA.1;Data Source=ikaclaim;User Id=cs_admin;Password=cs_admin;")

        Dim oraCmd As OleDbCommand
        oraCmd = New OleDbCommand("PROC_ROLL_MEM_MONTH", oraConn)

        oraCmd.CommandType = CommandType.StoredProcedure

        oraCmd.Parameters.Add(New OleDbParameter("@date1", OleDbType.Date, 9)).Value = "01-Jan-2001"
        oraCmd.Parameters.Add(New OleDbParameter("@date2", OleDbType.Date, 9)).Value = "31-Dec-2001"
        oraConn.Open()

        oraCmd.ExecuteNonQuery()
        oraConn.Close()


        lblEx.Text = "Data Set Success"

Dim rdS1 As ReportDocument
        Dim crEO1 As ExportOptions
        Dim dfdo1 As DiskFileDestinationOptions
        Dim fname1 As String

        rdS1 = New ReportDocument
        Dim repPath1 As String
        repPath1 = "D:\Projects\IKA-VBP\reports\" & Session("rptName") & ".rpt"
        rdS1.Load(repPath1)
        fname1 = "d:\Reports-IKA\Exports\" & Session.SessionID.ToString & ".pdf"
        dfdo1 = New DiskFileDestinationOptions
        dfdo1.DiskFileName = fname1
        crEO1 = rdS1.ExportOptions
        With crEO1
            .DestinationOptions = dfdo1
            .ExportDestinationType() = ExportDestinationType.DiskFile
            .ExportFormatType = ExportFormatType.PortableDocFormat
        End With
        ' I am getting an error when I try to execute this line
        'of code.
        rdS1.Export()

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


the error looks something like this.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: CrystalDecisions.CrystalReports.Engine.DataSourceE xception: Query Engine Error: 'D:\Projects\IKA-VBP\reports\RollingMember-View.rpt'

Source Error:


Line 121: .ExportFormatType = ExportFormatType.PortableDocFormat
Line 122: End With
Line 123: rdS1.Export()
Line 124: Response.ClearContent()
Line 125: Response.ClearHeaders()


Source File: D:\Projects\IKA-VBP\trial_param.aspx.vb Line: 123

Stack Trace:


[DataSourceException: Query Engine Error: 'D:\Projects\IKA-VBP\reports\RollingMember-View.rpt']
   .F(String  , EngineExceptionErrorID 
)
   .A(Int16 , Int32 )
   .@(Int16 )
   CrystalDecisions.CrystalReports.Engine.FormatEngin e.Export(ExportRequestContext reqContext)
   CrystalDecisions.CrystalReports.Engine.FormatEngin e.Export()
   CrystalDecisions.CrystalReports.Engine.ReportDocum ent.Export()
   IKA_VB.trial_param.Page_Load(Object sender, EventArgs e) in D:\Projects\IKA-VBP\trial_param.aspx.vb:123
   System.Web.UI.Control.OnLoad(EventArgs e) +67
   System.Web.UI.Control.LoadRecursive() +35
   System.Web.UI.Page.ProcessRequestMain() +731

Any help will be greatly appreciates. Thanks in advance

Regards,
Kalyan Bobba






Similar Threads
Thread Thread Starter Forum Replies Last Post
Crystal Report Export problem to excel spmano1983 VB.NET 0 August 17th, 2007 01:33 AM
Export Crystal Report Programatically Harinder.Dhamija ASP.NET 2.0 Basics 0 July 20th, 2007 08:28 AM
Export to PDF problem with crystal report in c# fidelio ASP.NET 1.0 and 1.1 Professional 0 April 12th, 2006 07:34 AM
facing problem to export crystal report to PDF whi agarwal Beginning VB 6 0 November 12th, 2005 06:57 AM
Crystal Report 8.5 Export to PDF problem DragonSon Crystal Reports 0 August 17th, 2004 10:32 PM





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