Click here to Skip to main content
15,922,325 members
Home / Discussions / C#
   

C#

 
GeneralRe: XML writing problem ? Pin
leppie14-Jul-08 22:26
leppie14-Jul-08 22:26 
GeneralRe: XML writing problem ? Pin
Mohammad Dayyan15-Jul-08 10:03
Mohammad Dayyan15-Jul-08 10:03 
GeneralRe: XML writing problem ? Pin
DaveyM6914-Jul-08 23:15
professionalDaveyM6914-Jul-08 23:15 
GeneralRe: XML writing problem ? Pin
blackjack215015-Jul-08 0:28
blackjack215015-Jul-08 0:28 
AnswerRe: XML writing problem ? Pin
blackjack215014-Jul-08 20:59
blackjack215014-Jul-08 20:59 
GeneralRe: XML writing problem ? Pin
Mohammad Dayyan15-Jul-08 10:09
Mohammad Dayyan15-Jul-08 10:09 
Questiondata between form & usercontrol Pin
nelsonpaixao14-Jul-08 12:58
nelsonpaixao14-Jul-08 12:58 
QuestionUnable to create a 2-Dimensional Array for Database Records............... Pin
Reality Strikes14-Jul-08 10:23
Reality Strikes14-Jul-08 10:23 
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.

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;  i++)
      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/..)
} 


Note : The reason why I'm looking for 2D 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, I'm getting the first record printed 30,000 times. NEED HELP........!!!
AnswerRe: Unable to create a 2-Dimensional Array for Database Records............... Pin
led mike14-Jul-08 10:43
led mike14-Jul-08 10:43 
GeneralRe: Unable to create a 2-Dimensional Array for Database Records............... Pin
Reality Strikes14-Jul-08 10:56
Reality Strikes14-Jul-08 10:56 
GeneralRe: Unable to create a 2-Dimensional Array for Database Records............... Pin
Reality Strikes14-Jul-08 10:59
Reality Strikes14-Jul-08 10:59 
GeneralRe: Unable to create a 2-Dimensional Array for Database Records............... Pin
led mike14-Jul-08 11:09
led mike14-Jul-08 11:09 
GeneralRe: Unable to create a 2-Dimensional Array for Database Records............... Pin
Reality Strikes15-Jul-08 3:20
Reality Strikes15-Jul-08 3:20 
GeneralRe: Unable to create a 2-Dimensional Array for Database Records............... Pin
led mike15-Jul-08 5:36
led mike15-Jul-08 5:36 
QuestionDragable rectangles Pin
Casper Hansen14-Jul-08 9:22
Casper Hansen14-Jul-08 9:22 
AnswerRe: Dragable rectangles Pin
C1AllenS14-Jul-08 9:50
C1AllenS14-Jul-08 9:50 
GeneralRe: Dragable rectangles Pin
Luc Pattyn14-Jul-08 10:14
sitebuilderLuc Pattyn14-Jul-08 10:14 
AnswerRe: Dragable rectangles Pin
Casper Hansen15-Jul-08 2:58
Casper Hansen15-Jul-08 2:58 
QuestionHelp needed Pin
SHINOJK14-Jul-08 8:23
SHINOJK14-Jul-08 8:23 
QuestionSame Random Numbers Pin
humayunlalzad14-Jul-08 5:27
humayunlalzad14-Jul-08 5:27 
AnswerRe: Same Random Numbers Pin
DaveyM6914-Jul-08 5:34
professionalDaveyM6914-Jul-08 5:34 
GeneralRe: Same Random Numbers Pin
humayunlalzad14-Jul-08 5:36
humayunlalzad14-Jul-08 5:36 
GeneralRe: Same Random Numbers Pin
leppie14-Jul-08 5:38
leppie14-Jul-08 5:38 
GeneralRe: Same Random Numbers Pin
humayunlalzad14-Jul-08 5:52
humayunlalzad14-Jul-08 5:52 
GeneralRe: Same Random Numbers Pin
leppie14-Jul-08 5:54
leppie14-Jul-08 5:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.