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

  • Home
  • SEARCH
  • 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 6859065
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T02:14:15+00:00 2026-05-27T02:14:15+00:00

I have a report that needs to get data from two logical areas of

  • 0

I have a report that needs to get data from two logical areas of my application’s DAL, Vendors.xsd and Customers.xsd. I can use the Database Expert to put both DataSets and their DataTables in to the report, but I get this error:

More than one datasource or stored procedure has been used in this report.
Please make sure that no SQL Expression is added and no server side group_by
is performed.

Everything about the report building / design seems to work fine. When I actually run the report, it asks me to log on to one of the two DataSets (seems to be whichever one I add second) and does not get the data.

I tested and confirmed that I do not have this problem if I put all the tables in one xsd to begin with.

EDIT

Here’s the code I’m using to load the report up:

Protected Sub CrystalReportViewer1_Init(sender As Object, e As EventArgs) Handles CrystalReportViewer1.Init
    'Get Customer ID param
    Dim CustomerID As Integer
    If Not Integer.TryParse(Request.QueryString("CustomerID"), CustomerID) Then
        CancelReportOnError("You must provide a customer ID!")
    End If

    'Get address type ID param
    Dim AddressTypeID As Integer
    If Not Integer.TryParse(Request.QueryString("AddressTypeID"), AddressTypeID) Then
        CancelReportOnError("You must provide an address type!")
    End If

    'Gather report data --
    'Address
    Dim customersControl As New BLL.Customers()
    Dim AddressData As DAL.Customers.AddressesDataTable = customersControl.GetAddressByCustomerID(CustomerID, AddressTypeID)
    AddressData.TableName = "Addresses"

    'Customer
    Dim CustomerData As DAL.Customers.CustomersDataTable = customersControl.GetCustomerByID(CustomerID)
    CustomerData.TableName = "Customers"

    'Confirm customer exists
    If CustomerData.Count = 0 Or AddressData.Count = 0 Then
        CancelReportOnError(String.Format("Could not find Customer with ID {0}", CustomerID))
    End If

    'Vendor
    Dim vendorsControl As New BLL.Vendors()
    Dim VendorData As DAL.Vendors.VendorsDataTable = vendorsControl.GetVendordByCustomerID(CustomerID)
    VendorData.TableName = "Vendors"

    'Confirm vendor exists
    If VendorData.Count = 0 Then
        CancelReportOnError(String.Format("Could not find a Vendor associated with Customer ID {0}", CustomerID))
    End If

    'Build data source
    Dim ReportData As New DataSet()
    ReportData.Tables.Add(VendorData)
    ReportData.Tables.Add(CustomerData)
    ReportData.Tables.Add(AddressData)
    ReportData.Relations.Add(CustomerData.CustomerIDColumn, AddressData.CustomerIDColumn)
    ReportData.Relations.Add(VendorData.VendorIDColumn, CustomerData.VendorIDColumn)

    'Load the report
    Dim Report As New ReportDocument()
    Report.Load(Server.MapPath("~/Members/Customers/MailingEnvelope.rpt"))
    Report.SetDataSource(ReportData)

    'Set the report to our viewer
    CrystalReportViewer1.ReportSource = Report
    CrystalReportViewer1.DataBind()
End Sub
  • 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-27T02:14:16+00:00Added an answer on May 27, 2026 at 2:14 am

    Unless you tie the two datasets together logically, Crystal won’t be able to use them in the same report.

    However, if you create one or two subreports (depending on whether the data is related or not), and add the appropriate dataset to each subreport, Crystal will be much happier.

    Update for new information in question

    The problem is that you have two distinct sets of data relations: customer/address and customer/vendor. Essentially, Crystal doesn’t know how to pull these into 1 big SQL statement because there is no relationship between vendor and address.

    The solution is to have only the customer information in the main report, then have one subreport for the Vendor data and one subreport for the Address data. These subreports can be linked by the customerid so that in the event that you run this report for multiple customers, Crystal could automatically pull out the correct customer information.

    As it stands now, you should be able to just assign the vendor table to one subreport’s datasource and the addressdata to the other’s.

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

Sidebar

Related Questions

I have a report that renders data returned from a stored procedure. Using profiler
I have a table that I need to get some specific data from for
I have a field in my report that needs to have a length of
I have this Birt report that I inherited from another developer, consisting of a
I have already created a report using list of data from my database. i
I have a Crystal Report used in an ASP.NET web application that I've just
I have a complicated report that I need to draw with GDI+ (I don't
I have a report that uses a TChart that I am maintaining. One of
I have a report that is used by a windows service and a form
I have two tables to be printed in same page. Data for those tables

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.