cancel
Showing results for 
Search instead for 
Did you mean: 

CR XI R3: Issue exporting shared variable to Excel - with workaround

Former Member
0 Kudos
117

Hi,

I have a report that uses a subreport to calculate a field based on the existance (or not) of data in a database other than the main report database. When I use a shared variable to pass this field back to the main report and display it on a detail line (in the main report), it works fine - until I try to export the report to Excel. When exported, the value that gets exported on all detail lines of the report is the final non-blank value of the shared variable, not the value that it contained when the detail line was initially generated. I am using a shared variable because there are multiple values that I want to pass back to the main report.

Luckily, only one of the shared variables are being printed, so the workaround that I am using is to use the subreport to print the field instead of passing the value back in a shared variable and displaying that (and hiding the subreport on a separate format).

Is this a known issue with R3 exporting to Excel? (It was happening in R2 as well...)

HTH,

Carl

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Thanks for the quick reply!

The easy stuff first: This happens when exporting vis CR Designer AND InfoView. We are on XI R3 SP4; for Designer the version is 12.4.0.966.

This DOES NOT happen when exporting to Excel Data Only format (at least from Designer).

This is not an issue with wrapping, as the entire field value (actually, a somewhat lengthy XML document) is displayed in the cell in Excel, but the data do not correspond to the row the value is on.

The Text Interpretaion is set at None for this field, which is pretty much required because it is a valid XML document...

Thanks,

Carl

former_member207611
Active Participant
0 Kudos

Hello Carl:

If its not happening with Excel Export data only, my conclusion will be that this is an issue with Merge cells technique which regular excel export DLL uses.

When you say it does not show in same row, does the entire cell shows below or above the row ? or it cuts the cell data ?

Either way, we may not be able to do much as we are at mercy of the Excel DLL in this case which tries to replicate the exact look, feel and formatting it has on CR designer. The workaround you have to pass it in shared variable and show as regular column rather than sub-report is best and might be only approach to fix this.

One last try i would give is to use vertical and horizontal 'Guidelines' and 'Grid' and make sure the row cells has exact same height and they are aligned middles and give it a shot. I remember reading the release notes of export DLLs that these DLLs look for Guidelines to place the columns on Excel though this was during version 8.5 and CR export drivers have improved a lot since issues of those days.

Former Member
0 Kudos

Simplified somewhat, what this report is doing is looking up open orders in one database and checking to see if something specific happened to it in another database. If so, it generates the XML that needs to be applied to the first database to update it. The XML references the order number and line number. What I mean is that instead of the data coming out as


Order Line  XML Snippet
12345 1234 ...<order>12345</order><line>1234</line><status>received</status>...
22345 2234 ...<order>22345</order><line>2234</line><status>received</status>...
32345 3234 ...<order>32345</order><line>3234</line><status>received</status>...
42345 4234 ...<order>42345</order><line>4234</line><status>received</status>...

I get


Order Line  XML Snippet
12345 1234 ...<order>42345</order><line>4234</line><status>received</status>...
22345 2234 ...<order>42345</order><line>4234</line><status>received</status>...
32345 3234 ...<order>42345</order><line>4234</line><status>received</status>...
42345 4234 ...<order>42345</order><line>4234</line><status>received</status>...

I have Base Column Widths on Details, so there should be no merging attempted, but I'll check and make sure.

It seems to me, though, that the DLL is being told the wrong value to export...

Carl

Former Member
0 Kudos

And to clarify a few things:

This issue happens when I use the shared variable. It does not happen when using the subreport to display the XML.

Also, this is not a line positioning error. Either way (shared variable or subreport), the data is on the row with the main report's data and in the proper place. It is not above, below, or cut off. The issue is that the XML data does not correspond with the data that should be displayed (or which is shown in Designer before export) for the row. See my example in the previous post.

And I am using guidelines to make sure the cells line up properly, but I really don't think that's related...

Carl

former_member207611
Active Participant
0 Kudos

Hello Carl:

Did this happen on Excel Data(Only) export too ? Also, when this happened did you try to use 'wrap' on the excel exported file and see if it might be breaking it into multiple lines. Crystal is known to have issues blank spaces on certain objects and using 'HTML Text interpretation' on format field fixes most of those issues. Also, can you write more details about CR version you are using and if you exported it from CR Designer or InfoView ?