Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

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

Status
Not open for further replies.

beginner81

Programmer
Oct 27, 2003
44
MY
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.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top