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 6601613
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T18:46:36+00:00 2026-05-25T18:46:36+00:00

I have a multitable c# report based on a database I have created underneath

  • 0

I have a multitable c# report based on a database I have created underneath using SQL. I am using the following code to try and set the datasource and have tried many different variations but cannot get the information from my database to show up properly in my report. Any help is greatly appreciated. The dataset is populating. Additionally the single table reports properly fill with data only the multitable reports aren’t working.

UPDATE: The report now shows data from one table using report.Database.Tables["Invoices"].setDataSource(posDataSet.Tables["Invoices"]); However using the same logic on the table that generates the detail lines does not show any data.

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using CrystalDecisions.Shared;
using CrystalDecisions.CrystalReports.Engine;

namespace SureSalePos
{
    public partial class Reporter : Form
    {

        private PosDatabaseDataSet posDataSet;
        public Reporter(PosDatabaseDataSet dataToReportOn)
        {
            InitializeComponent();
            posDataSet = dataToReportOn;
           //InvoiceReport ir = new InvoiceReport();
           // this.reportViewer.LocalReport.ReportPath = ir.FileName;

        }

        private void Reporter_Load(object sender, EventArgs e)
        {
            ConnectionInfo myConnectionInfo = new ConnectionInfo();

            myConnectionInfo.ServerName = "";// "PosDatabaseDataSet";
            myConnectionInfo.DatabaseName = "";//"PosDatabase.mdf";
            myConnectionInfo.UserID = string.Empty;
            myConnectionInfo.Password = string.Empty;
            setDBLOGONforREPORT(myConnectionInfo);
            //this.reportViewer.RefreshReport();
        }

        private void setDBLOGONforREPORT(ConnectionInfo myconnectioninfo)
        {
            InvoiceReport report = new InvoiceReport();
            report.DataSourceConnections.Clear();

            // For each table set the source from your dataset
            report.Database.Tables["Invoices"].SetDataSource(posDataSet.Tables["Invoices"]);
            report.Database.Tables["InvoiceItems"].SetDataSource(posDataSet.Tables["InvoiceItems"]);
            //report.Database.Tables["People"].SetDataSource(posDataSet.Tables["People"]);
            report.Database.Tables["Preferences"].SetDataSource(posDataSet.Tables["Preferences"]);
            //report.Database.Tables["Skus"].SetDataSource(posDataSet.Tables["Skus"]);

            crystalReportViewer1.ReportSource = report;
            crystalReportViewer1.RefreshReport();

        }

        private void crystalReportViewer1_Load(object sender, EventArgs e)
        {
        }
    }
}

EDIT: Updated Code above September 22

  • 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-25T18:46:37+00:00Added an answer on May 25, 2026 at 6:46 pm

    You shouldn’t need to set the login since you are supplying the report data. Try the following:

    report.DataSourceConnections.Clear();
    
    // For each table set the source from your dataset
    report.Database.Tables["TableName"].SetDataSource(posDataSet.Tables["TableName"]);
    
    crystalReportViewer1.ReportSource = report;
    crystalReportViewer1.RefreshReport();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Have you managed to get Aptana Studio debugging to work? I tried following this,
Have the following code. The height is variable so the height of the floating
Have a look at this code: #include <iostream> using namespace std; int main() {
I have evaluated several development tools for converting my informix SQL-based app. They are:
Have just started using Google Chrome , and noticed in parts of our site,
Have you ever seen any of there error messages? -- SQL Server 2000 Could
Have you guys had any experiences (positive or negative) by placing your source code/solution
Have just started using Visual Studio Professional's built-in unit testing features, which as I
Have created simple Ajax enabled contact forms before that have around 12 fields -
I have huge query on my SQL 2005 Server. This have to be run

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.