Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Print Button shows error from Crystal viewer in asp.net 2.0 application after deploying to live server

Posted on 2008-10-18
3
614 Views
Last Modified: 2013-11-07
We have deployed our asp.net 2.0 application onto the live server. We are using Crystal Reports XI Release 2 for the reports and displaying the same in Crystal viewer. When user clicks Report the viewer displays the report correctly. When user clicks Print button on the viewer control, he gets the first screen where he clicks ok and gets a dialog box for Open / Save pdf. When he clicks open, we get error, in one pc is displays - There was an error opening this document, this file could not be found, in Another it displays Access is denied - with a path to c:\windows\temp\...
0
Comment
Question by:venkatca
  • 2
3 Comments
 
LVL 100

Expert Comment

by:mlmcc
ID: 22748655
Check the permissions on the server C:\Windows\temp directory.

mlmcc
0
 
LVL 1

Author Comment

by:venkatca
ID: 22751077
Already given permissions to IUSR and Network Services to c:\windows\temp directory. Also by default crystal viewer print option in asp.net 2.0 opens a dialog box to open the file in acrobat reader from where the user can print. The acrobat reader opens and then the message file cannot be found is displayed from within the reader if user chooses to Open it. If saved and opened, there is no problem.
0
 
LVL 1

Accepted Solution

by:
venkatca earned 0 total points
ID: 22802870
We finally created our own solution for this by opening the adobe reader ourselves instead of using the default provided by crystal viewer.

For this we created a print button on the form and disabled the print button on the viewer.

The print button code is below
    Protected Sub btnPrint_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnPrint.Click
        Session.Add("ReportSource", rep)
        Dim strpop As String = ""
        strpop = "window.open('RptPrintPage.aspx','PopUpPrint','width=1010,height=650 left=0,top=0 scrollbars=yes,status=yes');"
        ScriptManager.RegisterClientScriptBlock(Page, GetType(Page), "popup", strpop, True)
    End Sub

And in the rptprintpage.aspx which shows the report in pdf for printing, we added the following in page init


    Protected Sub Page_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init
        Try
            rep = New ReportDocument()
            If Session("ReportSource") Is Nothing = False Then
                rep = CType(Session("ReportSource"), ReportDocument)
            End If

            Response.Buffer = False
            Response.ClearContent()
            Response.ClearHeaders()
            rep.ExportToHttpResponse(ExportFormatType.PortableDocFormat, Response, False, "Report")

        Catch ex As Exception

        End Try
    End Sub
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

838 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question