Data retrieval failed for the subreport, 'Subreport1', located at

Posted Jan 01, 1970 12:00 AM

I am trying to get a subreport working. I am using VS 2010. I've inserted a "Subreport1" into my main report and keep getting the error: Data retrieval failed for the subreport, 'Subreport1', located at....

Here's my code:

public partial class rptEngOrd : Form
{
    public rptEngOrd()
    {
        InitializeComponent();
    }

    private List<EngOrd> eoNumParam;
    private string eonum;
    private DataSet dsReport;
    private DataSet dsSubReport;

    private void rptEngOrd_Load(object sender, EventArgs e)
    {
        LoadComboBoxes();
    }

    private void LoadComboBoxes()
    {
        try
        {
            eoNumParam = EngOrdDB.GetDistinctEONum();
            cboEONum.DataSource = eoNumParam;
            cboEONum.SelectedIndex = -1;

        }
        catch (Exception ex)
        {
            MessageBox.Show(ex.Message, ex.GetType().ToString());
        }
    }

    private void btnPreview_Click(object sender, EventArgs e)
    {
        try
        {

            if (cboEONum.SelectedValue.ToString().Equals("zALL"))
            {
                eonum = "";
            }
            else
            {
                eonum = cboEONum.SelectedValue.ToString();
            }

            //get the data
            dsReport = EngOrdDB.GetEngOrdbyEONum(eonum);

            //provide local report information to viewer
            reportViewer1.LocalReport.ReportEmbeddedResource = "CustomMenu.rptEngOrd.rdlc";
            reportViewer1.ProcessingMode = ProcessingMode.Local;

            //prepare report data source
            ReportDataSource rds = new ReportDataSource();
            rds.Name = "dsReport";
            rds.Value = dsReport.Tables[0];
            reportViewer1.LocalReport.DataSources.Clear();
            reportViewer1.LocalReport.DataSources.Add(rds);

            //prepare sub report data source
            dsSubReport = EngOrdTaskDB.GetEngOrdTaskbyEONum(eonum);
            ReportDataSource rdsSub = new ReportDataSource();
            rdsSub.Name = "dsSubReport";
            rdsSub.Value = dsSubReport.Tables[0];
            reportViewer1.LocalReport.DataSources.Add(rdsSub);
            reportViewer1.LocalReport.SubreportProcessing += new SubreportProcessingEventHandler(srptProcessingEventHandler);

            //load the report viewer
            reportViewer1.LocalReport.Refresh();


            //MessageBox.Show(eonum);

        }
        catch (Exception ex)
        {
            //display generic message back to user
            MessageBox.Show(ex.Message);
        }
        finally
        {
        }

        reportViewer1.RefreshReport();

    }

    private void srptProcessingEventHandler(object sender, SubreportProcessingEventArgs e)
    {
        ReportDataSource r = reportViewer1.LocalReport.DataSources[1];
        e.DataSources.Add(r);

    }       

}

Similar Topic Questions

Data retrieval failed for the subreport, Please check the lo

Please anybody can help me who have faced the same above problem while calling RDLC Subreport in winform. I have 2 tables 1) BankAccount & 2)BankAccountDetail. The relation between the two is by using bankCode field. Now I want to...

Posted Nov 30, -0001 12:00 AM

Data retrieval failed for the subreport, 'Subreport4', Only happened to 1 PC but not on other PCs

I have a VS2013 (written in C# x32) desktop application accessing a hosted SQL Server 2012. It has a report that has 4 subreports. After I installed it onto a few PCs, One of the PC has the above issue...

Posted Oct 31, 2014 1:45 AM

Data retrieval failed for subreport error VS 2012 VB.net asp

I've been researching this for the past few days with no success. I've got a vs 2012 asp project and I'm attempting to setup a report that contains a subreport. When running it gives me the above error...

Posted Dec 02, 2014 7:08 AM

Matlab engine data retrieval fails

I have a problem reading out data from the matlab engine. I can create a variable in the engine, and saving the workspace and subsequently loading it into matlab shows that the variable exists and has the right value. However the C++...

Posted Jul 10, 2014 6:07 AM

How to retrieve table column data on webpage and resend to other location upon click on resend button?

Can you help me on this? Here is my problem: I have created one web monitoring page for extracting data from database and publish on webpage in table view. Table fields contains Name, Address, ID, Message type and Payload (some XML...

Posted Feb 14, 2014 11:37 AM

Different font size and color using CSS for data retrieved via JSTL

I am working on a web application where I get some string data using Java Servlets and then subsequently display that data on a JSP view using JSTL. Below is the code snippet: <table border="1" width=100%> <th style="width:...

Posted Nov 20, 2013 11:22 AM

Unable to access json data retrieved from php page using jquery $.ajax

How to access this json data in JavaScript. when I alert it the result is undefined Here is jQuery code $.ajax({ ...

Posted Nov 23, 2013 4:34 AM

Alternative method for pivot in sql for data retrieval

I am searching for an efficient method for horizontal aggregations in SQL other than pivot and case. What would be the best alternative method to create a pivot other than using groupby and orderby clauses. Let FV be a table containing...

Posted Nov 26, 2013 11:48 AM

Asynchronous data retrieval

I'm thinking of doing something as below, but I'm unaware of process that I can use to achieve it. Please help me with this. I have 1000 records to be displayed at front end which is definetly a time consuming...

Posted Nov 26, 2013 8:51 AM

Android data retrieving from server showing Connectio error

I have an android app with two versions.. old version and new version.i am retrieving datas from server through php API.Am getting data retrieved for the latest version.But for the old version its showing connection error..i have to confirm where...

Posted Nov 27, 2013 3:29 AM

Data retrieval by key is slow

I have a table with a huge number of rows. I stored a few ids from that table in another table, hoping that I will be able to retrieve them faster, since I have their key. However, my code is...

Posted Nov 27, 2013 6:01 AM

SQL Server: How to override Error 0xc02020a1: Data Flow Task 1: Data conversion failed

I'm using SQL Server Import Wizard to import a 260GB flat text file into a table. I have about 25 fields/columns per row and endless rows. The large text file has vertical bars as a column delimiter and...

Posted Nov 29, 2013 11:41 AM

Speeding up data retrieval from SQL server?

I moved data from a source database/DB to a data warehouse/DW. I wanted to fetch 4 out of 5 million rows from the DW using a simple select statement with a where clause. There are no joins and such in...

Posted Dec 02, 2013 5:43 AM

Extjs - Add warning image in a textfied dynamically when data vaildation fails using extjs

I am trying to change the background color and add a warning image withing the textfield when the data vaildation fails. So far, I am able to change the background color but unable to insert a image in the textfield...

Posted Dec 15, 2013 12:01 PM

Saving data from a Windows Form to any location [on hold]

I am creating a Windows application using Visual Studio 2012. It's functionality is to store the details of the subjects of a student and calculate his attendance. My form is up and running and everything is fine. But now I...

Posted Dec 25, 2013 10:50 AM

Populating HTML Table Headers according to the data retrieved from MySQL

I am having a tough time in writing a code and need your help. I am creating an application in which patient's data is stored in a DB by doctor. I know how to retrieve data from MySQL DB into...

Posted Jan 04, 2014 4:40 AM

JAVA :Find user location and then retrieve a list based on the location

Hi I'm trying to create a script for a school project and I really just do not know how to go about creating a script that will: Get the users location and then read a file based on the geo-ip...

Posted Jan 06, 2014 6:53 AM

Pattern for data retrieval from persistence layer

Consider you have a very huge and complex product database where you want to filter on several fields. For querying I use a denormalized Elasticsearch database. Now you want to display a list (around 300) related categories on the page,...

Posted Jan 11, 2014 5:13 AM

Data retrieval from video youtube

Hello, I have a problem and I can not solve it. The problem is, if I have a video (youtube) that contains its ID (-) as "dMzbvz-nBqI", the code skips it and does not display data. What do you think is the problem? Attachment...

Posted Jan 12, 2014 8:51 AM

 
 
Email:

Username:

Password:


Register

Username:

Password:

Login


Forgot Password
Reset my password!