WPF Report Viewer Thrown an Exception After PrintToPrinter() method

When I send to report for print from calling PrintToPrinter method after print report that exception show on first time
Then reprint report that exception show.

As with your other post, an ambiguity:
What has the WPF viewer (if that is what you are using..., see your other post), got to do with PrintToPrinter?
Also, provide code used.
Oh and what happens if you try to print the report from the CR designer in the .NET IDE?
- Ludek
Senior Support Engineer AGS Product Support, Global Support Center Canada
Follow us on Twitter
Message was edited by: Ludek Uher

Similar Messages

  • WPF report viewer throws exception when print button clicked when hosted on winform

    When hosted in a winform app the wpf report viewer control throws an exception when the print button is clicked.
    All the other buttons appear to work, any ideas on a work round?
    I have created a sample VS 2013 solution that shows this issue
    As I can't even attach a renamed zip file it can be downloaded directly from here: http://1drv.ms/QxUrZo
    The reason I am attempting to use this control is that the standard reportviewer causes occasional errors in citrix enviroments causing the citrix session to lock up.  This appears to be a relatively common issue and the usual issue of both sides (citrix & crystal) blaming the other for the cause and me the developer needs to find a work round.
    I've 'bodged' in an additional button on our app to export a loaded report to file as pdf then print it but this should not be the permanent resolution.
    BTW glad to see the x64 dynamic parameter issue has been fixed at last, think I reported this over two years ago and again ended up having to work round it.

    Hi Ludek
    A sample project that loads a simple report is available from here: http://1drv.ms/QxUrZo
    The project is called WPFReportHost
    This loads a simple report when run then you can test the basic functionality of the viewer and all will work until you press the print button and then you get the application crash.
    Have to improve my search technique when I googled for other people having this issue I didnt' find the link.
    We've noticed the WPF viewer loads considerably faster and has better functionality than the winform viewer and hope that it might solve the citrix preview issue (yet to be tested).
    So as a work round we've hidden the default print button added our own and call the report print directly as per below:
    using (PrintDialog dialog = new PrintDialog())           
         dialog.AllowCurrentPage = true;
         dialog.AllowSelection = true;    
         dialog.AllowSomePages = true;
         dialog.AllowPrintToFile = true;
         if (dialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)                     {
              reportDocument.PrintToPrinter(                         
                   dialog.PrinterSettings,                         
                   new System.Drawing.Printing.PageSettings(dialog.PrinterSettings);
                    false);                   
    Would be nice to have a fix

  • Crystal Report Viewer Closes the application after showing "The text cannot be found in the report" when searching for a text in a multipage report

    Post Author: Farooque
    CA Forum: Other
    Hi,
    I am using Crystal report viewer (Crviewer.dll) version 11.0.0.1282 to show crystal reports in my VB6 application. When we search for any text in a multipage report after the last find system shows a message "Crystal Report Viewer" "Text cannot be found in the report" and trows an unhandled error and closes the application. How can I fix this?
    Please help
    Thanks in advance.
    Farooque. ([email protected])

    Enter the following:
    viewer blank net crystal
    into the search box in the top right corner. You should get a number of hits (Kbases and articles) that should point you to a solution.
    Ludek
    Follow us on Twitter http://twitter.com/SAPCRNetSup
    Got Enhancement ideas? Try the [SAP Idea Place|https://ideas.sap.com/community/products_and_solutions/crystalreports]

  • Report Viewer doesn't Preview after Export

    The Windows Application has a C# class for a Report Menu which calls any one of several reports.  The Report Menu allows the selection of various parameters for the report being called and then calls a C# class that builds a sql query and sets it as the report data source and sets the report parameters then opens the report in Crystal report viewer.
    The report displays in the viewer and I can click on the close button and the Report Menu in the App allows me to select a different report with different parameters, no problem. 
    However, when any report is previewed in the viewer, before clicking the close button, I can click on the Export button and successfully export the report in whatever format and get "Export Completed".  Then click on the close button and I am back at the Report Menu in the App.  Try to preview any report now and it will crash.  The error messages vary somewhat depending on the report selected.  I can set a break point at the beginning of the class (that builds the query and sets the data source) and hit that break before doing an Export - -
    but after the export the break point is never hit.  Its like the Report Menu class is somehow trying to display the report without calling the report building class!
    VS 2005 and CR XI R2

    OK. A good place to start is with the basics.
    See the [Rules of Engagement|https://www.sdn.sap.com/irj/sdn/wiki?path=/display/home/rulesofEngagement]
    Step 2 Asking Your Question; Provide Enough Information
    So, please provide the necessary info as per the above.
    Also:
    " The error messages vary somewhat depending on the report selected. I can set a break point at the beginning of the class (that builds the query and sets the data source) and hit that break before doing an Export - -"
    Please provide the most common error you get, else provide all of the errors.
    Ludek

  • Crystal Report Viewer is not appearing after hosting on server

    Dear Friends
    I developed a web application in Visual Studio 2010, and my Database is SQL Server 2008 R2.
    I created reports using Crystal Report 13 in Visual Studio and my Operating System is Windows 7 32-Bit.
    All reports are running fine at my machine.
    When I copied published folder into "wwwroot" folder and hosted, all reports are working Good.
    Here i have my web application in "Default Web Sites" in IIS.
    Then After I added a new website in IIS with a port No. and created a virtual folder and hosted my web application.
    The application is running fine, But the problem is Reports are not appearing on Web Page.
    I have created an toolbar to export the report. And when I am exporting the report to PDF, It is working well and reports are exported successfully.
    I didn't understand why this is happening?
    Is this a problem of  port no. ?
    or
    Is this a problem of IIS?
    or
    Is this a problem of Browser?
    or
    Is this a problem with CrystalReportViewer?
    or
    something else?
    In fact I have the folder for  "C:\inetpub\wwwroot\aspnet_client\system_web\4_0_30319\crystalreportviewers13". for crystal reports.
    Dear All kindly help me in this issue, it is disturbing me since 5 days.
    All helps are appreciable.
    Thank you.

    Enter the following:
    viewer blank net crystal
    into the search box in the top right corner. You should get a number of hits (Kbases and articles) that should point you to a solution.
    Ludek
    Follow us on Twitter http://twitter.com/SAPCRNetSup
    Got Enhancement ideas? Try the [SAP Idea Place|https://ideas.sap.com/community/products_and_solutions/crystalreports]

  • Crystal Report Viewer GroupTree no Hyperlink after disable SeparatePages

    Hello,
    This problem has puzzeled me enough. I would really appreciate any help i can get.
    First my environment is ASP.NET VS.NET using VB.NET
    When i set the "Separate Pages" property to "True" i get hyperlinks in the group tree. The hyperlinks drills down to the specific item. However, if the "Separate Pages" property set ot false, I lose the hyperlinks in the group tree. Any ideas why or how to resolve this issue?
    Thanks.

    Sorry, the web / win question was quite silly of me to ask.
    Since you do not have any service packs, let's start with that. SP 1 is here:
    https://smpdl.sap-ag.de/~sapidp/012002523100009351512008E/crbasic2008sp1.exe
    I did try to reproduce the issue with CR 2008 and .NET 2008 and there this works as expected. I don't have CR 10.5 image running right now,  but try the SP and if that does not work I'll test that version. Just an FYI;  It may be that this is something that will need to be fixed for CR 10.5. Fixes normally take 6+ months so if this is reproducible after SP 1 is applied, you'll have to consider your options.
    Ludek

  • Crystal Report Viewer and Windows Vista

    Hi,
    We are using RDC methodology for launching the crystal reports in the web using ASP.
    The web server operating system is Windows 2003, Crystal Reports XI is installed in it.  Report is not launching in only one client machine.  For all the other client machines reports are launching perfectly.  The problem is blank white activex control is displayed.  I tried to register the crystal reports viewer (ActiveXViewer.cab available in the crystal installation folder) deliverables in the client machine but after installing the deliverables same problem persists.
    When I click on the Crystal Report viewer Internet Explorer Exception occurs
    The following add-on was running when this problem occurred:
    Add-on Name:      CRViewer.dll
    Company Name:      (Not verified)Business objects
    Description:                           Crystal Report Viewer
    Two buttons
    Advanced... and Continue are shown but when we click on the button IE crashes
    The client machine operating system is u201CWindows Vistau201D service pack 2
    Internet Explorer 7 version is installed in it.
    In the client machine event viewer log the following details are available.
    Log Name:      Application
    Source:        Application Error
    Date:          10/29/2010 9:18:35 AM
    Event ID:      1000
    Task Category: (100)
    Level:         Error
    Keywords:      Classic
    User:          N/A
    Computer:      BillVista.toyalloc.local
    Description:
    Faulting application iexplore.exe, version 7.0.6002.18005, time stamp 0x49e01e78, faulting module CRViewer.dll, version 11.0.0.893, time stamp 0x41b6ac85, exception code 0xc0000005, fault offset 0x0001f8e7, process id 0x210, application start time 0x01cb7773d2b1c584.
    Event Xml:
    <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
      <System>
        <Provider Name="Application Error" />
        <EventID Qualifiers="0">1000</EventID>
        <Level>2</Level>
        <Task>100</Task>
        <Keywords>0x80000000000000</Keywords>
        <TimeCreated SystemTime="2010-10-29T14:18:35.000Z" />
        <EventRecordID>98684</EventRecordID>
        <Channel>Application</Channel>
        <Computer>BillVista.toyalloc.local</Computer>
        <Security />
      </System>
      <EventData>
        <Data>iexplore.exe</Data>
        <Data>7.0.6002.18005</Data>
        <Data>49e01e78</Data>
        <Data>CRViewer.dll</Data>
        <Data>11.0.0.893</Data>
        <Data>41b6ac85</Data>
        <Data>c0000005</Data>
        <Data>0001f8e7</Data>
        <Data>210</Data>
        <Data>01cb7773d2b1c584</Data>
      </EventData>
    </Event>
    Could any one help me regarding this.

    Hello,
    First thing to do is upgrade to [CR XI R2 SP4 full build|https://smpdl.sap-ag.de/~sapidp/012002523100011802732008E/crxir2_sp4_full_build.exe]. Then get up to Service Pack 6 and you should not have problems with Vista.
    CR XI R1 will not and has never been tested on that OS.
    If you do not want to upgrade though use Process Monitor to watch for Access Denied errors. Also run IE in Compatibility mode.
    Likely what is happening is your test PC doesn't have rights to install ActiveX controls.
    Thank you
    Don

  • Can't close, resize or move report viewer window

    In my application, I have a window with a button. When I click the button, a report viewer window opens. After the report has loaded, everything works fine, except that I can't close, move or resize the report viewer window.
    Some of my code:
    Private Sub btnLogReport_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLogReport.Click
             Dim tmpFrm As New frmLogReport
             tmpFrm.Show()
    End Sub
    Private Sub frmLogReport_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
            Me.CrystalReportViewer1.ReportSource = Application.StartupPath.Replace("\bin", "") & "\Reports\LogReport.rpt"
    End Sub
    Any help?

    What version of CR?
    What CR Service ppacks have been applied?
    What version of .NET?
    What OS?
    Is this on your dev box or after you deploy?
    Ludek
    Follow us on Twitter http://twitter.com/SAPCRNetSup
    Got Enhancement ideas? Try the [SAP Idea Place|https://ideas.sap.com/community/products_and_solutions/crystalreports]

  • Publishing report views

    Guys,
                  How do you publish report views on the web after creating BEX reports?
    Thanks,
    RG

    Not exactly. The portal role will contain the queries in its definition - what you can simply do is to assign the portal role to the user IDs. The creation of the portal role will be done by the portal guy and you will have to give the definition of which role will contain what queries. Examples of roles might be 'FI' or maybe 'Sales Planning' etc.

  • Multiple instances of Crystal Reports Viewer possible in WPF?

    Hi, I've dragged and dropped three Crystal Reports Viewer controls on my WPF application. The goal is to be able to select up to 3 reports from a listbox and click run to generate the reports simultaneously. When I select just one report, it works fine. However when I select multiple reports it throws errors (object not found, etc). It seems there is a problem with multiple threads. Is it possible to have multiple instances of the Crystal Report Viewer display reports simultaneously? I am using version 13.0.9.1312 from the link below along with VS2013 C# WPF.
    SAP Crystal Reports, developer version for Microsoft Visual Studio: Updates & Runtime Downloads
    Thanks,
    Syed

    I was able to quickly cobble together a two viewer app that looks like this:
    The code is like this:
    Public Sub New()
            ' This call is required by the designer.
            InitializeComponent()
            ' Add any initialization after the InitializeComponent() call.
            Dim crReportDocument As New CrystalDecisions.CrystalReports.Engine.ReportDocument
            crReportDocument.Load("C:\tests\formulas.rpt")
            CrystalReportsViewer1.ViewerCore.ReportSource = crReportDocument
            Dim crReportDocument2 As New CrystalDecisions.CrystalReports.Engine.ReportDocument
            crReportDocument2.Load("C:\tests\report1.rpt")
            CrystalReportsViewer2.ViewerCore.ReportSource = crReportDocument2
        End Sub
    For more details see the document WPF Project Using the Crystal Reports WPF Viewer in 8 Easy Steps
    Now a couple of things to keep in mind;
    1) The report engine is based on 3 Concurrent Processor License (CPL) model. Meaning you can process at most three reports at the same time. In my test, doing the above code for four reports worked, but the reports are very, very simple - and with saved data. What a "real" world reports will do, I am not sure. I do know that in a web app, the reports are queued up until one report is done and thus a CPL is freed up. You will also need to keep in mind any database connection limits, etc.
    2) There is also a Print Job limit. This by default is set to 75. In a nutshell, almost anything done with a report is a Print Job. E.g.; paging, zooming, drilling, searching, etc., etc. In addition subreports are considered to be Print Jobs. Thus a report with one subreport in a detail section that returns a thousand rows of data and therefore running 1000 subreports will error out.
    You can read more about Print Job limits here:
    Crystal Reports Maximum Report Processing Jobs ... | SCN
    - Ludek
    Senior Support Engineer AGS Product Support, Global Support Center Canada
    Follow us on Twitter

  • Integration of Crystal Report Viewer in VS2010 WPF

    Hello,
    I google and research and founded that the viewer control is not attached with VS2010 so, we have to install it separately. I found it form here    [http://www.businessobjects.com/jump/xi/crvs2010/us2_default.asp].
    I installed "SAP Crystal Reports, version for Visual Studio 2010".
    Now, I want to add Crystal Report Viewer on my WPF Page. how can I do this ?
    I tried to find that control to add in toolbox but I didn't find it.
    Please can someone help me int this that how can I add that control and call the report to view in that and change the sql server dynamically for that crystal report.
    Bunch of thanks in advance, this would save me a lot....Appreciated any ones help.
    Thanks

    See [this|http://www.sdn.sap.com/irj/scn/elearn?rid=/library/uuid/a09f7025-0629-2d10-d7ae-df006a51d1a8] demo and search these forums too.
    Ludek
    Follow us on Twitter http://twitter.com/SAPCRNetSup
    Got Enhancement ideas? Try the [SAP Idea Place|https://ideas.sap.com/community/products_and_solutions/crystalreports]

  • Problem showing the crystal report viewer in form after added the component on it

    Greetings
    I have a problem running a program. I created a form which I added the component Crystal Report Viewer perfecty but during program execution when I call that form my VS 2012 Ultimate show the following error:
    Translated:
    Failed to create the form. See Exception.InnerException for details. Error: An exception occurred in the type initializer for 'CrystalDecisions.Shared.SharedUtils'.
    Note: If I remove the component from the form. the applications runs fine when calling the form without the component CrystalReportViewer
    It is something related to my VS? o just that the actual version 13.0.9 is not yet compatible?

    Report.Show?
    How about you try:
    CrystalReportViewer1.ReportSource = <path to your report>
    Or:
    Dim crReportDocument As New CrystalDecisions.CrystalReports.Engine.ReportDocument
    crReportDocument.Load(<path to your report>)
    CrystalReportViewer1.ReportSource = crReportDocument
    Or, if the report is added to the project:
    crReportDocument = New test
    CrystalReportViewer1.ReportSource = crReportDocument
    - Ludek
    Senior Support Engineer AGS Product Support, Global Support Center Canada
    Follow us on Twitter
    Message was edited by: Ludek Uher

  • Report views correctly in Report Viewer but on export or print, blank page inserted after every page

    Hi all
    I'm hoping someone has an idea what is causing this issue. I am using Crystal 2008 and have created many reports over the years, with no issue like this.
    I have had to create a label file for an Avery label that does not appear in the Crystal Reports default list of label definitions (have done this many times before for other labels, with no issue).
    The report displays perfectly in the CR Report Viewer, however once the report is sent either to PDF export or to the printer, an extra blank page is inserted after every page of the report.
    The fact that it displays correctly in the viewer means there is nothing in the report that is amiss.... there is something going on when the report is sent out.
    I've read a lot of similar problems, however the idea that it is a network problem doesn't explain why the hundreds of other reports I've created exactly the same way... do not have this problem!
    Does anyone know the answer to this puzzle?
    regards
    Kaz

    Hi Karen
    Here is the issue. When you look at the report in the viewer you see this:
    Notice the dashed line after the body of each label. That line is there because the report is formatted to be a column report:
    So the viewer shows you that there is another column to be printed / exported and that is what is happening with the report.
    - Ludek

  • Everything works except viewing a report *in* the Report Viewer web part

    Hello!
    I'm having an issue with the SharePoint 2007 PIK where the following works fine...
    1. Adding the Document List to the web page and clicking a report to view it in a new browser window
    2. Adding a Document View web part and pointing it to a Document on the BOE server repository views fine in the Doc View web part
    However, when I try to use the Crystal Report View web part, click Edit, and Browse to select a report to view, it selects it fine but does not display it. Instead I get this error:
    Report cannot be displayed because no report processing server is available. Please try again later or contact your BusinessObjects Enterprise administrator.
    It setting up a connection between the Document List and Crystal Report View also gives the same error when a report is selected by the end user.
    Any ideas what I can check? Do I have to install the BOEXIR2 web components on this SharePoint server too?
    Right now it just has the BOE .NET SDK and SharePoint PIK. The full BOE XI R2 server that I'm calling is on another computer.
    Thanks!
    Horus

    Ok, got this to work finally. The virtual directory steps were helpful but I still got broken links on my images.
    I tried right clicking the toolbar and report images in the browser and found the URL. Then I just entered that URL in the browser. This helped a bunch since at least I had a new error to research.
    Server Error in '/crystalreportviewers115' Application.
    Configuration Error
    Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
    Parser Error Message: Cannot use 'partitionResolver' unless the mode is 'StateServer' or 'SQLServer'.
    Googling this lead me to a tip to add a sessionState key in my X:\Program Files\Business Objects\common\3.5\crystalreportviewers115\web.config file as follows:
    <sessionState mode="SQLServer" timeout="60" allowCustomSqlDatabase="true" partitionResolverType="Microsoft.Office.Server.Administration.SqlSessionStateResolver, Microsoft.Office.Server, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" />
    After this my buttons and images worked. I'm not sure if your config is different but as a beginner with this stuff myself hopefully this works for you.
    Horus

  • WPF Styles and WPF Crystal Reports viewer

    Hi,
    We are currently developing a WPF application which will utilize Styles created with Expression Blend.
    Our environment is VS2010 SP1 and Crystal Reports for VS2010 SP2.
    We want to design our reports with Crystal Reports but we don't seem to find any documentation or topics about integrating WPF Styles with the current WPF Crystal Reports Viewer.
    So I was wondering if somebody here already tried to use WPF styles with the WPF CR Viewer.
    If so, how does it basically work?
    Thank you in advance.

    Hello Alan
    This morning I got a short note on the issue from Program Management. In a nut shell this is what they say:
    ..at this time the WPF viewer doesn't expose support for styles and the best thing will a post
    to the idea on [SAP IdeaPlace|SAP Idea Place|https://ideas.sap.com/community/products_and_solutions/crystalreports]. Based on the interest level expressed there the PM group will make a decision on how best to proceed.
    Obviously, this is not going to be a swift process, but at least something...
    - Ludek

Maybe you are looking for