soonhuat81

soonhuat81

  • NA
  • 31
  • 0

Can only preview the latest customized report..What's wrong?

Jun 9 2004 12:18 AM
I have 2 button on form1 named "CustomizedReport" and "LoadReport" Button respectively. At first, I click at "CustomizedReport" button to customize a report(report1) and save it to C:\report1.repx. Then i click at "LoadReport" button to load and preview the report1.repx and it's work fine. After that i click at "CustomizedReport" button again to design report2.repx and again save it to C:\report2.repx. After that i click at "LoadReport" button to load report2.repx and again it works fine here. But when i try to load the report1.repx(first customized report) error message prompt out as following: "An unhandled exception of type 'DevExpress.XtraReports.Serialization.XRSerialization' occured in devexpress.xtrareports.dll Addtional information: An error occurred during deserialization - possible wrong report class name" The following is the code for "CustomizedReport" button and "LoadReport" button. private void buttonCustomizedReport_Click(object sender, System.EventArgs e) { XtraReport1 rpt = new XtraReport1(); rpt.RunDesigner(); } private void buttonLoadReport_Click(object sender, System.EventArgs e) { OpenFileDialog openFileDialog1 = new OpenFileDialog(); openFileDialog1.InitialDirectory = "c:\\" ; openFileDialog1.Filter = "repx files (*.repx)|*.repx"; openFileDialog1.FilterIndex = 2 ; openFileDialog1.RestoreDirectory = true ; if(openFileDialog1.ShowDialog() == DialogResult.OK) { XtraReport1 rep = new XtraReport1(); rep.LoadState(openFileDialog1.FileName); rep.SetDataSource(this.getDataSource); rep.ShowPreview(); } } Hope someone can help me as this is quite an important part of the program thanks.

Answers (1)