Won't Fix
Last Updated: 09 Oct 2025 14:27 by ADMIN
Scheduled for 2025 Q4
Daryl
Created on: 04 Jun 2025 12:57
Category: Reporting
Type: Bug Report
0
Truncated text in rendered reports when Spire.Office is used with Reporting

I am rendering reports locally using the report processor. When I use the RenderReport method after processing MS Office Documents and PDF files with the Spire. Office, it causes the text of the report rendered with Telerik Reporting to get truncated:

using Telerik.Reporting;

Spire.Doc.Document document = new Spire.Doc.Document();

var wordDocPath = "./wordtest.docx";
var pdfFilePath = System.IO.Path.Combine("../../../", "wordtest.pdf");

document.LoadFromFile(wordDocPath);

Spire.Doc.ToPdfParameterList toPdf = new Spire.Doc.ToPdfParameterList();
//toPdf.AutoFitTableLayout = true;
document.SaveToFile(pdfFilePath, toPdf);
document.Close();

var reportProcessor = new Telerik.Reporting.Processing.ReportProcessor();
var reportPackager = new ReportPackager();

string sourceReportFile = "./Static Broken CSU Analysis.trdp"; ;

using (var sourceStream = System.IO.File.OpenRead(sourceReportFile))
{
    var report = (Report)reportPackager.UnpackageDocument(sourceStream);

    var deviceInfo = new System.Collections.Hashtable();

    var reportSource = new InstanceReportSource();

    reportSource.ReportDocument = report;

    Telerik.Reporting.Processing.RenderingResult result = reportProcessor.RenderReport("PDF", reportSource, deviceInfo);


    if (!result.HasErrors)
    {
        string fileName = result.DocumentName + "." + result.Extension;
        string filePath = System.IO.Path.Combine("../../../", fileName);

        using (System.IO.FileStream fs = new System.IO.FileStream(filePath, System.IO.FileMode.Create))
        {
            fs.Write(result.DocumentBytes, 0, result.DocumentBytes.Length);
        }
    }
}

If I comment out the section that is converting the totally unrelated word file to pdf and run it again, it does not clip.

1 comment
ADMIN
Petar
Posted on: 09 Oct 2025 14:12

Hello everyone,

We investigated the issue and discovered that it stems from `Spire.Office` adding an extra `MeasureTrailingSpaces` flag after performing processing operations. This flag causes incorrect text measurement in Telerik Reporting's GDI wrapper, leading to text being truncated.

To resolve this issue, you can either remove the extra flag after performing operations with Spire.Office or use newer versions of Spire.Office that do not rely on GDI+. I have also created a knowledge base article on this topic for future reference:

Since this is due to a side effect introduced by a 3-rd party library, I am marking this feedback item as "Won't Fix".

Regards,
Petar
Progress Telerik

Your perspective matters! Join other professionals in the State of Designer-Developer Collaboration 2025: Workflows, Trends and AI survey to share how AI and new workflows are impacting collaboration, and be among the first to see the key findings.
Start the 2025 Survey