Report Design
 Crystal Reports Forum : Crystal Reports for Visual Studio 2005 and Newer : Report Design
Message Icon Topic: Storing values into a 2-Dimensional Array Post Reply Post New Topic
Author Message
mexicangreen
Newbie
Newbie


Joined: 07 Jul 2008
Location: United States
Online Status: Offline
Posts: 3
Quote mexicangreen Replybullet Topic: Storing values into a 2-Dimensional Array
    Posted: 16 Jul 2008 at 11:52am
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.FormulaName=="{" + paramName + "}")
{
ReportDoc.DataDefinition.FormulaFields.Text = "\"" +paramValue +"\"";
}
crystalReportViewer1.ReportSource = ReportDoc;
}


private void makeReport(string ReportFile) 
{
ReportDoc.Load(ReportFile); // where ReportFile is the path of report (@"c:/reports/..)
}


Edited by mexicangreen - 16 Jul 2008 at 12:19pm
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.016 seconds.