This is a migrated thread and some comments may be shown as answers.

Indent cell in Excel report

7 Answers 69 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Robert
Top achievements
Rank 1
Robert asked on 12 Oct 2012, 06:17 PM
I have a Telerik report that I'm exporting to Excel. My TextBox has a padding-left set, and in the designer it looks good (the text in the TextBox is indented). But when I export the report to Excel, the indenting goes away. How can I get the Excel report to indent the text in the cell?

7 Answers, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 16 Oct 2012, 08:14 AM
Hello Robert,

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!

0
Steven
Top achievements
Rank 1
answered on 30 Jan 2013, 07:06 PM
The Excel Render also TRIMS the Field which eliminates manually padding with spaces.

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
0
Steve
Telerik team
answered on 04 Feb 2013, 12:06 PM
Hi Steven,

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!

0
Steven
Top achievements
Rank 1
answered on 05 Feb 2013, 02:36 AM
Could the Excel Rendering extension translate padding to indent?

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.
0
Steve
Telerik team
answered on 05 Feb 2013, 03:01 PM
Hi Steven,

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!

0
Robert
Top achievements
Rank 1
answered on 05 Feb 2013, 03:04 PM
Just to clarify, Excel indenting was what I was trying to accomplish to begin with, not cell padding. If indenting could be added to the TextBox control, that would be great.
0
Steven
Top achievements
Rank 1
answered on 05 Feb 2013, 04:00 PM
I agree, your on the money with the addition of the Indent property.
Cell padding and empty text was just a means to an end but this is a cleaner solution.

Thanks for the outstanding support.
Tags
General Discussions
Asked by
Robert
Top achievements
Rank 1
Answers by
Steve
Telerik team
Steven
Top achievements
Rank 1
Robert
Top achievements
Rank 1
Share this question
or