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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T01:28:16+00:00 2026-05-23T01:28:16+00:00

i have an app which has btn to preview report made in crystal report.

  • 0

i have an app which has btn to preview report made in crystal report. I added Dataset as datasource of the report and dragged datatable from the toolbox and added the fields I need as columns. I got the instruction from this link http://aspalliance.com/2049_Use_LINQ_to_Retrieve_Data_for_Your_Crystal_Reports.2. This is my 2nd report the first one works and did not encounter any prob at all that is why i am confused, not to mention it also has nullable column. the error says: DataSet does not support System.Nullable<>.

  private void ShowReportView()
    {

        string reportFile = "JudgeInfoFMReport.rpt";
        ObservableCollection<tblJudgeFileMaint> judgeFileMaintList;

        judgeFileMaintList = GenerateReport();

        if (judgeFileMaintList.Count > 0)
        {
            CrystalReportViewerUC crview2 = new CrystalReportViewerUC();
            crview2.SetReportPathFile(reportFile, judgeFileMaintList);
            crview2.ShowDialog();
        }
        else
        {
            System.Windows.MessageBox.Show("No record found.", module, MessageBoxButton.OK, MessageBoxImage.Information);
        }
    }

private ObservableCollection<tblJudgeFileMaint> GenerateReport()
    {
        var result = FileMaintenanceBusiness.Instance.GetAllJudgeInfoList();
        return new ObservableCollection<tblJudgeFileMaint>(result);
    }

The error is in the part where I set datasource report.SetDataSource

 public bool SetReportPathFile(string reportPathFile, IEnumerable enumerable)
    {

            string reportFolder = @"\CrystalReportViewer\Reports\";
            string filename = System.Windows.Forms.Application.StartupPath + reportFolder + reportPathFile;  // "\\Reports\\CrystalReports\\DateWiseEmployeeInfoReport.rpt";
            ReportPathFile = filename;
            report.Load(ReportPathFile);
            report.SetDataSource(enumerable);
            report.SetDatabaseLogon("sa", "admin007");
            bRet = true;
       }

        _IsLoaded = bRet;

        return bRet;
    }

I read some answers and says I should set the null value to DBNUll which I did in the properties window of each column if it is nullable. Can anyone help me please? thanks

  • 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-23T01:28:16+00:00Added an answer on May 23, 2026 at 1:28 am

    figured it out. by using a collectionextention, copied somewhere, I forgot the link. Os to whoever it is who made the class, credits to you.

    class method looks like this.

    public statis class CollectionExtension {
          public static DataSet ToDataSet<T>(this IEnumerable<T> collection, string dataTableName)
        {
            if (collection == null)
            {
                throw new ArgumentNullException("collection");
            }
    
            if (string.IsNullOrEmpty(dataTableName))
            {
                throw new ArgumentNullException("dataTableName");
            }
    
            DataSet data = new DataSet("NewDataSet");
            data.Tables.Add(FillDataTable(dataTableName, collection));
            return data;
        }
     }
    

    then you can use it by doing this in getting your source to your report:

     private DataSet GenerateNeutralContEducReport(string dsName)
        {
            var contEduHistoryList = FileMaintenanceBusiness.Instance.GetManyNeutralFMContEducHistoryInfobyKeyword(CurrentNeutralFM.NeutralID, "NeutralID").ToList();
           return CollectionExtensions.ToDataSet<tblContinuingEducationHistory>(contEduHistoryList, dsName);
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a .net winforms app which has a few animation effects, fade ins
I have an view in my App which has a number of buttons based
I have a user profile page on my web app which has contact information.
I have an app, which has a top navigation bar and a bottom tab
I have an app which is quite huge. It has tons of images and
I have a GUI app written in C++/CLI which has a load of configurable
I have a tableView which has cells with phone numbers. The app is not
I have set up a UITableView-based app, which has a .plist for holding the
I have an MDI WinForms app in which the MDI parent form has a
I have an app which could benefit from the user being able to choose

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.