Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Dispatcher processing has been suspended
Message
De
13/02/2013 09:05:55
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Windows Presentation Foundation (WPF)
Titre:
Dispatcher processing has been suspended
Divers
Thread ID:
01565872
Message ID:
01565872
Vues:
100
Hi,

I'm trying deploy a WPF application which uses the Windows Report Viewer. My application crashes every time I try to display the report.

This is the error that shows up in the Event Viewer:

"Event Type: Error
Event Source: IBC Express Billing System
Event Category: None
Event ID: 0
Date: 2/13/2013
Time: 9:44:05 AM
User: N/A
Computer: CUSTOMS
Description:
Dispatcher processing has been suspended, but messages are still being processed.
Source: WindowsBase
Target Site: IntPtr WndProcHook(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
Stack Trace: at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)


For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp."

This is my code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using System.IO;
using OakLeaf.MM.Main.WPF;

namespace SamaanSystems.IBC.WPF
{
    /// <summary>
    /// Interaction logic for ReportViewer.xaml
    /// </summary>
    public partial class InvoiceWithDetailReportViewer : ABusinessWindow
    {
        private string manifestNumbers;

        public InvoiceWithDetailReportViewer(string ManifestNumbers)
        {
            this.manifestNumbers = ManifestNumbers;
            InitializeComponent();
            _reportViewer.Load += ReportViewer_Load;
        }

        private bool _isReportViewerLoaded;

        private void ReportViewer_Load(object sender, EventArgs e)
        {
            if (!_isReportViewerLoaded)
            {
                if (File.Exists("./Reports/InvoiceReport.rdlc"))
                {
                    Microsoft.Reporting.WinForms.ReportDataSource reportDataSource1 = new Microsoft.Reporting.WinForms.ReportDataSource();
                    InvoiceReportDataSet dataset = new InvoiceReportDataSet();
                    dataset.BeginInit();
                    reportDataSource1.Name = "DataSet1";

                    reportDataSource1.Value = dataset.InvoicesSelectByManifestNumber;
                    this._reportViewer.LocalReport.DataSources.Add(reportDataSource1);


                    this._reportViewer.LocalReport.ReportPath = "./Reports/InvoiceReport.rdlc";
                    dataset.EndInit();

                    InvoiceReportDataSetTableAdapters.InvoicesSelectByManifestNumberTableAdapter invoiceTableAdapter = new InvoiceReportDataSetTableAdapters.InvoicesSelectByManifestNumberTableAdapter();

                    invoiceTableAdapter.ClearBeforeFill = true;
                    invoiceTableAdapter.Fill(dataset.InvoicesSelectByManifestNumber, this.manifestNumbers);

                    _reportViewer.RefreshReport();
                    _isReportViewerLoaded = true;

                }
            }
        }
    }
}
I have a feeling it has got something to do with the rdlc file not being found, but that's just a hunch, no scientific basis.

I do have the report in a folder caled Reposrt below the folder where my exe resides, so it should be found.

Can anyone help me solve this puzzle, please?
Frank.

Frank Cazabon
Samaan Systems Ltd.
www.samaansystems.com
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform