Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 392159
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T16:07:54+00:00 2026-05-12T16:07:54+00:00

I have an unbound XtraReport that has a subreport control which contains another report.

  • 0

I have an unbound XtraReport that has a subreport control which contains another report. I call “unbound” to a report that has the definition of the fields using a schema but not actually bound to any DataSet, I create a DataTable using a Data Access Layer and then pass that object to the DataSource property of the report.

So, I have the following code:

        // (...) Get the data from the db and fill a DataTable

        if (table.Rows.Count > 0)
        {
            report.DataSource = table;

            // (...) Get the data from the db and fill a DataTable for the subreport
            report.SubPurchaseOrder.Report.DataSource = tableSubReport;

            report.ShowPreviewDialog();
        }
        else
        {
            MessageBox.Show("No data to show.");
        }

But what I get using this approach is the subreport printed very oddly (take a look at the attached pdf, sorry it’s in spanish but I think you get the idea).

I’ve read the DevExpress documentation and maybe I’m not getting the approach right, so my question to you is how to create a report that has one or more subreports but I have to provide the data to fill them using some process external to the reports, such as a Data Access Layer?

Please let me know if the question is not stated correctly or lacks of more info.

EDIT:

I uploaded a sample project with the report with problem here.

I’ve tried to use parameters of some kind. In the BeforePrint event of the subreport control, I tried:

((XRSubreport)sender).ReportSource.FilterString = "[IdPO_RO] = " + _idPurchaseOrder;

and

((XRSubreport)sender).ReportSource.Parameters["Id"].Value = _idPurchaseOrder;

Of course, for the second, I added a parameter and the filter string the same as the first but using the parameter.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T16:07:54+00:00Added an answer on May 12, 2026 at 4:07 pm

    I could solve the problem.

    The cause for this was that I was assigning to the wrong object. This line:

    report.SubPurchaseOrder.Report.DataSource = tableSubReport;
    

    should be:

    report.SubPurchaseOrder.ReportSource.DataSource = tableSubReport;
    

    So the brief explanation is that I was using another property to refer to the report contained in the subreport control (XRSubreport).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.