Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old December 3rd, 2004, 03:00 AM
Registered User
 
Join Date: Dec 2004
Location: hyderabad, ap, India.
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

Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Crystal Report Export problem to excel spmano1983 VB.NET 0 August 17th, 2007 02:33 AM
Export Crystal Report Programatically Harinder.Dhamija ASP.NET 2.0 Basics 0 July 20th, 2007 09:28 AM
Export to PDF problem with crystal report in c# fidelio ASP.NET 1.0 and 1.1 Professional 0 April 12th, 2006 08: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 11:32 PM



All times are GMT -4. The time now is 05:20 AM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.