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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T02:20:35+00:00 2026-05-16T02:20:35+00:00

I have an application which needs to generate a report. However, I do not

  • 0

I have an application which needs to generate a report. However, I do not know how to generate a report using CrystalReport which is based on a query. Let’s say I just need to generate report from my database which shows the values returned by my select query. I’ve never used Crystal Reports before so I’m new to this.

Thanks everyone 🙂

EDIT:

So far, this is what I have:

ConnectionString myConnString = new ConnectionString();
string connString = myConnString.getConnectionString();
SqlConnection connSearch = new SqlConnection(connString);
connSearch.Open();

SqlCommand cmdLoad = new SqlCommand("Search", connSearch);
cmdLoad.CommandType = CommandType.StoredProcedure;

cmdLoad.Parameters.Add(new SqlParameter("@AccountID", currentUser));
cmdLoad.Parameters.Add(new SqlParameter("@PeriodID", " "));
cmdLoad.Parameters.Add(new SqlParameter("@PriceID", " "));
cmdLoad.Parameters.Add(new SqlParameter("@ExpenseID", " "));
cmdLoad.Parameters.Add(new SqlParameter("@InventoryID", " "));
cmdLoad.Parameters.Add(new SqlParameter("@ProductInID", " "));
cmdLoad.Parameters.Add(new SqlParameter("@ProductOutID", " "));
cmdLoad.Parameters.Add(new SqlParameter("@PeriodMonth", periodMonth.Trim().ToUpper()));
cmdLoad.Parameters.Add(new SqlParameter("@PeriodYear", periodYear));

SqlDataReader read = cmdLoad.ExecuteReader();

DataSet ds = new DataSet();
DataTable dt = new DataTable("Results");
ds.Tables.Add(dt);
ds.Load(read, LoadOption.PreserveChanges, ds.Tables[0]);


CrystalReport1 crystal = new CrystalReport1();
crystal.SetDataSource(ds);
crystalReportViewer1.ReportSource = crystal;

connSearch.Close();
connSearch.Dispose();

However, there seems to be something wrong here since it always produce an exception saying that the report has no tables pointing to the crystal.SetDataSource(ds); line.

Anybody help me please? 🙂

  • 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-16T02:20:36+00:00Added an answer on May 16, 2026 at 2:20 am

    Crystal Reports is a very capable tool and widely used in offices around the world.
    You are definitely doing yourself a favor getting familiar with it… and when you are, it is actually quite easy to use. 🙂

    CrystalReportViewer will generate a user friendly interface and give you the ability to export your reports into all commonly used format.

    To answer your question:

    .Net only gives you the ability to build and view reports just as you would in a Crystal Report Client except that you can do it via the codebehind.

    If I were you I would read through the white papers and familiarize myself with reporting first a little.

    I think in your case the error might be referring to that, although you have assigned a dataset as datasource to your report there might be no table in the dataset or you haven’t selected any fields to show in the report.

    Try to debug the dataset before you bind it to the report and check whether the table is present.

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

Sidebar

Related Questions

I have a C++/CLI based install application which needs to close another app I've
I have a VB.NET application which needs to generate reports (invoices) which contains optional
I have application which needs to use a dll (also written by me) which
I have an application which needs to loop through all the lines in text
I have a Qt application which needs to be able to send faxes. I'm
I have a web application which needs to perform a file copy operation and
I have a java application which needs to read and write files to HDFS.
I have created an application which needs to have a profile box tab which
I have an application in VC++ which needs to execute a function provided to
I have a UITabBar + UINavigationController application which often needs data from the internet.

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.