+1 800 256 3608 (toll-free in North America) or +49 7531 9060-10| service@combit.com

Export Word Wrap to Excel Headers

I’ve got an L&L-26 report that I’m exporting to Excel. The column headers are kind of verbose and I’d like them to wrap which they do quite nicely in the designer but I can’t get Excel to wrap them. I’ve got OnlyTableData set to 1 and IgnoreLinewrapForDataOnlyExport set to 0 but no joy.

I’m using the Data Line for both header and data but that shouldn’t matter since I couldn’t get them to wrap in the Header Line either.

Is there any way to accomplish this?

Hello Robert,
the option refers to explicit breaks in the text, not to automatically performed line breaks. So you would have to pass the header texts already with wrapping, then it would work.

“So you would have to pass the header texts already with wrapping,”

I believe that I am doing that. A typical header would be “Total Shipments via Rail 2020”

You would have to explicitly insert breaks in the text here.This should work and create a break after “Total Shipments”:
"Total Shipments "+chr$(13)+“via Rail 2020”.

I saw that in the help and it seems to work but was hoping that L&L could set word wrap without having to do that. But there’s a further problem. This report has 27 columns, most with these wide headers. I’ve set it to use the widest paper possible, 8X17, and the headers show up in Excel with extra spaces like this: “Shipm ents via Rail 2020” even with the chr$13 instructions. Apparently L&L adds spaces when the columns are so narrow that some words don’t fit and are broken up. I can go through the exercise of adding all of the chr$13 instructions but how do I get rid of these extraneous spaces?

Just had a deeper look at this. Assuming this is an “Excel only” report, I’d suggest to use a hilariously small font for this specific scenario - the blanks are introduced by the forced wraps and cannot easily be removed. By using a very small font, you should be able to avoid automatic wrapping altogether and just wrap where you need it.

Admittedly - this looks weird in the Designer:

image

However it does the trick in Excel (with one chr$(13) wrap for the QuantityPerUnit-Column header):

image

This requires XLS.IgnoreLinewrapForDataOnlyExport to be set to zero as you already did.

Attaching my playground project for the sample application.

Excel.srt (197.0 KB)

Hmmm… that actually helps but when you say “ridiculously small” I can’t do that, the smallest font available is 8 which isn’t terribly small. If I could go down to something smaller it would probably fix my issue altogether. And yes, I am only exporting to Excel.

One other thing that doing this helps with is right justification of larger numbers which also goes wonky when the columns are very narrow. You can see both problems in the attached image.

Thanks for the idea, it fixes the justification and most of the space problems.

You can simply type “2” for a font size of 2pt. It’s not offered in the drop down because most of the time it wouldn’t make sense, however it renders just fine :slight_smile: - that’s how I created my sample.

© combit GmbH