0

So i have an web application, published and deployed on IIS some pages of my web application work flawlessly while others mostly the ones with a report is causing issues.

1) So i click the link for the report, The report gets generated YAY!!! enter image description here

2) so the blue print button uses iTextSharp to convert to pdf and print, basically reads the data in the reportviewer, converts it to pdf, and opens with the print catalog, the below picture was taken from my local machine.

enter image description here

3) when i click on the print button from the server i get this enter image description here

4) After i provide the credentials i get this error page enter image description here

The error spoke about turning custom error = off i did that also in my web.config file but the results are still the same. This same error also pops up when i insert data into the database from my application.

I Beg Help as i tried most of the options, from folder security, to identity impersonation because the data is on another server. basic authentication because on of the online articles said that identity impersonation goes well with basic authentication. enter image description here Edit

after the customError mode was turned off, this was the error behind it. So now more research online

I tried creating an user called NetWork Service and gave that full control to the folder and the files will inherit the permission that of the folders. i went to the virtual directory under iis and gave access for directory browsing but it is still not able to access the output.pdf, some one suggested why not change the location to the App_Data folder i did that also, but it is still denying me access, i know if not a database error because i can see the data in the report, it is not a .dll problem because the itextsharp.dll is referenced in the project, hmm it is definitely an authentication/security to the folder issue, any other suggestions will be generously appreciated.

HackMaster
  • 99
  • 2
  • 14
  • If you believe that you followed the directions on the yellow screen of death and they're not working, then you should post your configuration here for us to look at. – mason Mar 18 '15 at 00:27
  • Can you reproduce the problem on browsers other than MSIE? As soon as you can see the PDF, the PDF bytes reside on your client machine. There is no reason to connect to the server once more if you want to print the PDF, unless the browser forces you to. MSIE is notorious for doing stuff like that. Also: have you tried this on other machines? I'm pretty sure it can't be reproduced on all clients. – Bruno Lowagie Mar 18 '15 at 09:02
  • @mason actually it was a dumb mistake on my end, the above code presented in the yellow screen of death was posted on a commented section of my web.config hence it was not effective lol, now i am able to see the error and it has to do with not having security permissions on the virtual directory access by IIS :( – HackMaster Mar 18 '15 at 16:01
  • @HackMaster You should post that as the answer. – mason Mar 18 '15 at 16:04
  • @mason are you familiar with virtual directory security settings so should i post the above edit as a question in itself?? – HackMaster Mar 18 '15 at 16:12
  • I am familiar with the settings, so no need to do a separate question. – mason Mar 18 '15 at 16:16
  • so i created a virtual directory pointing to the folder D:\WebApps30\WWWNetWeightApplication so from the error it says access denied to the path above + the output.pdf file the security permission on the pdf file is full control and folder has full control and under Web Sharing tab i have enabled access permissions to read and directory browsing, i have never given write access, so do you believe that to be the reason, if i just click on the write permission it pops up a threatening message saying that user will upload harmful contents, etc :) do you have any other suggestions – HackMaster Mar 18 '15 at 16:28
  • @BrunoLowagie yes this issue is happening at all client machine, because of no access to the folder and it is not able to read the output generated but iTextSharp since the access is denied to the above folder. – HackMaster Mar 18 '15 at 16:30
  • @HackMaster Why would you create the PDF in a (virtual) directory? Isn't it easier to create the PDF in memory and serve that to the browser? This way you do not need any (virtual) disk access. – Bruno Lowagie Mar 18 '15 at 16:56

1 Answers1

0

So this fixed my issue of the yellow screen of death with the customErrors mode ="Off"

The reason you want to turn off the customErrors mode to Off is so that one can see the actual error happening at the server.

Before:

  -->
 <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
            <error statusCode="403" redirect="NoAccess.htm" />
            <error statusCode="404" redirect="FileNotFound.htm" />  

        <customErrors mode="Off"/>

Solution :

Make sure you not posting the code in an commented section of the web.config

Remove the "-->" and now you will see the actual error.

HackMaster
  • 99
  • 2
  • 14