New Message on dotNET User Group Hyd

Crystal Report Dataset problem

Reply
  Reply to Sender   Recommend Message 1 in Discussion
From: rejijo

I am using a dataset (.xsd) as the datasource for my crystal report. I am populating my dayaset without using the database (i.e. I am using an array to populate the dataset). But when I am running my application, it is poping me the dialog to enter the database details. Donno why?

The following is theprocedure how I am going about:

1> Added a New DataSet Item namely SampleDataset.xsd
2> Added an Element from the toolbox and named it "PricingTable" and added columns to it Pric1, Pric2, Pric 3 .
3> Added a report namely "SampleCrystalReport.rpt" and added the datasource from the DatabaseExpert -- ProjectData > ADO.NET DataSet > SampleDataSet > PricingTable and added it to Selected Tables and grouped on Pric3. Then designed the Crystal REport

4> In the Form1 OnLoad, wrote the following code:

try
   {
    string[,] arrTotData = new string[,]{
             {"101","101","101"},
             {"101","102","102"},
             {"101","103","103"},
             {"101","104","104"}
             };

    SampleDataset dSet = new SampleDataset();
    
    int iNumOfPlans = 3;

    string[] arrData = new string[arrTotData.Length/4];
    for(int iCtr = 0 ; iCtr < iNumOfPlans; iCtr++)
    {
     for(int i = 0 ; i<arrTotData.Length/4; i++)
     {
      arrData[i] = arrTotData[iCtr,i].ToString();
     }
     dSet.Tables[0].Rows.Add(arrData);
    }

    if(dSet.Tables[0].Rows.Count < 1)
    {
     MessageBox.Show("No Data found in the dataset");
    }
    else
    {
     SampleCrystalReport cReportdSet = new SampleCrystalReport();
     //MessageBox.Show(""+cReportdSet.DataDefinition.GroupNameFields.ToString());
     crystalReportViewer1.ReportSource = cReportdSet;
     crystalReportViewer1.Visible = true;
    }
   }
   catch(Exception ex)
   {
    MessageBox.Show("ERROR : "+ex.Message);
   }

Please Help. Please let me know where I am going wrong.


View other groups in this category.

Click Here!
Also on MSN:
Start Chatting | Listen to Music | House & Home | Try Online Dating | Daily Horoscopes

To stop getting this e-mail, or change how often it arrives, go to your E-mail Settings.

Need help? If you've forgotten your password, please go to Passport Member Services.
For other questions or feedback, go to our Contact Us page.

If you do not want to receive future e-mail from this MSN group, or if you received this message by mistake, please click the "Remove" link below. On the pre-addressed e-mail message that opens, simply click "Send". Your e-mail address will be deleted from this group's mailing list.
Remove my e-mail address from dotNET User Group Hyd.

Reply via email to