sept. 11

Crystal Reports may generate some temporary files ('*.tmp', '*.rpt') in a temp folder (typically the c:\windows\temp folder or you temp folder in "Local Settings"). This is not a big deal because these files are quite small (between 0k and 200k for the ones I have seen during my investigations) but it can be a potential problems as they are very numerous (till 10 for a single export) and contains some potentially sensitive information (some data of your exports).

I have seen that these files are generated by the following methods:

  • SetDataSource
  • ExportToStream

How to correct this problem ?

  • Be sure to call the "Close()" method on your report object. This will automatically delete all the temporary generated files. In fact almost all of them as you will still have a "temp_xxx.rpt" file generated, even if you call the ExportToStream method.
  • Be sure to call the "Dispose()" method so Crystal Reports will release all the locks it may have on the object and the last generated file will be deleted

Of course, you could call only the "Dispose()" method as it will call internally the "Close()" method, or even not calling any of them but using the "using" syntax

Commentaires

Mohammed Aquil

Posted on mercredi, 18 juin 2008 08:38

Hi
I am facing one issue related to InprocServer/TempDir in the Windows Registry.

I have to do an implementation of one of our Intranet Solution in Canada. The application is developed using ASP.Net.

We are using Crystal Report to create reports. You must be aware that while generating the reports Crystal Report uses C:\Windows\Temp for writing temporary files. The problem is the client does not want us to use that folder for security reasons.

We tried entering the values in the windows registry in the InprocServer/TempDir but it throws an exception "Error in File UNKNOWN.RPT:
The request could not be submitted for background processing."
Can you tell me what do I have to do inorder to handle this error.

pe.dautreppe

Posted on mardi, 15 juillet 2008 19:21

Hola Mohammed !

Sorry for the late reply but I was in holidays !
Sorry but I cannot help you in your problem, I didn't know we could configure the temporary path in the registry.

Have you seen another solution in the meanwhile ?

busby seo test

Posted on mardi, 13 janvier 2009 11:56

nice post thanks for the information its great

Doctor is Out

Posted on samedi, 21 mars 2009 23:25

still the the two method -ExportToStream - SetDataSource is working
  

Naveen

Posted on jeudi, 26 mars 2009 21:14

HI!!!
I am using following code but still temp RPT file exist in "C:\Windows\Temp". Due to this I am getting following Error "The maximum report processing jobs limit configured by your system administrator has been reached."

Code

DailyCollection cr = new DailyCollection();

        protected void Page_Load(object sender, EventArgs e)
        {
            cr.SetDataSource(ds.Tables["DailyFeeCollection"]);
            CrystalReportViewer1.ReportSource = cr;
                  
         }

        private void Page_Unload(object sender, EventArgs e)
        {
            CloseReports(cr);
            cr.Dispose();
            CrystalReportViewer1.Dispose();
            CrystalReportViewer1 = null;
            
        }


        private void CloseReports(ReportDocument reportDocument)
        {
            Sections sections = reportDocument.ReportDefinition.Sections;
            foreach (Section section in sections)
            {
                ReportObjects reportObjects = section.ReportObjects;
                foreach (ReportObject reportObject in reportObjects)
                {
                    if (reportObject.Kind == ReportObjectKind.SubreportObject)
                    {
                        SubreportObject subreportObject = (SubreportObject)reportObject;
                        ReportDocument subReportDocument = subreportObject.OpenSubreport(subreportObject.SubreportName);
                        subReportDocument.Close();
                    }
                }
            }
            reportDocument.Close();
        }

ferron

Posted on jeudi, 6 août 2009 02:18

There are two things you need to do.

What i did was to in the  registry key edit

HKEY_LOCAL_MACHINE\SOFTWARE\Crystal Decisions\10.2\Report Application Server\Server\PrintJobLimit  and change it to -1


To clean up my temp file i wrote a batch script which is run every 30 minutes

@echo off
echo Job start on %date% at %time% under %UserName% >> c:\fgmis\scripts\Log.txt
taskkill /F /IM w3wp.exe
del /Q c:\windows\temp\*.*
echo "%date% : Deleted windows\temp files" >> c:\fgmis\scripts\deltemp.log


At first when i tried deleted i realised the file was been locked, so downloaded unlocker and found out that w3wp.exe was locking the file

I added the taskkill command and /F to forcefully kill the task. It works perfectly for me

Kashif Rana

Posted on jeudi, 5 novembre 2009 17:50

vote down
  

The other temp directory than C:/windows/temp should be located in your web site's virtual directory. Just add that temp folder in your web site's directory and when you make its virtual path to host it on IIS , it automatically gets included. If you want to make it at some other place like at D:/CrystalTEmp, you need to add this folder in your Inetmgr, just right click this directory and enable its web sharing. And yes you need to give Network service full rights over this temp folder.

If your placing your web site directory in inetpub/wwwroot, then you dont need to give rights to network service.

Ajouter un commentaire




biuquote
  • Commentaire
  • Aperçu immédiat
Loading