Calendar

<<  mars 2010  >>
lumamejevesadi
22232425262728
1234567
891011121314
15161718192021
22232425262728
2930311234

View posts in large calendar
Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2010

(septembre 11, 2007 12:26)

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

Billets liés

Commentaires

juin 17. 2008 23: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.

Mohammed Aquil

juillet 15. 2008 10: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 ?

pe.dautreppe

janvier 13. 2009 02:56

nice post thanks for the information its great

busby seo test

mars 21. 2009 14:25

still the the two method -ExportToStream - SetDataSource is working

Doctor is Out

mars 26. 2009 12: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();
}

Naveen

août 5. 2009 17: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

ferron

novembre 5. 2009 08: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.

Kashif Rana

Ajouter un commentaire


 

  Country flag





Live preview

mars 10. 2010 15:27

Powered by BlogEngine.NET 1.2.0.0 | Theme by Pierre-Emmanuel Dautreppe