Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > Crystal Reports
|
Crystal Reports General discussion about Crystal Reports. For discussions specific to the book Professional Crystal Reports for VS.NET, please see the book discussion forum for that book.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Crystal Reports 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 September 23rd, 2004, 02:57 PM
Registered User
 
Join Date: Sep 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Crystal Report Printing Problem

I am trying to print a web based report with Crystal Report using Visual Studio .NET.

I am using the following code for printing:

************************************************** *******************

Dim CR As New CrystalDecisions.CrystalReports.Engine.ReportDocum ent()
        Dim temp As String
        'The loaction of the report
        temp = "C:\Inetpub\wwwroot\PopulateTextFieldCR\CrystalRep ort1.rpt"
        CR.Load(temp)

        Try
            Dim myReportTextObject As CrystalDecisions.CrystalReports.Engine.TextObject
            Dim myTestObject As CrystalDecisions.CrystalReports.Engine.ReportObjec t
            Dim strDesc As String
            'The name of the textfield in CR: DescriptionText
            If TypeOf CR.ReportDefinition.ReportObjects.Item("txtDes") Is CrystalDecisions.CrystalReports.Engine.TextObject Then

                'The text that you want to show in your textfield
                strDesc = "TEST"
                CType(CR.ReportDefinition.ReportObjects.Item("txtD es"), CrystalDecisions.CrystalReports.Engine.TextObject) .Text = strDesc

            End If
        Catch err As Exception
            'the description text in the document won't be written
        End Try

CR.PrintOptions.PaperOrientation = CrystalDecision[Shared].PaperOrientation.Landscape

CR.PrintOptions.PrinterName = "\\SES-FS01\SES-IADPRT01"

CR.PrintOptions.PaperSize = CrystalDecisions. [Shared].PaperSize.DefaultPaperSize

CR.PrintOptions.PaperSource = CrystalDecisions.[Shared].PaperSource.Auto

CR.PrintToPrinter(1, False, 0, 0)

************************************************** *******************

When I run the project, I get the following error message:

Server Error in '/PopulateTextFieldCR' Application.
--------------------------------------------------------------------------------

Error in File C:\Inetpub\wwwroot\PopulateTextFieldCR\CrystalRepo rt1.rpt: Request cancelled by the user.
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.InternalExc eption: Error in File C:\Inetpub\wwwroot\PopulateTextFieldCR\CrystalRepo rt1.rpt: Request cancelled by the user.

Source Error:


Line 46: CR.PrintOptions.PaperSize = CrystalDecisions.[Shared].PaperSize.DefaultPaperSize
Line 47: CR.PrintOptions.PaperSource = CrystalDecisions.[Shared].PaperSource.Auto
Line 48: CR.PrintToPrinter(1, False, 0, 0)
Line 49:
Line 50: 'CrystalReportViewer1.ReportSource = CR


Source File: C:\Inetpub\wwwroot\PopulateTextFieldCR\WebForm1.as px.vb Line: 48


Could someone please advice me on how I could fix this error?

Thanks in advance.

Sincerely,
Rino








Similar Threads
Thread Thread Starter Forum Replies Last Post
Crystal Report 8.0 printing problem arumugavel VB How-To 0 August 29th, 2007 05:33 AM
printing problem in crystal report 8.0 arumugavel Crystal Reports 0 August 28th, 2007 10:33 PM
Crystal Report Printing Problem walmohsin VB Components 3 January 14th, 2007 04:40 AM
Printing crystal report problem sanjivbshinde Crystal Reports 0 November 7th, 2006 07:16 AM
problem in crystal report printing tarun VB Components 1 May 16th, 2005 07:08 AM





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