cancel
Showing results for 
Search instead for 
Did you mean: 

Export to Editable RTF and Insert Page Breaks

Former Member
0 Kudos

Hello!

Please can anybody help to reproduce or explain this undesired behaviour and suggest how I might go about fixing it?

I'm using the 64-bit version of Crystal Reports for Visual Studio 2010 version 13.2 and I'm trying, programmatically, to export a report as an editable RTF with the 'InsertPageBreaks' option enabled. This should produce an RTF file in which each record in the report is separated by a page break. It should produce the same output as when the report is exported from the Crystal Reports Designer using the 'Microsoft Word - Editable (RTF)' format and the 'Insert page break afer each report page' box on the subsequent dialog is ticked.

My ASPX Page_Load code as follows:

EditableRTFExportFormatOptions oRTFOptions = ExportOptions.CreateEditableRTFExportFormatOptions();
oRTFOptions.UsePageRange = false;
oRTFOptions.InsertPageBreaks = true;
oRTFOptions.PrintOnLoad = false;

ExportOptions oExportOptions = new ExportOptions();
oExportOptions.ExportFormatType = ExportFormatType.EditableRTF;
oExportOptions.ExportFormatOptions = oRTFOptions;

ReportDocument oReportDocument = new ReportDocument();
oReportDocument.Load(Server.MapPath(@"~/Report1.rpt"));
oReportDocument.ExportToHttpResponse(
    oExportOptions,
    Response,
    true,
    "MyReport");

This works on my development machine, but when I deploy to my production environment the page breaks are missing from the RTF file. I should note that my example is deployed as ASP.NET web application in a .NET 4.0 application pool. My development machine is running Windows 7 and Visual Studio 2010 and my production server is running IIS7 on Windows 2008 Server. I've tried a few different reports of varying simplicity/complexity and all are fine on my development machine but the page breaks are missing on the RTF documents produced by my production server.

Many thanks,
Tim

Accepted Solutions (1)

Accepted Solutions (1)

former_member183750
Active Contributor
0 Kudos

I suspect there may be a registry key missing on the deployed computer. Have a look at the following key on the development computer:

HKEY_LOCAL_MACHINE\SOFTWARE\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Crystal Reports\Export

and compare this to the registry on the deployed computer. If that does not get you anywhere, download Process Monitor and see what the logs tell you about keys being used on the dev computer.

Ludek

Former Member
0 Kudos

Hi Ludek,

Thanks for your suggestion - very much appreciated.

I don't have an 'Export' registry key below 'HKEY_LOCAL_MACHINE\SOFTWARE\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Crystal Reports' on either the development or production computers. In both cases I have just 'DatabaseOptions' and 'templates' sub keys below 'Crystal Reports'.

Process Monitor tells me that my application is trying to read from the following keys values in the Registry below 'HKEY_CURRENT_USER\Software\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Crystal Reports\' during ExportToHttpResponse():

  • Export\BitMapMagnifNumerator
  • Export\MailDestType
  • Export\DisableExportLiveOfficeSupport
  • Export\BitMapMagnifDenominator
  • Export\MailDestDLL
  • Export\ExportDirectory
  • FormatOptions\TextualObjectsCanShrink
  • FormatOptions\UseOldLineBoxFormatter
  • FormatOptions\DisableScriptsInHyperlinks
  • FormatOptions\ThinningOutPageStartInfo
  • FormatOptions\IgnoreSharedVarStateInLinkedSubRpt
  • FormatOptions\EnableDDCParameterOption

The Export and FormatOptions keys are present under HKEY_CURRENT_USER on the development machine, but the keys are empty, so all of the queries above fail. There is no corresponding Software\SAP BusinessObjects key under HKEY_USERS for the application pool identity account on the production machine.

I've compared the 'HKEY_LOCAL_MACHINE\SOFTWARE\SAP BusinessObjects' keys on both machines. The production machine has a subset of the keys present on the development machine. These are the missing keys/values:

[HKEY_LOCAL_MACHINE\SOFTWARE\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Crystal Reports]
"ChartSupportPath"="C:\\Program Files (x86)\\SAP BusinessObjects\\Crystal Reports for .NET Framework 4.0\\Common\\Crystal Reports 2011\\ChartSupport\\"

[HKEY_LOCAL_MACHINE\SOFTWARE\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Report Application Server\Server\Logging]
"LogSysTrace"="False"
"LogRequest"="False"
"LogTrace"="False"
"LogError"="False"

[HKEY_LOCAL_MACHINE\SOFTWARE\SAP BusinessObjects\Suite XI 4.0]

[HKEY_LOCAL_MACHINE\SOFTWARE\SAP BusinessObjects\Suite XI 4.0\Crystal Reports]
"ChartSupportPath"="C:\\Program Files (x86)\\SAP BusinessObjects\\Crystal Reports 2011\\ChartSupport\\"

[HKEY_LOCAL_MACHINE\SOFTWARE\SAP BusinessObjects\Suite XI 4.0\Crystal Reports\Keycodes]
"KeycodeDefinitionFilePath"="C:\\Program Files (x86)\\SAP BusinessObjects\\/Crystal Reports Common\\BusinessObjects_KCDefinitions_dfo.xml"

[HKEY_LOCAL_MACHINE\SOFTWARE\SAP BusinessObjects\Suite XI 4.0\default]

[HKEY_LOCAL_MACHINE\SOFTWARE\SAP BusinessObjects\Suite XI 4.0\default\Shared]

[HKEY_LOCAL_MACHINE\SOFTWARE\SAP BusinessObjects\Suite XI 4.0\default\Shared\ConnectionServer]

[HKEY_LOCAL_MACHINE\SOFTWARE\SAP BusinessObjects\Suite XI 4.0\default\Shared\ConnectionServer\CSCheck]

"Data Directory"="C:\\Program Files (x86)\\SAP BusinessObjects\\SAP BusinessObjects Enterprise XI 4.0\\dataAccess\\connectionServer\\tools"

[HKEY_LOCAL_MACHINE\SOFTWARE\SAP BusinessObjects\Suite XI 4.0\Installer]

[HKEY_LOCAL_MACHINE\SOFTWARE\SAP BusinessObjects\Suite XI 4.0\Installer\Aurora]
"path"="C:\\Program Files (x86)\\SAP BusinessObjects\\"

[HKEY_LOCAL_MACHINE\SOFTWARE\SAP BusinessObjects\Suite XI 4.0\Shared]
"LanguagePackInfoDir"="C:\\Program Files (x86)\\SAP BusinessObjects\\SAP BusinessObjects Enterprise XI 4.0\\Languages"

Can you offer any further pointers?

Many thanks,
Tim

former_member183750
Active Contributor
0 Kudos

Hello Tim

I managed to fire up an image with CRVS2010 (I'm working from home and these connections have their challenges sometimes ). I was able to confirm all of the excellent info you provided. This makes me think that perhaps it is not the registry. If that is the case, then perhaps it is the runtime. Can you please download the Modules utility and do the following:

Run the app on the development computer, export a repot - leave the app running

Start Modules. Go to the File menu and select Memory Modules -> New list

Save

Repeat on the runtime computer, then use Modules to compare the results.

With no prior experience with this issue, compare both the CR runtime and system files.

- Ludek

Former Member
0 Kudos

Hi Ludek,

I've not been able to get the Modules utility to see the W3WP.exe processes hosting my application, so I've used ListDlls from sysinternals.com instead. This revealed that I'd made a mistake configuring the application pool on my development machine, and it was actually running in WOW64 mode. When I configured the application pool on my development machine to run in native 64-bit mode, it started producing RTFs with missing line breaks. I've also managed to reproduce this on my production machine having also installed the 32-bit runtimes. If I run the IIS application pool in WOW64 mode, I get the line breaks. If I run in native 64-bit mode (changing nothing else), I don't.

I've used ListDlls again to compare the modules loaded on the production machine when running in 32-bit and 64-bit modes. These are the differences (allowing for the equivalence of system32/SysWOW64 and win32_x86/win64_x64):

Loaded in 32-bit mode, but not 64-bit mode:

  • C:\Program Files (x86)\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Common\SAP BusinessObjects Enterprise XI 4.0\win32_x86\implode.dll
  • C:\Program Files (x86)\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Common\SAP BusinessObjects Enterprise XI 4.0\win32_x86\u25azalea.dll
  • C:\Windows\SysWOW64\MSVCP71.dll
  • C:\Windows\SysWOW64\MSVCR71.dll

Loaded in 64-bit mode, but not in 32-bit mode:

  • C:\Windows\assembly\GAC_64\log4net\1.2.10.0__692fbea5521e1304\log4net.dll
  • C:\Windows\system32\FontSub.dll
  • C:\Windows\system32\spool\DRIVERS\x64\3\mxdwdrv.dll
  • C:\Windows\system32\spool\DRIVERS\x64\3\mxdwdui.DLL
  • C:\Windows\system32\spool\DRIVERS\x64\3\unidrvui.dll

Do any of those look significant to you?

Many thanks,
Tim

former_member183750
Active Contributor
0 Kudos

I don't think there is any releationship between those files. Would you be able to share your report with saved data? If so, I'll contact you via email...

- Ludek

Former Member
0 Kudos

Yes please Ludek. I can share the basic report I created just for testing this problem. I can also share my Visual Studio project and IIS application if that would help?

Thanks,
Tim

former_member183750
Active Contributor
0 Kudos

Ok. I sent you an email out of this new platform. Please let me  know if you do not get anything...

- Ludek

Answers (1)

Answers (1)

Former Member
0 Kudos

Update: Ludek has reproduced the issue and found a workaround, so I thought I'd post an update here in case anybody else runs into the same issue.

Symptom: The EditableRTFExportFormatOptions.InsertPageBreaks = true setting is ignored when set programmatically in an application run inside a 64-bit IIS application pool.

Workaround 1: Install the 32-bit Crystal Reports for Visual Studio 2010 runtimes and change the application pool setting "Enable 32-Bit Applications" to True.

Workaround 2: In the Crystal Reports designer, under File -> Export -> Report Export Options, select "Microsoft Word (97-2003) - Editable" and press "OK". Tick the "Insert page break after each report page" option and save the report.

Fix: Presently expected in SP4, due about mid-2012.

former_member183750
Active Contributor
0 Kudos

Thank you for posting this Tim.

At this time the issue is tracked under Technical Escalation number 5050055182. This will get converted to an "ADAPT" number (should be by end of next week at the latest) and R&D will track it under that number. Once the ADAPT is issued, I'll update this thread.

- Ludek

former_member183750
Active Contributor
0 Kudos

Forgot to update this thread with the ADAPT number: ADAPT01628595. This was issued end of day, March 30, 2012. Target ETA; mid July

- Ludek