0

I recently upgraded my .Net Framework XAF Winforms application.Net8 with 24.1.3

As follows

   public static void DoPrintReport(DevExpress.ExpressApp.View view, IReportDataV2 reportData, ReportsModuleV2 reportsModule)
   {
       //var report = ReportDataProvider.ReportsStorage.LoadReport(reportData);
       // IReportStorage reportStorage = ReportDataProvider.GetReportStorage(Application.ServiceProvider);
       // https://supportcenter.devexpress.com/ticket/details/bc4930/web-reporting-deserialization-from-the-codedom-format-has-been-disabled

       // changed to
       IReportStorage reportStorage = ReportDataProvider.GetReportStorage(null);
       var report = reportStorage.LoadReport(reportData); // gives error 

When this runs I get

Deserialization from CodeDOM format is not supported in .NET Core applications.

   at DevExpress.XtraReports.UI.XtraReport.LoadLayoutInternal(Stream stream, XtraReport& compiled report, Boolean forceDataSource, AccessSettings accessSettings, Boolean ignoreFileExtensionValidation, Func`1 trustPrompt)
   at DevExpress.XtraReports.UI.XtraReport.LoadLayoutInternal(Stream stream, Boolean ignoreFileExtensionValidation, Func`1 trustPrompt)
   at DevExpress.XtraReports.UI.XtraReport.LoadLayout(Stream stream)
   at DevExpress.ExpressApp.ReportsV2.ReportStorageBase.LoadReportCore(IReportDataV2 reportData, XtraReport report)
   at DevExpress.ExpressApp.ReportsV2.ReportStorageBase.LoadReport(IReportDataV2 reportData)
   at SBD24.JT.Win.Functions.WinHandyReportFunctions.DoPrintReport(View view, IReportDataV2 reportData, ReportsModuleV2 reportsModule) in C:\Users\kirst\source\repos\SBD24.JT\SBD24.JT.Win\Functions\WinHandyReportFunctions.cs:line 20

The report is stored in the ReportDataV2 table

From this help I understand I need to convert the content field of the report record to XML format.

I am wondering how. Or whether there is some kind of flag to make it work since I am running in Winforms.

Update

Researching writing a framework application to do the conversions. That is proving hard since the latest xaf wizards dont support Entity Framework with .Net Framework

Update

I tried reinstalling XAF 20.2.3 but VS2022 is not a supported IDE

1 Answer 1

1

Try this, I'm using v.22.*

try
 {
     xtraOpenFileDialog1.Filter = "repx files (*.repx)|*.repx";

     var dr = xtraOpenFileDialog1.ShowDialog();

     if (dr == DialogResult.OK)
     {
         XtraReport report = new XtraReport();
         report.LoadLayout(xtraOpenFileDialog1.FileName);
         report.SaveLayoutToXml(xtraOpenFileDialog1.FileName);

         MessageBox.Show($"File '{xtraOpenFileDialog1.SafeFileName}' coverted to XML format");
     }
 }
 catch (Exception ex)
 {
     MessageBox.Show($"File '{xtraOpenFileDialog1.SafeFileName}' failed to covert to XML format");
 }
Sign up to request clarification or add additional context in comments.

2 Comments

Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.
Thanks. I think I actually wound up exporting and importing via the UI

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.