7 Answers, 1 is accepted
The behavior you observe is by design. Font size, font face, decoration, and font style are the only formatting options that are supported on individual text within an Excel cell. This information is available in the Design Considerations for Excel Rendering help article.
All the best,
Steve
the Telerik team
HAPPY WITH TELERIK REPORTING? Do you feel that it is fantastic? Or easy to use? Or better than Crystal Reports? Tell the world, and help fellow developers! Write a short review about Telerik Reporting and Telerik Report Designer in Visual Studio Gallery today!
Was this the intended result or a limitation of the OpenXML assembly?
TextAlignment works although it is not listed within the link you provided.
Is CellPadding Or Indent planned for a future release?
Thanks
The alignments (both vertical and horizontal/text) are respected in Excel and I would update the article to reflect this.
As for cell padding - the Excel format itself does not support padding. Our TextBox item does not have indent, so this option is not supported as well and it only makes sense for the MS formats.
If by "manually padding with spaces" you refer to white spaces, then this is preserved, however you should use the old binary Excel format (.xls) as it is currently missing from the OpenXML one (.xlsx).
I've updated your Telerik points for bringing those matters to our attention.
Kind regards,
Steve
the Telerik team
HAPPY WITH REPORTING? Do you feel that it is fantastic? Or easy to use? Or better than Crystal Reports? Tell the world, and help fellow developers! Write a short review about Telerik Reporting and Telerik Report Designer in Visual Studio Gallery today!
if (textAlign == Left)
{
double pixels = textbox.Style.Padding.Left.ToPixels(); // whatever you use to calculate size
int indent = pixelsToIndent(pixels);
if (indent > 0)
WriteExcellIndent(indent);
}
// Same logic for TextAlign Right
I doe the same in an extension method I've made to translate SpacesToPadding because the storedprocedure returns spaces to manually pad which do not render correctly in the Html ReportViewer.
if (.xls) supports manual padding (spaces) and the (.xlsx) does not is this a limitation of OpenXML or a limitation of your extensions.
While it might seem that padding and indent are the same thing, they are not and it would not be correct to translate padding to indent (what about the top and bottom padding?) The most appropriate thing to do is consider including Indent property for the TextBox item, which is what we're gonna do. I would log this as a feature request and if there is enough interest about it, we would consider it for future versions of the product.
About the white space, both the binary and OpenXML formats support it, and the problem is within our OpenXML rendering extension itself. I've already logged this for investigation and fixing.
Regards,
Steve
the Telerik team
HAPPY WITH REPORTING? Do you feel that it is fantastic? Or easy to use? Or better than Crystal Reports? Tell the world, and help fellow developers! Write a short review about Telerik Reporting and Telerik Report Designer in Visual Studio Gallery today!
Cell padding and empty text was just a means to an end but this is a cleaner solution.
Thanks for the outstanding support.