Ticket T152537
Visible to All Users

Report Export to RTF is not complete

created 10 years ago

Hello developers,

we are using the DevExpress Reporting Library. Exporting the reports into rtf are working well till we combine two reports to one. Then as PDF the report is complete, but as rtf there are missing almost the complete report.
I don't know what you need to find out the problem. For the beginning I send you the reports as PDF and RTF. Maybe you see what's going wrong.

Thanks for Help.

Thien Egi

Comments (2)
Vasily (DevExpress Support) 10 years ago

    Hi Thien,

    It is difficult to determine the exact cause of this issue without reproducing it. Send us you report creation and exporting code snippets. Alternatively, provide us with a simple working project that illustrates the issue in action. With a small example project, it is much easier for us to verify that the code that calls ours is valid, and that the way our controls are being used is recommended. This way, we can concentrate our resources on the problematic area:
    A request for simple example programs
    Your time and cooperation are greatly appreciated.

      Thanks for answering. Unfortunately I can't create a simple program of this problem. Maybe it helps if I explain what we are doing.
      We have a main report which can have more or less subreports which are created and added to the main report like that:
             protected DetailReportBand AddSubReport(XtraReport reportPart)
             {
                 DetailReportBand detailReport = new DetailReportBand();
                 DetailBand detail = new DetailBand();
                 XRSubreport subreport = new XRSubreport();
                 detailReport.Bands.AddRange(new Band[] { detail });
                 detailReport.Level = _nbSubReport;
                 detailReport.Name = "DetailReport" + (_nbSubReport);
                 detailReport.Padding = new DevExpress.XtraPrinting.PaddingInfo(0, 0, 0, 0, 100F);
                 detailReport.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopLeft;
                 detail.Controls.AddRange(new XRControl[] { subreport });
                 detail.HeightF = 23.00002F;
                 detail.Name = "Detail" + (_nbSubReport);
                 detail.Padding = new DevExpress.XtraPrinting.PaddingInfo(0, 0, 0, 0, 100F);
                 detail.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopLeft;
                 subreport.LocationFloat = new DevExpress.Utils.PointFloat(0F, 0F);
                 subreport.Name = "subreport" + (_nbSubReport++);
                 subreport.ReportSource = reportPart;
                 subreport.SizeF = new System.Drawing.SizeF(187.25F, 23.00002F);
                 _report.Bands.Add(detailReport);
                 return detailReport;
             }
      This works fine and looks OK in all export variants.
      Now we have a combiner, which combines two or more main reports to a huge report.
                 foreach (KeyValuePair<IReportData, string> keyValuePair in _reportDataList)
                 {
                     ReportPreview reportPreview = new ReportPreview(keyValuePair.Key, ~_filter);
                     reportPreview.CreateReport(true, keyValuePair.Value);
                     // Add all pages of the report to the end of the new report.
                     Pages.AddRange(reportPreview.Pages);
                 }
                 // Reset all page numbers in the resulting document.
                 PrintingSystem.ContinuousPageNumbering = true;
      _reportDataList is our data source for the reports.
      Now in the preview window and as PDF it looks fine, but as rtf, html, xls and image file there is only the combine report header without any main report which has been added by Pages.AddRange(reportPreview.Pages); This command is unique in our projects, so it's possible that there could be a problem inside it.
      Can you help me?
      Thank you for your time.
      Thien Egi

      Answers approved by DevExpress Support

      created 10 years ago

      Hi Thien,

      This behavior is caused by the fact that you are using the SingleFile export mode. This mode does not work with merged reports. To resolve this issue, set the XtraReport.ExportOptions.Rtf.ExportMode property to SingleFilePageByPage.
      Please try this and let me know the result.

        Comments (3)

          Hi Ingvar,
          thanks for your help. This solution with the export mode made the combined report with all pages. But there is now another problem: SingleFile mades tables which can be marked and deleted row by row. SingleFilePageByPage creates tables wich are text with some lines which can not be used as table.

            Another point is, that for XLS there are only the options SingleFile and DifferentFiles, which creates many files or one file where the reports are missed.
            I want to draw attention to the fact, that as pdf it works. And I would suggest, that the different table behaviour shouldn't be part of the ExportMode. Maybe there could be an own option for the table.
            Thanks for further help.
            Thien Egi

            Dmitry Tokmachev (DevExpress) 10 years ago

              Hello Thien,

              There are two RTF export modes: when the RtfExportMode.SingleFile mode is used, an RTF file is generated by using tables. If the RtfExportMode.SingleFilePageByPage mode is selected, an RTF file is generated by using frames. In older versions, we used tables to arrange RTF content. However, we encountered issues with layout precision and were unable to properly align content parts. After weighing all pros and cons, we decided to make our SingleFilePageByPage export mode use frames instead of tables. Alternatively, you can export each report using the SingleFile export mode and then combine all resulting RTF documents into a single one using our RichEditDocumentServer component (RichEditDocumentServer.Document.AppendDocumentContent method).

              The SingleFile option isn't available for XLS export because this format is not page-oriented, i.e., pages of the merged report can have different size and orientation, and it is impossible to export them correctly to a single file, whereas the PDF format allows creating such a document.

              Thanks,
              Dmitry

              Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

              Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.