cancel
Showing results for 
Search instead for 
Did you mean: 

Delay in Excel opening when Exporting reports using ExportToDisk()

jennifer_nalley
Discoverer
0 Kudos

We have a Performance issue exporting reports to Excel using ExportToDisk() in a RemoteApp environment.

When the dataset is fairly large, there is a long delay between the report being loaded and to Excel opening. When using the same database on a local PC, there is no delay of the opening of Excel at the end of the report load. It takes approximately 3 times as long in the RemoteApp environment.

The logs seem to show that Creating the xlsx is done 4 times in the RemoteApp environment and only once on a local PC. It looks like its looping thru this process a total of 4 times, hence the 3 times as long.

Environment: RemoteApp setup consisting of 2 Connection brokers, 2 gateway servers, 1 database server, 1 domain controller, and 2 Session host servers. All Windows Sever 2019 VMs. All in the same domain. Database is SQL Server 2019 instance. 32-bit C++ application using Crystal Reports Runtime Engine for .NET Framework (32 bit) version 13.0.31.4010, compiled in Visual Studio 2019. Excel 2016 installed on Session Host servers.

We used to have a similar setup on Windows 2008 R2 VMs (sans the Connection Broker and Gateway Server VMs required for Win Server 2019 RemoteApp setup) and did not experience this same delay.

The code to Export is being done in a thread and a Progress window is viewable for the Report Load.

mytype = ExportFormatType.Excel;

private void excel_todisk()

{

cryRptArry[selectedreportnum].ExportToDisk(mytypetr, myFilename);

}

private void excel_outandopen(ExportFormatType mytype)

{

. . .

Thread t = new Thread(new ThreadStart(excel_todisk));

t.Start();

while ((t.IsAlive) && (!reportCanceled))

{ //kill time showing progress bar till report finishes loading

System.Windows.Forms.Application.DoEvents();

} //while t is alive and not cancelled

Process.Start(myFilename);

if (myFormProgress != null)

{

myFormProgress.Visible = false;

myFormProgress.Dispose();

}

. . .

}

We have tried disabling the terminal server EasyPrint and installed the print driver from the user’s PC accessing the RemoteApp. That did not speed up anything.

We have tried 32-bit and 64-bit versions of Excel, but that did not have any affect either.

There are no sub reports in the report.

During the export two Crystal temp files get created (.ctm files).

On the local PC, the first file does some big sized Writes then does small size Reads then closes the file. The second file does lots of small Writes then a bunch of small Reads then closes the file.

On the RemoteApp environment, the first file does big Writes and only two Big sized Reads. The Reads end with an Offset of 262,144 then again at 524,288, kind of like it’s doing the whole process twice. The second file does lots of small Writes, no Reads, then closes the file.

I think it may be trying to open the file before it is fully created? or a Windows back ground process is not releasing the reports?

Does anyone have any recommendations on what could be causing the extended delay of Excel opening post Report Load?

DellSC
Active Contributor
0 Kudos

Hi Jennifer,

I removed the SAP Crystal Reports and SAP Crystal Reports Viewer tags from your question because they were unnecessary. This left the SAP Crystal Reports, version for Visual Studio tag.

For more information about what the Crystal tags are used for, see Using SAP Crystal Reports Tags | SAP Blogs.

-Dell

View Entire Topic
jennifer_nalley
Discoverer
0 Kudos

We stumbled upon multiple people disabling 'TSFairshare'. : https://learn.microsoft.com/en-us/windows-server/remote/remote-desktop-services/fair-share-enabled-b...

It made a significant performance increase. Report went from approx. 3 hr 45 min to 1 hour.

We are currently testing to see if there is any downside to disabling it in our multi user configuration. I will update again once our testing is complete.