Current filter:
                                You should refresh the page.
                                  • Hi guys,

                                    I created an UserControl with ReportDesigner and I opened a report already created in ActiveDocument but I need to import a layout saved in a file into that open report in ActiveDocument. I'm doing in WPF MVVM  and I'm using ReportStorage. The idea is to modify the existing layout to the new one that was imported, all in the same ActiveDocument.
                                    Can you help me with this?

                                • Vasily (DevExpress Support) 08.01.2019

                                  Hi Tiago,
                                  Your requirement is not completely clear to me. Do I understand that you have some report opened in the Report Designer, and when some button is clicked on your form you wish to replace this opened report with a report loaded from a file? Should the newly loaded report have a different name? Or it should be saved under the name of the initial report that was opened in this tab?

                                • Tiago Salvador 08.01.2019

                                  Yes, I have a report open in design mode and I have another report also in design saved to a file and what I need is to load the layout stored in the file into the open report. The report will be the same as it was opened before, but what will change is the layout it had that will change to what was imported. This will happen when an import button is clicked.

                                • Elliot (DevExpress Support) 08.02.2019

                                  Hello Tiago,

                                  Thank you for your clarification. There is no straightforward way to accomplish this task using the XtraReports Suite. As an immediate workaround, you can use our internal ReportDesignerDocument.ReloadReport method to import a report in the End-User Report Designer.

                                  void ReloadReport(ReportDesignerDocument document, string path) { var reloadReportMethod = typeof(ReportDesignerDocument).GetMethod("ReloadReport", BindingFlags.Instance | BindingFlags.NonPublic); reloadReportMethod.Invoke(document, new object[] { new Action(() => document.Report.LoadLayout(path)) }); }

                                  Also, you can add a report to the Report Gallery to accomplish this task.


                                1 Solution

                                Creation Date Importance Sort by

                                Hello Tiago,

                                I'd like to let you know that the ReloadReport method will be marked public starting with v19.1.6, so you can use it without reflection as follows:

                                void ReloadReport(ReportDesignerDocument document, string path) { document.ReloadReport(new Action(() => document.Report.LoadLayout(path))); }

                                Thank you,