Storing values into a 2-Dimensional Array

5 pts.
Tags:
2D arrays
Arrays
Crystal Reports
Database programming
Microsoft Access
Hello, Here I'm directly passing the crystal reports parameters through the code, and generating the report but for some obvious reason, I want the records to be stored first of all into a 2-dimensional array and from there writing it back onto Crystal reports. Note : The reason why I'm looking for 2-Dimensional array is that currently upon execution I'm getting a Crystal Report with repeated records and that too upto the no. of maximum records in table. To be more clear, lets say, that I have an access database with 30,000 records and whn I generate the crystal report I'm expecting all 30,000 records to be displayed row-by-row. But instead of that I'm getting the first record repeated 30,000 times..........NEED HELP........!!! The actual code before storing it in 2D-array is as given below: private void btnReport_Click(object sender, System.EventArgs e){ try { makeReport(report_file); for (int recordCount=0; recordCount <= myTable.Rows.Count; recordCount++) { SetParamValue("@parameter1", myTable.Rows[recordCount]["CLNT#">.ToString)); SetParamValue("@parameter2", myTable.Rows[recordCount]"CNAME">.ToString)); SetParamValue("@parameter3", myTable.Rows[recordCount]["CSEX">.ToString)); SetParamValue("@parameter4", myTable.Rows[recordCount]["CSS#">.ToString()); crystalReportViewer1.ReportSource = ReportDoc; } } catch (Exception ex) { MessageBox.Show(ex.Message, "EXCEPTION"); }} private void SetParamValue (string paramName, string paramValue){ for(int i=0; i<reportdoc.datadefinition.formulafields.count;> if(ReportDoc.DataDefinition.FormulaFields[i].FormulaName=="{" + paramName + "}") { ReportDoc.DataDefinition.FormulaFields[i].Text = """ +paramValue +"""; } crystalReportViewer1.ReportSource = ReportDoc; } private void makeReport(string ReportFile) { ReportDoc.Load(ReportFile); // where ReportFile is the path of report (@"c:/reports/..)}

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following