New Message on dotNET User Group Hyd

Problem : Crystal Report using DataSet

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

I need to populate a crystal report with an XSD file without getting connected to any database. ie I populated the my dataset ie the xsd file that I creared with data using arrays and when I use this dataset and populate my report , it is prompting with a dialog to enter the database Login details. Donno why??
 
The following are the steps that I followed:
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","Test Account 1","12/12/2004","01 / Opttion","01 Plan 1"},
             {"101","Test Account 1","12/12/2004","01 / Opttion","01 Plan 2"},
             {"101","Test Account 1","12/12/2004","01 / Opttion","01 Plan 3"},
             {"101","Test Account 1","12/12/2004","01 / Opttion","01 Plan 4"}
             };
    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
 

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