cancel
Showing results for 
Search instead for 
Did you mean: 

Problem When Multiple Users Export To PDF Simultaneously

Former Member
0 Kudos

I am hoping someone out there can help. We have had no luck at all with Crystal Reports / SAP support for this issue.

We have a client/server aplication and have written a C# program to load a crystal report on the server, export it to PDF and then we send the PDF to the client. We are using Crystal Reports 2008 and have applied SP4.

The scenario is as follows:

Two users log into our application from different PC's.

User 1 prints a report with no issue.

User 2 prints a report 5 seconds later with no issue.

If User 1 prints a report and while that report is being exported to PDF, User 2 prints a report, the first will be successful and the second will fail. If User 2 reprints the report after receiving a failure, the report prints successfully the second time (using the same temp report folders as the previous attempt). We have done a lot of tracing and have narrowed the problem down to the point in out C# program when the cryRpt.Export() routine is called. It seems to be what is failing and doesn't seem to be able to run 2 exports simultaneously.

All exporting to PDF occurs on the application server and the processes run as "Administrator" so permissions should certainly not be a problem. Each user is printing a different physical .rpt file and the data for each report is in a different physical directory.

Has anyone come across this before or have any suggestions?

Accepted Solutions (1)

Accepted Solutions (1)

former_member183750
Active Contributor
0 Kudos

Thread moved to the NET - SAP Crystal Reports forum.

Define: " the first will be successful and the second will fail."

Error? Symptom? Behavior?

Ludek

Follow us on Twitter http://twitter.com/SAPCRNetSup

Got Enhancement ideas? Try the [SAP Idea Place|https://ideas.sap.com/community/products_and_solutions/crystalreports]

Former Member
0 Kudos

What I mean, is that the first report successfully exports to PDF while the second does not. The export to PDF fails. The C# program (at the point where cryrtp.Export() is called, throws an exception. The exception is as follows:

Exception when export report: The system cannot find the path specified.

at CrystalDecisions.ReportAppServer.Controllers.ReportSourceClass.Export(ExportOptions pExportOptions, RequestContext pRequestContext)

at CrystalDecisions.ReportSource.EromReportSourceBase.ExportToStream(ExportRequestContext reqContext)

at CrystalDecisions.CrystalReports.Engine.FormatEngine.ExportToStream(ExportRequestContext reqContext)

at CrystalDecisions.CrystalReports.Engine.FormatEngine.Export(ExportRequestContext reqContext)

at CrystalDecisions.CrystalReports.Engine.ReportDocument.ExportToDisk(ExportFormatType formatType, String fileName)

at ReportGenerator.ReportGenerator.exportReport(String xmldir, String crname, String pdfname, String termid, Boolean debug)

It;s important to note that the second export only fails if the export is still running on the first session. It's almost as if the export to pdf functionality can only handle one request as a time.

Jeff

former_member183750
Active Contributor
0 Kudos

See if opening the reports by temp copy helps. Something like:




Private Sub LoadReport(ByVal reportName As String)
         Dim myReportDocument As New ReportDocument()

         myReportDocument.Load(reportName, OpenReportMethod.OpenReportByTempCopy)
         MyCrystalReportViewer.ReportSource = myReportDocument
      End Sub


- Ludek

Former Member
0 Kudos

We thought the same thing as you suggest and have already made that change without sucess. Below is what the code looks like for our export routine. Perhaps you can spot something we have not. As mentioned before the export appears to be faulting at the statement "cryRpt.ExportToDisk(ExportFormatType.PortableDocFormat, pdfname);" in the below code.

The code is as follows:

public void exportReport(string xmldir, string crname, string pdfname, string termid, bool debug)

{

try

{

if (debug)

{

dt = DateTime.Now;

tw.WriteLine(dt.ToString() + "-Start exportReport: " + crname);

}

ReportDocument cryRpt;

cryRpt = new ReportDocument();

cryRpt.Load(crname, OpenReportMethod.OpenReportByTempCopy);

if (debug)

{

tw.WriteLine("Done loading report: " + crname);

}

int tmpct = 0;

int tmpint = crname.IndexOf("
", tmpct);

while (tmpint != -1)

{

tmpct = tmpint;

tmpint = crname.IndexOf("
", tmpct + 1);

}

string ODBCReportFileName = crname.Substring(tmpct + 1, crname.Length - tmpct - 5);

if (debug)

{

tw.WriteLine("ODBC Report Filename: " + ODBCReportFileName);

}

Database crDatabase;

Tables crTables;

Table crTable;

TableLogOnInfo crTableLogOnInfo;

ConnectionInfo crConnectionInfo = new ConnectionInfo();

//Setup the connection information structure to log on to the data source for the report.

// If using ODBC, this should be the DSN. If using OLEDB, etc, this should be the physical server name

crConnectionInfo.ServerName = "SH" + ODBCReportFileName;

if (debug)

{

tw.WriteLine("Resetting connection to: " + crConnectionInfo.ServerName);

}

crConnectionInfo.DatabaseName = "";

//Get the table information from the report

crDatabase = cryRpt.Database;

crTables = crDatabase.Tables;

//Loop through all tables in the report and apply the

//connection information for each table.

if (debug)

{

tw.WriteLine("Applying new connection to all tables...");

}

for (int i = 0; i < crTables.Count; i++)

{

crTable = crTables<i>;

crTableLogOnInfo = crTable.LogOnInfo;

crTableLogOnInfo.ConnectionInfo =

crConnectionInfo;

crTable.ApplyLogOnInfo(crTableLogOnInfo);

if (debug)

{

tw.WriteLine("Applying new connection to tables " + crTable.Name);

}

}

cryRpt.Refresh();

if (debug)

{

tw.WriteLine("Applying new connection to all tables... DONE");

}

if (debug)

{

tw.WriteLine("Target report: " + pdfname);

}

cryRpt.ExportToDisk(ExportFormatType.PortableDocFormat, pdfname);

if (debug)

{

tw.WriteLine("Export Complete");

}

cryRpt.Dispose();

cryRpt.Close();

if (debug)

{

dt = DateTime.Now;

tw.WriteLine(dt.ToString() + "-Done export to PDF.");

}

}

catch (Exception e)

{

TextWriter tw1 = new StreamWriter(logpath + "
exporterror.log", true);

tw1.WriteLine("Exception when export report: " + e.Message);

tw1.WriteLine(e.StackTrace);

tw1.Close();

}

}

former_member183750
Active Contributor
0 Kudos

What is the database you are using?

A test I'd like you to try:

1) Comment out all DB logon code

2) Create a new report - no DB connection, just a text object with "Hello World" in the header

3) Run the above report from both clients - do you get the same issue?

4) Take one of your reports and ensure it has saved data (export to rpt file format is one way, enabling the "saved data" option inthe designer is another

5) Run the above saved data report on both clients. Does this work?

Oh, before you run the above test, make sure the temp directory is clean.

- Ludek

Edited by: Ludek Uher on Jan 4, 2012 1:11 PM

Former Member
0 Kudos

The database we are using is an XML database and we are accessing it using the Crystal Reports XML ODBC Driver (DataDirect Driver).

We tried what you suggested and still experience the same issues. We commented out the database logon code in our C# program, created a report without a database connection but instead just static text, then ran it from 2 difference sessions, and the same issues were experienced.

It does not appear to be releated to ODBC at all, still seems to be related to the export functionality.

Please advise.

Former Member
0 Kudos

I have to correct my previous post. Upon further testing, it does seem that when a report is not referncing the CRXML odbc driver, it runs fine and multiple exports can occur simultaneously. As soon as we ran a lenghty report using the XML ODBC driver again, the error returned immediately.

Is there anyway we can trace the driver to see if it is failing?

former_member183750
Active Contributor
0 Kudos

Let's take a look at this:

CRXML odbc driver

I'm not sure what that really means. There are two drivers you could use; crdb_xml.dll (direct native connection to xml) and then you could use crdb_odbc.dll. But, in order to use the crdb_odbc.dll to connect to xml, you need the Data Direct ODBC driver layer which the crdb_odbc.dll would use.

If you are using ODBC, ensure that the Data direct drivers are version 5.3:

https://smpdl.sap-ag.de/~sapidp/012002523100008666562008E/cr_datadirect53_win32.zip

Alternatively, creating an ADO DB dataset from the XML and passing that to the report may be an option;

crReportDocument.SetDataSource(dataSet)

- Ludek

Former Member
0 Kudos

We have done further testing and have confirmed that we are in fact using the DataDirect 5.3 ODBC drivers (for windows). The actual dll being used is CRXML23.DLL.

We have tested the same scenario on a 32Bit Server and also on a 64Bit server and the problem can only be duplicated on a system running 64Bit Windows.

Is it possible there is an issue with 64Bit windows and this driver? Is there a way to trace the driver to see where it is failing?

former_member183750
Active Contributor
0 Kudos

I am pretty sure the file CRXML23.DLL comes from Data Direct, not SAP Crystal reports. E.g.; the following sequence of evens woudl occur with the CRXML23.DLL:

Load CR print Engine (crpe32.dll)

Load CR Database engine (crqe.dll)

Load CR database driver(s) - in this case crdb_odbc.dll

Crdb_odbc.dll then loads the Data Direct driver CRXML23.DLL

If that file has an issue, it would have to be Data Direct to confirm it and fix it - if they see this as a bug in their product.

Umm, trying to find more information - I do not have Data Direct drivers installed, but googling CRXML23.DLL I come up empty - not one hit. Are you sure this is the file name?

- Ludek

Former Member
0 Kudos

The DataDirect Drives are from SAP Crystal Reports. Please see the below URL:

"https://websmp130.sap-ag.de/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/bobj_download/main.htm" (Cut and Paste the URL into your web browser).

Once there, select as follows:

Software Product: Crystal Reports

Product Version: Crystal Reports 2008

Software Type: Utility

Click Search and a list of downloads will display. The last page contains the Windows Data Direct Drivers avaialble for use with Crystal Reports. Once you install the XML driver you will see that the description is "Crystal Reports ODBC XML Driver" and the driver DLL is CRXML23.dll. Data Direct is the maker of the driver (they seem to manufacture the driver for SAP Crystal Reports).

How do we go about getting support for the driver? Does that go through SAP Crystal Reports or Data Direct directly?

Please advise.

former_member183750
Active Contributor
0 Kudos

Umm, yes I know where the drivers are on our website.

How do we go about getting support for the driver?

- Contact Data Direct

Does that go through SAP Crystal Reports or Data Direct directly?

- No it does not. Just between you and I, there is actually way less communication between them and us than there should be. To me, it looks like Data Direct considers us as just another customer. Nothing more.

- Ludek

Former Member
0 Kudos

I will contact them and see what they say. I will post an update once I have heard from them.

Former Member
0 Kudos

I contacted DataDirect.

They said that since SAP Crystal Reports is their OEM client, and we are using the driver that was designed for SAP Crystal Reports, any support requests need to be initiated by SAP Crystal Reports. You can put them in direct contact with us to work through the issue, but the initial request needs to come from SAP Crystal Reports.

Can this be initiated so we can work through the issue with their support people?

Former Member
0 Kudos

Ludek.

Can you provide me with an update on this? Is it possible for you to initiate a support request with DataDirect so we can get to teh bottom of this?

Please let me know.

former_member183750
Active Contributor
0 Kudos

Waiting for Program Manager to get back to re. my enquiry on this...

- Ludek

0 Kudos

Hello,

I'm on the same internal e-mail thread, PM said we can but we need to be able to duplicate the issue so can you do a few more tests.

First I would to get more info on your original post where you say you did not get any help from SAP Support. Do you have the case number so I can look up the Case? I would like to follow up with the Rep to find what happened.

Verify this is a 32 bit app and you are using CR 2008 SP 4 runtime? Reason is a 64 bit OS should not affect this, I assume you created the System DSN in ODBC Admin in the windowssyswow64 folder correct?

First, can you download the 6.0 drivers, use the Trial version option, from DataDirect and see if that works? It may be a bug they have already fixed. Try it on another App server PC if you can so we don't alter the original test machine but if not then no problem.

Next one is see this kbase article to log our DB API's:

[1603398 |http://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes_boj/sdn_oss_boj_bi/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/scn_bosap/notes%7B6163636573733d36393736354636443646363436353344333933393338323636393736354637333631373036453646373436353733354636453735364436323635373233443330333033303331333633303333333333393338%7D.do]- How To: Debugging database issues using crlogger logs in Crystal Reports 2008

Next is to turn on ODBC Tracing at the same time so we can compare what is happening. If you can use as small a data set as possible that would be great. Both log files are going to generate a lot of lines so be patient.... It may take some time to replicate or it may happen right away.

To turn off crloggger tracing just rename the dll to crlogger.org.

As soon as the error happens note the time so we can go there. Once you have dons and the logs do verify the issue I'll contact you to get them.

From the logs we should be able to determine if this is a CR or DD issue.

I did not read all of the info or I did not noticed if you tested this scenario but what happens if you use the ADO.NET XML driver? Curious if that has the same problem.

Thank you

Don

Former Member
0 Kudos

Hello Don.

Thank you for your email and for stepping up on this one.

Firstly, my original incident was incident 4089215. I have no idea what happened, but I just simply stopped getting any communication back. It could be as simple as my emails not getting through, I am not sure. The online forum has proven to be the better tool to use.

To answer some of your other questions:

1. Our application is a 32Bit application.

2. We have installed Crystal Reports 2008 SP4

3. Our application is wirrten in C# and it creates data sources automatically as reports are run, but it creates User DSN's as opposed to a System DSN.

4. We have already tried the latest drivers from Data Direct (downloaded from their website) but the issue persists.

5. The problem does occur on any 64 Bit Windows server and we are able to duplicate it very easily.

I will set up the CR logger and let you know how that goes. I have tried to enable ODBC tracing on the machine, but it appears that tracing does not work properly with 32Bit drivers on a 64Bit OS. I can easily get it to work on a 32Bit OS, but for some reason Windows Server 2008 R2 does not trace the driver properly. Not just this particular driver, I cannot get it to trace any driver properly. I will try again though to ensure it's not something silly.

I have not tried the ADO XML driver. That was going to be my next step.

I will get backt to you very soon.

Jeff

0 Kudos

Hi Jeff,

Ludek had your case and he did reply to you and never heard back from you. For some odd reason the case is closed by the system which the System cannot or should not do unless we tell it to.... He'll update you again and create a new Case if need be...

Anyways, you MUST use a System DSN, I believe User DSN's will lock the DB and System DSN's have been a requirement of Cr for as long as I can remember.

What happens if you use System DSN's?

Make sure you are using the ODBC Administrator located in \windows\syswow64 folder so you create the DSN in the 32 bit administrator. IF they are created the 32 bit Admin CR won't have access to them.

Don

Former Member
0 Kudos

Hi Don,

To update you on this. We have modified the code to use System DSN's, but the issue persists. I was really hoping that was the fix!

I have implemented the CR Logger function you provided and have the log files from that. It is clear and easy to see the one particular session that fails. The following are a few of the key lines:

2012-1-16 14:54:25.379 2708 .\connect.cpp 2020 SQLDriverConnect succeeded: DSN = SH114420120116145424, User ID = , Password = 10

2012-1-16 14:54:25.500 2708 .\odbcapi.cpp 875 Beginning COdbcapi::ExecDirect 20

2012-1-16 14:54:25.503 2708 .\odbcapi.cpp 884 Finishing COdbcapi::ExecDirect 20

2012-1-16 14:54:25.503 2708 .\rowset.cpp 209 SQLExecDirect failed: select * from "XML"."Details"...

I have been completely unable to use the ODBC trace function to trace the ODBC driver in Windows. It just will not trace that driver for some reason. I have tried everything. If there is another trace utility that I can use, please let me know.

Jeff

0 Kudos

Hi Jeff,

Too bad, I was hoping it was the cause also.

That just shows the connection failed. I was hoping it would give us more details.

Ya ODBC tracing can be a pain. I find if I set the odbc log file name by using an empty txt file and rename it. Then save it all and close the ODBC Admin tool down. Then open it up again and then click the Trace button seems to work most of the time...

ODBC Trace will show the SQLExecute.... commands where it tests the read and any other specifics when it gets locked.

Can you ZIP up that log file and send it to Ludek? If you can't find his last e-mail I asked him to resend it... There may be more info leading up to the problem in there that shows the problem.

Also, make sure you are using the 32 bit ODBC Admin also. If you do get it working get both crlogger and ODBC trace so we can sync up the times.

Also, CR 2011 should install the 6.x DD ODBC drivers. Download the Trail Version and then you can test with them. There is no standalone install for CR 2011 you can download.

Don

Edited by: Don Williams on Jan 16, 2012 12:47 PM

Former Member
0 Kudos

Hi Don,

I managed to get ODBC Tracing working and duplicate the error. I have sent through the log file to Ludek. If he does not receive them let me know. It is very easy to see where the error starts in the log. Let me know what you want to do next.

Jeff

0 Kudos

Hi Jeff,

Yes I went over your logs and we see you are loading the DD drivers installed from Version CR 10. Ludek install the DD 5.3 drivers on a test PC and we don't get your error.

Comparing the ODBC Trace logs We have a lot more info the drivers are doing before the SELECT is executed.

As Ludek suggested, run modules to verify you are using the correct version. Also check your DSN and make sure you are using CRXML23.dll.

Thanks again

Don

0 Kudos

Check your in-box... Ludek sent you info...

Former Member
0 Kudos

Hi Don,

I have sent through the requested info to Ludek.

We have tried just about every xml odbc driver we could find including crxml19.dll, crxml23.dll and the latest 6X drivers from data direct. We can produce the error regardless of the driver.

Jeff

Former Member
0 Kudos

Hi Don.

I have sent the newly requested log files and sample data to yourself and Ludek.

Jeff

Former Member
0 Kudos

Just to supply an update to anyone watching this thread. We have provided the requested trace logs to SAP Crystal Reports and they have been able to duplicate the problem now at their end.

The issue seems to be with the XML ODBC driver and we are waiting to hear how the issue can be resolved and for an indicitive timeframe of the fix from Progress DataDirect.

0 Kudos

Hi Jeff,

Thanks again for all the info. Ludek is going to create a new case, since your original one was closed by the system ( odd because it should not have ) So he'll copy over the original info and add our new info and then from there he'll create the TE and I'll create the Adapt.

At this point our Developers will determine if it's CR or DD introducing the Lock and then each will do the fix as required.

It's going to take time for us to do this. I'll set it for SP6 for CR 2008 ( 4th quarter 2012 ) and SP4 for CR for VS 2010 and assuming we can fix it then it should make it in but we can't say for sure at this time, it may be delayed to SP 5 ( 6+ months ) or if it's a DD issue then whenever they release a patch or however they do their patch release which we won't know.

ADAPT01610636

Thanks again

Don

Updated info.

Edited by: Don Williams on Jan 24, 2012 7:22 AM

former_member183750
Active Contributor
0 Kudos

New case number: 66989

TE: 5000399766

ADAPT01610636

- Ludek

0 Kudos

Developers applied Service Pack 5 to their Test system and it no longer has a locking issue.

Don

0 Kudos

Hi Jeff,

After more testing we were able to duplicate the issue amd discovered is is an issue in the DD driver.

We have contacted DD to have them look into the issue.

Don

0 Kudos

Final update...

DataDirect has fixed the issue in version 6.0, 6.1 and 7.0. They will not be updating the 5.3 drivers.

To get the drivers you can download the Trial version of CR 2011 and verify the fix, it should install the DD 6.0 drivers.

Don

Answers (0)