开发者

Crystal Reports Exporting to Excel with Can Grow

I'm using Crystal Reports 2008, Visual Studio 2008 with C#. I build the report in Crystal with multiple columns, some of which are narrative and can be quite lengthy. “Can Grow” is on for every field.

I also have a web page that displays the report through the viewer, which looks great:

Web Page / Crystal Viewer
Date            Narrative                                     Region
08/16/2010      It was a rough day for several Chase          USA
                contenders. Kurt Busch blew an engine, 
                Mark Martin damaged his car early and 
                spent most of the afternoon running 
                outside the top 30, and Jeff Gordon was in 
                the top 10 then he had a flat tire with 47 
                laps to go.

Example of Excel Output:

ROW
1 Date          Narrative                                    Region
2 08/16/2010    It was a rough day for several Chase         USA
3               contenders. Kurt Busch blew an engine, 
4               Mark Martin damaged his car early and 
5               spent most of the afternoon running 
6               outside the top 30, and Jeff Gordon was in 
7               the top 10 then he had a flat tire with 47 
8               laps to go.

T开发者_开发问答he problem occurs when clients export to Excel: The “Can Grow” narrative columns become multiple rows, not the single Row that I need.

The report isn't sortable due to the Narrative being in Multiple Rows. I can export it into Excel through the “Data Only” option, but then it requires user manipulation before it is readable.

Anybody know how I can accomplish this? I know that the Crystal Export to Excel isn’t going to do it.

I am the SQL / Crystal Developer and know very little about the Web/C# portion of this. Can I export to an Template through C#? Or is there some 3rd-party software that will accomplish this?


I had the same problem. One column that may contain carriage return characters such as:

"- text 1
- text 2
- text 3"

I have used Mark's suggestion and tried to replace the carriage return.

Instead of the cell value, I used the following formula: Replace ({cell}, "\n", " ");

When I export the report to Excel (using Excel, and not Excel data only), it works very well.

I would have expected to display the content such as "- text1 - text 2 - text 3" (following the example above). However it is even better: if I select the columns in Excel and enable the Wrap text feature it displays the content correctly:

"- text 1
- text 2
- text 3"

The Crystal field does not have the Can grow radio button checked. This will cause the report not to display all the rows. The export to Excel will work, though.


Assuming the Narrative field is a single dataset row that is being exported to multiple Excel rows due to carriage returns in the field, have you tried substituting the carriage return characters in the field?

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜