-----------------------------------------------------------
New Message on BDOTNET
-----------------------------------------------------------
From: rejijo
Message 1 in Discussion
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 Database Login
dialog to enter the database details and not displaying the report. 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","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. Please let me know where I am going wrong.
-----------------------------------------------------------
To stop getting this e-mail, or change how often it arrives, go to your E-mail
Settings.
http://groups.msn.com/bdotnet/_emailsettings.msnw
Need help? If you've forgotten your password, please go to Passport Member Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help
For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact
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.
mailto:[EMAIL PROTECTED]