2013-04-21 1 views
1

RadPdf 컨트롤을 통해 내 PDF를 열려고하는데 렌더링 오류가 발생합니다. 나는 이벤트 뷰어를 확인하고 다음 데이터를 얻습니다. 문제를 해결하려면 C:\WINDOWS\TEMP\RadPdfTemp\을 작성해야하며 관리자는 모든 시간을 비워두고이 폴더를 제거하고 필요한만큼 내 웹 사이트에서이 폴더를 만들려고합니다. 권한은 있지만 여전히 같은 오류가 발생합니다 !!! 임시 폴더는 사용자가 PDF 파일을 열기 전에 그렇지 않으면를 만들 수있는 경우 당신은 확인해야합니다RAD PDF 서비스 메시지 작업자 스레드 알 수없는 예외

private byte[] AddReportToResponse(LocalReport followsReport) 
    { 
     string mimeType; 
     string encoding; 
     string extension; 
     string[] streams = new string[100]; 
     Warning[] warnings = new Warning[100]; 
     byte[] pdfStream = followsReport.Render("PDF", "", out mimeType, out encoding, out extension, out streams, out warnings); 


     return pdfStream; 
    } 

Event Type: Error 
Event Source: RAD PDF 
Event Category: None 
Event ID: 0 
Date:  4/21/2013 
Time:  2:33:50 PM 
User:  N/A 
Computer: ----- 
Description: 
Event Category 
----------------- 
PdfService 

Event Description 
----------------- 
RAD PDF Service Message Worker Thread Unknown Exception 
Exception Type: 
System.IO.DirectoryNotFoundException 
Exception Message: 
Could not find a part of the path 'C:\WINDOWS\TEMP\RadPdfTemp\p476.tmp'. 
Exception Stack Trace: 
    at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) 
    at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy) 
    at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share) 
    at System.IO.File.WriteAllBytes(String path, Byte[] bytes) 
    at #Ew.#Rw.#ix() 
    at #Ew.#Rw.#9w() 

Event User 
----------------- 
NT AUTHORITY\SYSTEM 

Event Version 
----------------- 
2.12.0.0 

For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp. 
+0

"관리자가 모든 시간을 비우면 임시 폴더와이 폴더가 비워집니다"라는 메시지가 다른 사람들을 도울 수 있습니다. 이게 무슨 뜻이야? 잠시 동안 문제를 수정하는'C : \ WINDOWS \ TEMP \ RadPdfTemp'를 수동으로 생성하지만, 관리자 (작업)는 주기적으로'C : \ WINDOWS \ TEMP'를 비우고,'RadPdfTemp' 서브 폴더를 지우는 것을 의미합니까? ? – J0e3gan

+0

다른 사람들을 도울 수 있도록 명확히 할만한 가치가 있습니다. "필요한 권한으로 내 웹 사이트에서이 폴더를 만들려고해도 같은 오류가 발생합니다 !!!" 따라서 웹 코드에서'C : \ WINDOWS \ TEMP \ RadPdfTemp' 파일을 만들려고 할 때 성공적으로 생성 되었습니까? 필요한 권한 - 폴더를 수동으로 만들 때 설정 한 권한은 무엇입니까? 웹 코드에서 생성하는 폴더의 경로를 작성한 다음 Windows 실행 ... 대화 상자 또는 Windows 탐색기에 붙여 넣어 시도했는지 확인 했습니까? (예상 한대로)? – J0e3gan

+1

@ J0e3gan ::'잠시 동안 문제를 해결하는 C : \ WINDOWS \ TEMP \ RadPdfTemp를 직접 만들었지 만, 관리자 (작업)가 간격을두고 C : \ WINDOWS \ TEMP를 비우고 RadPdfTemp 하위 폴더 ? ' 예, 이것이 제가 한 것입니다. –

답변

3

:


this.rad_pdf.CreateDocument("Document Name", pdfData); 

나는 통해 pdfData를 얻을. 그러면 폴더가 있는지 확인되고 예외가 발생하지 않습니다.

string tempDirectory = Path.Combine(Path.GetTempPath(), "RadPdfTemp"); 

if (!Directory.Exists(tempDirectory)) 
    Directory.CreateDirectory(tempDirectory); 

this.rad_pdf.CreateDocument("Document Name", pdfData); 
관련 문제