Hello,
I would like to export my RadGridView to Pdf using the PrintPreviewControl and RadSpreadsheet. To create the workbook I use the ExportToWorkbook method like so:
book = grid.ExportToWorkbook(
new
GridViewDocumentExportOptions()
{
ShowColumnFooters = grid.ShowColumnFooters,
ShowColumnHeaders = grid.ShowColumnHeaders,
ShowGroupFooters = grid.ShowGroupFooters,
AutoFitColumnsWidth =
true
,
ExportDefaultStyles =
true
});
and I style the cells like this:
CellStyle normalStyle = book.Styles[
"Normal"
];
normalStyle.BottomBorder = cellBorder;
normalStyle.IsWrapped =
true
;
normalStyle.RightBorder = cellBorder;
foreach
(Worksheet worksheet
in
book.Worksheets)
{
CellRange used = worksheet.UsedCellRange;
worksheet.Cells[1, used.FromIndex.ColumnIndex, used.ToIndex.RowIndex,
used.ToIndex.ColumnIndex].SetStyleName(
"Normal"
);
}
This works fine until I have columns with very long text (with whitespaces) that won't fit on one line (neither portrait nor landscape orientation). I tried to use text wrapping on the cell style by setting the IsWrapped property to true, but this does not yield the desired result. Also "AutoFitColumnsWidth = true" does not seem to effect my columns either.
I also witnessed a strange behaviour concerning columns that are at the end of my GridView where I have to scroll to see them on screen.
When I show the PreviewControl before I scrolled to those columns, I get a different output than when I previously scrolled to those columns.
For better understanding, I attach three pictures of the results I get.
Any help would be appreciated.
Best regards
7 Answers, 1 is accepted
Currently I cannot relate this behavior to a known issue of RadGridView for WPF, or Telerik Document Processing. Would it be possible for you to send us a sample project that we can use to reproduce the problem on our side?
Regards,
Ivan Ivanov
Progress Telerik
In HTML viewer the wrapping is incorrectly too.
I use html viewer and engine for export to PDF under version 12.1.18.620.
In viewer running under SilverL: Q1 2013 SP1, the wrapping works perfectly.
Do you have any solution for that?
(see attached files)
Jola Krawczyk
Hello Jola,
The question is related to Telerik Reporting.
Please, consider opening a new thread in the Reporting Forum. It will be very helpful if you sent us a runnable project that demonstrates the issue for local investigation.
Is the issue reproducible with our newer versions?
Regards,
Todor
Progress Telerik
Our thoughts here at Progress are with those affected by the outbreak.
This issue with rendering is independent of report construction.
Try just put my text (viewed in the examples) into simple textBox, you will have same effect.
The rendering in HTML viewer and PDF export works wrong in that version.
You can test it and if you see this bug and than change in newer version, please, just send me an info.
Jola K.
Hello Jola,
I managed to reproduce the issue in the PDF export. The Html5 Viewer displayed the same report correctly. I tested with R2 2020 and with R2 2018 you have specified. The results were the same in both versions.
I have logged the issue on your behalf in our public feedback portal - The wrapping in PDF rendering is not correct. We have updated also your Telerik points as a token of gratitude.
Regards,
Todor
Progress Telerik
Our thoughts here at Progress are with those affected by the outbreak.
By the way, as I recently wrote, SL viewer work corretly...
But: In viewer running under SilverL: Q1 2013 SP1
there is a problem with vertical rendering (but only in this viewer, in last reported html viewer and pdf export it works fine).
Issue: In your rendered text - multiline text, you have last line empty.
Then, the first line will be cut at the top. Removing the empty line - rendering is correct.
Maybe soon SL viewer will not be used commonly, but you could test it just for an info for you.
(I workarrounded it just with .trim() function just for my case).
Jola
Hi Jola,
Thank you for sharing this observation. The report is displayed in the Silverlight Report Viewer in XAML (for physical paging) or XAMLInteractive (Interactive mode) format - see Rendering Extensions. The formats are specific for the Silverlight viewer.
I tested to display a multiline text with one or two empty lines at the end in a TextBox in our latest Silverlight demo. The issue was not reproduced, so I assume it is related to the older version that you use. You may try to upgrade the Reporting tool to see whether this will fix the issue.
Regards,
Todor
Progress Telerik
Our thoughts here at Progress are with those affected by the outbreak.