简体   繁体   中英

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.

The 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.

假设“叙述”字段是一个数据集行,由于该字段中有回车符,该行已导出到多个Excel行,您是否尝试过在该字段中替换回车符?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM