cancel
Showing results for 
Search instead for 
Did you mean: 

Initialize Reports intermittent

myoung1968
Discoverer
0 Kudos
  • Database: Oracle 19
  • Platform: .NET 4.7
  • Development: VS2022
  • Reporting: Crystal Reports SDK
  • Read: Troubleshooting the Error; Load Report Failed
  • Problem Description: At running the Error in Event log ( "strDB is unknown" is a symptom of the serverId session variable being lost. What caused the session to be lost is the big question.) is displayed after a random amount of time – sometimes 30 mins, sometimes 2 hours. After about 20-30 mins wait, report execution resumes.
  • Jun 20 – US Testing:
  • Tester 1 for 1.5-2 hours – no issues
  • Tester 2 for about 30 mins – no issues
  • Jun 21 – Offshore Testing (VM)
    • 3 Testers – issues after about 30 mins

    Detail data in event points to Line 17: rpt.Load(reportFile, OpenReportMethod.OpenReportByTempCopy);

    I'm suspecting that the Crystal SDK is encountering issues when loading the report. Whether another process has the file locked, or some other reason. There are 2 "OpenMethod" options. OpenReportByDefault or OpenReportByTempCopy. I was using the default load method. I changed to use the OpenReportByTempCopy. I suspect that this option will load the file as a copy and use it and by the nature of how it opens, it will use a copy of the report and not "lock" the main file. However the issue still occurs intermitantly.

    initializereport.txt

    initializereport.png

    Accepted Solutions (1)

    Accepted Solutions (1)

    0 Kudos

    Postback still works for other routines than for viewing, the point is to keep the session hooked to the routine, works the same for exporting etc. Any communication between the Report Object and the session needs to be in sync with the object using postback.

    Another option is to use Threading, CR use STA model, so for each report put it into a thread and complete the thread before the next one, up to 3 threads is about the limit, anything more than that and you take a hit on performance.

    Next update is to use CR Server or the full BOE and have multiple Crystal RAS servers running, or depending on the model you could use stand alone CR Server (OEM), no interface and supports only the SDK but allows multiple RAS Servers running on multiple PC's

    Contact Sales for more details and costs...

    CR for VS is limited to 3 CPL's, 3 reports at one time can be processed, crpe32 is very efficient processing reports and the default is 75 job's, but it all depends on the Reports and how long they take to process...

    Use Google and search for OEM Sizing Guide, it's good place to start.

    Another thing to look at is the Session type itself, some default to a minute timeout:

    https://docs.microsoft.com/en-us/previous-versions/iis/6.0-sdk/ms525473(v=vs.90)

    Answers (2)

    Answers (2)

    0 Kudos

    Hi Michael,

    So the typical application work flow is:

    Load defaults in the Page_Load event.

    Load CR in the Page_Init section.

    And then use Google and search for this KBA:

    1985571 - How to use sessions in web applications using the Crystal Reports viewer (the complete code)

    The likely cause is either you are spamming your are and not giving it enough time to "clean up" after each report or you are not closing/disposing each report object once it done with.

    Also, depending on the type of Session you create can also limit/set the timeout.

    You need to do more debugging if you are having issues with simply opening the report, not sure if that's due to the sessions, security, default time outs or what ever the cause may be.

    Don

    myoung1968
    Discoverer
    0 Kudos

    Hi Don,

    We don't use the report viewer, we process it as PDF and send it to our Apps UI.

    If we find we are spamming the reports what are our alternatives?

    MY

    0 Kudos

    Hi Michael,

    I believe the default IIS Session timeout is 20 minutes.

    Use the postback method to keep it alive and also use a routine to ping the server once every 10 minutes to keep the session alive Server side.

    A quick Google search found this to use Java Scripts to keep it alice:

    https://stackoverflow.com/questions/44681216/correct-way-of-keeping-user-session-alive

    Keep sessions alive is not part of our SDK, you have to maintain that.

    And yes set the open method to use OpenReportByTempCopy so the OS doesn't lock the report.

    Don

    myoung1968
    Discoverer
    0 Kudos

    Thanks Don for the help,

    Today we had 5 testers 3 in India and 2 in US. We reset IIS and immediately started testing reports. 12 minutes later the reports locked up with a 526 error. I can send you the error log of the session if you like. Thanks for the help!

    MY

    526-error.png

    524-error.png