Home » VB.Net

Load report failed

Hi ,


I m trying to create a report using Crystal Report with C# in WPF(Using Visual Studio 2008) . I have Sqlite DB and need to display record in a report. I used  following code.


 <Window x:Class="WpfApplication5.Window1"



    Title="Crystl Report in WPF" WindowState="Maximized" Loaded="Window_Loaded">


        <WindowsFormsHost Name="reportViewer">





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 CrystalDecisions.Windows.Forms;

using CrystalDecisions.CrystalReports.Engine;


namespace WpfApplication5



    /// Interaction logic for Window1.xaml


    publicpartialclassWindow1 : Window


        CrystalReportViewer cryreportviewer = null;

        public Window1()


            CrystalReportViewer cryreportviewer = null;



            // create new crystalReport viewer

            cryreportviewer = new CrystalReportViewer();

            cryreportviewer.DisplayGroupTree = false;

            // add crystl report view as child control  to windows forms host object.

            reportViewer.Child = cryreportviewer;


        privatevoid Window_Loaded(object sender, RoutedEventArgs e)


            if (reportViewer == null)


                cryreportviewer = new CrystalReportViewer();

                reportViewer.Child = cryreportviewer;



            // create new report document

            ReportDocument report = newReportDocument();

            // load report to document


            cryreportviewer.ReportSource = report;






When I run this I m getting following error .


An unhandled exception of type 'CrystalDecisions.Shared.CrystalReportsException' occurred in CrystalDecisions.CrystalReports.Engine.dll


Additional information: Load report failed.


Can Anybody Please help me to solve this error.




3 Answers Found


Answer 1


So, is your Crystal report  Viewer hosted correctly?

If so, then how about adding a OpenReportMethod?

report.load("you file.rpt", OpenReportMethod.___)..?


hope this helps.





Answer 2

Hi gioVhan,

Actually i'm really new to these stuffs and dont know how to do Crystal report  Viewer host. I just create  a crystal  report and used above code, thats all. I would appreciate verymuch if you can send me some, sample code or and good link I can reffer.


Search for  Load report failed


<< Previous      Next >>

Microsoft   |   Windows   |   Visual Studio   |   Sharepoint   |   Azure