Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Unable to run a report from client PC...

Unable to run a report from client PC...

Scheduled Pinned Locked Moved ASP.NET
visual-studiosysadminhelp
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    MissionSuccess
    wrote on last edited by
    #1

    Respected Sir, I have developed a web application in VS 2005. It has a report created in Crystal report. It works fine on my development machine or even on my web server (while the project is running locally on web server itself). But i am not able to get that repport after deploying the project on my server and accessing from client. i am using the URL like http://PublicIP/ProjectName/frmLogin.aspx It shows me the error "Load Report Failed." I have googled a lot but can not get any idea.... My code is------ Dim rptRefForm As RptShowRefForm Dim ref_no, year As Integer Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load If Not Page.IsPostBack Then ShowReport() End If End Sub Private Sub ShowReport() Try conn = New SqlConnection(constr) cmd = New SqlCommand("spr_getReport", conn) cmd.CommandType = CommandType.StoredProcedure cmd.Parameters.Add(New SqlParameter("@ref_no_toShow", Glb_RefNo)) cmd.Parameters.Add(New SqlParameter("@FinYear", Glb_FinYearFrom)) dadapter = New SqlDataAdapter(cmd) ds = New DataSet dadapter.Fill(ds) rptRefForm = New RptShowRefForm rptRefForm.Refresh() rptRefForm.SetDataSource(ds.Tables(0)) rptRefForm.SetDatabaseLogon("DBUserName", "DBPWD") CrystalReportViewer1.ReportSource = rptRefForm CrystalReportViewer1.DataBind() conn.Close() Catch ex As Exception lblError.Text = ex.Message End Try End Sub And on click of a button i want to export this report in to PDF format... for that i m using... Private Sub btnExport_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExport.Click Dim oStream As New MemoryStream ' // using System.IO 'this contains the value of the selected export format. ShowReport() oStream = rptRefForm.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat) Response.Clear() Response.Buffer = True Response.ContentType = "application/pdf" Try Response.BinaryWrite(oStream.ToArray()) Response.End() Catch err As Exception Response.Write("< BR >") Response.Write(err.Message.ToString)

    M 1 Reply Last reply
    0
    • M MissionSuccess

      Respected Sir, I have developed a web application in VS 2005. It has a report created in Crystal report. It works fine on my development machine or even on my web server (while the project is running locally on web server itself). But i am not able to get that repport after deploying the project on my server and accessing from client. i am using the URL like http://PublicIP/ProjectName/frmLogin.aspx It shows me the error "Load Report Failed." I have googled a lot but can not get any idea.... My code is------ Dim rptRefForm As RptShowRefForm Dim ref_no, year As Integer Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load If Not Page.IsPostBack Then ShowReport() End If End Sub Private Sub ShowReport() Try conn = New SqlConnection(constr) cmd = New SqlCommand("spr_getReport", conn) cmd.CommandType = CommandType.StoredProcedure cmd.Parameters.Add(New SqlParameter("@ref_no_toShow", Glb_RefNo)) cmd.Parameters.Add(New SqlParameter("@FinYear", Glb_FinYearFrom)) dadapter = New SqlDataAdapter(cmd) ds = New DataSet dadapter.Fill(ds) rptRefForm = New RptShowRefForm rptRefForm.Refresh() rptRefForm.SetDataSource(ds.Tables(0)) rptRefForm.SetDatabaseLogon("DBUserName", "DBPWD") CrystalReportViewer1.ReportSource = rptRefForm CrystalReportViewer1.DataBind() conn.Close() Catch ex As Exception lblError.Text = ex.Message End Try End Sub And on click of a button i want to export this report in to PDF format... for that i m using... Private Sub btnExport_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExport.Click Dim oStream As New MemoryStream ' // using System.IO 'this contains the value of the selected export format. ShowReport() oStream = rptRefForm.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat) Response.Clear() Response.Buffer = True Response.ContentType = "application/pdf" Try Response.BinaryWrite(oStream.ToArray()) Response.End() Catch err As Exception Response.Write("< BR >") Response.Write(err.Message.ToString)

      M Offline
      M Offline
      Marco van der Linden
      wrote on last edited by
      #2

      hello Ajay Kumar, I had the same error.. try installing the Crystal Reports for .NET Framework 2.0 it works for me now http://msdn2.microsoft.com/en-us/library/ms225293(VS.80).aspx[^] Greetings, Marco van der Linden :)

      M 2 Replies Last reply
      0
      • M Marco van der Linden

        hello Ajay Kumar, I had the same error.. try installing the Crystal Reports for .NET Framework 2.0 it works for me now http://msdn2.microsoft.com/en-us/library/ms225293(VS.80).aspx[^] Greetings, Marco van der Linden :)

        M Offline
        M Offline
        MissionSuccess
        wrote on last edited by
        #3

        Hello Sir I have already installed Crystal reports for .Net Framework 2.0. But still the same error.. Infact i have installed VS2005 on my web server. But Of no use.... Suggest something Plz...

        1 Reply Last reply
        0
        • M Marco van der Linden

          hello Ajay Kumar, I had the same error.. try installing the Crystal Reports for .NET Framework 2.0 it works for me now http://msdn2.microsoft.com/en-us/library/ms225293(VS.80).aspx[^] Greetings, Marco van der Linden :)

          M Offline
          M Offline
          MissionSuccess
          wrote on last edited by
          #4

          Sir I m giving the stacktrace and message of my exception object which generates when i m trying to access my web site from the public IP.. StackTrace:---- at CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened() at CrystalDecisions.CrystalReports.Engine.ReportDocument.Load(String filename, OpenReportMethod openMethod, Int16 parentJob) at CrystalDecisions.CrystalReports.Engine.ReportClass.Load(String reportName, OpenReportMethod openMethod, Int16 parentJob) at CrystalDecisions.CrystalReports.Engine.ReportDocument.EnsureLoadReport() at CrystalDecisions.CrystalReports.Engine.ReportDocument.get_FormatEngine() at CrystalDecisions.CrystalReports.Engine.ReportDocument.Refresh() at Mktg_Artwork.frmDisplayRpt.ShowReport() in C:\Inetpub\wwwroot\Mktg-Artwork\frmDisplayRpt.aspx.vb:line Message:--- Load Report Failed. However i have already installed crystal reports for .net framework2.0 on web server Infact I have installed VS2005 on my web server. Still facing the above problem.. Please Sir,help me out.... Ajay Kumar

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups