开发者

Crystal Report Java SDK: How to set export option on columns to 'can grow' when exporting to Excel?

开发者 https://www.devze.com 2023-01-14 00:55 出处:网络
The title of the question pretty much tells it all. When using the java SDK provided by Crystal Reports to export a report as an Excel spread-sheet. Although the cells g开发者_开发问答row even now, o

The title of the question pretty much tells it all.

When using the java SDK provided by Crystal Reports to export a report as an Excel spread-sheet. Although the cells g开发者_开发问答row even now, only the first line is visible in the export XLS.

In the Crystal Reports UI, this is achieved by setting the 'Grow' option from the Report Export options.

What parameter must be set so that the corresponding cell visibly grows to accomodate large/multi-line text?


Given the hugely different nature of the 2 formats, exporting to Excel is always tricky. However, I did do a quick test exporting a dummy report from my CR standalone developer version, and replicated & solved your problem.

In your text fields that you want grown, go into the Format Editor->Common and turn on the Can Grow option. It looks like this activates Excel's Wrap Lines option, but unforunately also adds extra rows to make up for it.


My problem was that the field width was set to the width of the matter it contained. What worked eventually was to have the field-width in Crystal Report set to slightly smaller than the matter it is to contain.

Say, the matter to be written is 'Address Line One'.

Set the field in design view such that only 'Address' is visible. Then set the field to 'Can Grow' with 0 (no-limit) on the number of lines to grow.

When the report is exported to XLS, the cell in XLS will be resized to display the rest of the body.

0

精彩评论

暂无评论...
验证码 换一张
取 消