Click here to Skip to main content
15,895,781 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello Experts,

I am using a crystal report to show a sale bill.i have created a Dataset.xsd file too. and my code is as follows:-
The problem i am facing is i am not able to display any dataset fields on crystal report.
.when i add fresh new crystal report and dataset to my project and drag some fields from dataset table on to report, the first time i drag some fields from a table say Table-OA onto report and run the project i can see those fields.But after that when i try to drag more fields from other tables and design the report i cannot see any data on report,not even the fields that were displayed when the first time we run the report.I am not able to understand what is the problem?why the data is not getting displayed.

Please Help me out .I am stuck from last few days on the same issue.Does copying datatables from one dataset.xsd to another causes this problem

Thanks i advance.

What I have tried:

code tried is as follows:-

C#
demoreport objrpt = new demoreport();
    demoRpt ds = new demoRpt();

C#
string query = OA + AD + VAT + OC + RD + INV + RD1 + OI + Status + Config;
             
              DataSet ds = new DataSet();
              ds = u.SelectQuerySet(query);

C#
ds.Tables[0].TableName = "OA";
              ds.Tables[1].TableName = "AD";
              ds.Tables[2].TableName = "VAT";
              ds.Tables[3].TableName = "OC";
              ds.Tables[4].TableName = "RD";
            
              ds.Tables[5].TableName = "INV";
              ds.Tables[6].TableName = "RD1";
              ds.Tables[7].TableName = "OI";
              ds.Tables[8].TableName = "Status";
              ds.Tables[9].TableName = "Config";


C#
if (ds.Tables[0].Rows.Count > 0)
               {
                   objrpt.SetDataSource(ds);
                   crystalReportViewer1.RefreshReport();
                   crystalReportViewer1.ReportSource = objrpt;
                   crystalReportViewer1.Refresh();

               }
               else
               {
                   MessageBox.Show("No Data Available");
               }
Posted
Updated 22-Feb-16 23:12pm
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900