Click here to Skip to main content
16,020,377 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all,

I want to create reports in a for loop:
for (int j = 0; j < dt.Rows.Count; j++)
{
  ds.WriteXml(Application.StartupPath + @"\reports\\aa.xml", XmlWriteMode.WriteSchema);
  reportViewer reportViewerF = new reportViewer(Application.StartupPath + @"\reports\Kied_Yawmia.rpt");
  reportViewerF.show(this.MdiParent);
}


The problem is that all reports were the same with the the final xml file.

Thanks in advance.
Posted
Updated 22-Nov-10 2:32am
v4
Comments
Sunasara Imdadhusen 22-Nov-10 8:01am    
Not clear!!
Sandeep Mewara 22-Nov-10 8:11am    
Not clear. What was the issue? For all the reports you are using same XML and so you got it, now what?
Sunasara Imdadhusen 22-Nov-10 8:17am    
Do you want to create a xml file based on value in dt??
marjavic 22-Nov-10 9:03am    
ds.WriteXml(Application.StartupPath + @"\reports\\aa.xml", XmlWriteMode.WriteSchema);

the ds has a new dt in evry loop it's not the same value in evry time. But when the reports are shown it was the same with the last ds value, its like reading the xml file before running the show of the report
thatraja 22-Nov-10 9:11am    
Confusing question, explain your question completely

1 solution

flush your objects at the end of the loop
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900