Current filter:
                                You should refresh the page.
                                Support Center
                                  • Hi, I have implemented an action which of the selected report export to the file and then send it as the email attachment in my XAF win application.
                                    It works correctly, but when selected report contains the script, error occurs during export:

                                    There are following errors in script(s):
                                    line 1, column 109: error CS1001: Identifier expected
                                    line 1, column 110: error CS1002: ; expected
                                    line 1, column 111: error CS1519: Invalid token '-' in class, struct, or interface member declaration
                                    line 1, column 120: error CS1519: Invalid token ';' in class, struct, or interface member declaration

                                    Stack Trace:
                                    v DevExpress.XtraReports.UI.XtraReport.CreateDocument(Single progressRange, Boolean buildPagesInBackground, Boolean suppressClearDataContext)
                                    v DevExpress.XtraReports.UI.XtraReport.CreateDocument(Single progressRange, Boolean buildPagesInBackground)
                                    v DevExpress.XtraReports.UI.XtraReport.CreateIfEmpty(Single progressRange, Boolean buildPagesInBackground)
                                    v DevExpress.XtraReports.UI.XtraReport.CreateIfEmpty(Single progressRange)
                                    v DevExpress.XtraReports.UI.XtraReport.ExportToHtml(Stream stream, HtmlExportOptions options)
                                    v DevExpress.XtraReports.UI.XtraReport.ExportToHtml(Stream stream)

                                    When I use to export a standard export action in application, so it works.
                                    My code load and export report:

                                    XtraReport xtraReport = new XtraReport(); using (MemoryStream memoryStream = new MemoryStream(myContentFromReport)) { xtraReport.LoadLayout(memoryStream); } if (parameters != null && parameters.Length > 0) { foreach (var paramater in parameters) { xtraReport.Parameters[paramater.Key].Value = paramater.Value; } } XPCollection xpCollection = new XPCollection(XpoSession, myDataType); xpCollection.Criteria = CriteriaOperator.Parse(xtraReport.FilterString, parameters); xtraReport.DataSource = xpCollection; using (MemoryStream reportMemoryStream = new MemoryStream()) { xtraReport.ExportToPdf(reportMemoryStream); //error reportMemoryStream.Seek(0, System.IO.SeekOrigin.Begin); }
                                    Am I doing something wrong?

                                • Hi Martin.

                                  I am afraid the information you provided is insufficient to diagnose this issue. These errors seem to be specific to the report layout you loaded. It is also unclear where you are getting myContentFromReport from and how it was produced. If the layout was obtained from XafReport, then you need to create an XafReport instance (via the IReportData.LoadReport method, for example). Would you please provide us with a small sample project reproducing the issue? We will research it, and do our best to find a solution.

                                You must  log in  or  register  to leave comments

                                If you need additional product information, write to us at or call us at +1 (818) 844-3383

                                FOLLOW US

                                DevExpress engineers feature-complete Presentation Controls, IDE Productivity Tools, Business Application Frameworks, and Reporting Systems for Visual Studio, along with high-performance HTML JS Mobile Frameworks for developers targeting iOS, Android and Windows Phone. Whether using WPF, Silverlight, ASP.NET, WinForms, HTML5 or Windows 8, DevExpress tools help you build and deliver your best in the shortest time possible.

                                Copyright © 1998-2014 Developer Express Inc.
                                All trademarks or registered trademarks are property of their respective owners