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. Database & SysAdmin
  3. Database
  4. PDF Problem

PDF Problem

Scheduled Pinned Locked Moved Database
helpcsharpdatabasesysadminquestion
1 Posts 1 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.
  • S Offline
    S Offline
    simworld
    wrote on last edited by
    #1

    this problem already this in this forum,but my problem still be there,I googled the following code, and try to run,but did not work. --------------------------------------- CrystalReport1 report=new CrystalReport1(); CrystalDecisions.Shared.TableLogOnInfo myLogin; foreach (CrystalDecisions.CrystalReports.Engine.Table myTable in report.Database.Tables) { myLogin = myTable.LogOnInfo ; myLogin.ConnectionInfo.Password = "123456" ; myLogin.ConnectionInfo.UserID = "sa" ; myTable.ApplyLogOnInfo(myLogin) ; } CrystalReportViewer1.ReportSource=Server.MapPath("CrystalReport1.rpt"); CrystalReportViewer1.DataBind(); CrystalReportViewer1.RefreshReport(); CrystalDecisions.Shared.DiskFileDestinationOptions diskOpts = new CrystalDecisions.Shared.DiskFileDestinationOptions(); report.ExportOptions.ExportDestinationType = CrystalDecisions.Shared.ExportDestinationType.DiskFile; report.ExportOptions.ExportFormatType = CrystalDecisions.Shared.ExportFormatType.PortableDocFormat; diskOpts.DiskFileName =Server.MapPath("Output.pdf"); report.ExportOptions.DestinationOptions = diskOpts; report.Export(); Response.AddHeader("Content-Disposition","attachment;filename=Output.pdf"); Response.ContentType = "application/pdf"; Response.WriteFile("C:\\Inetpub\\wwwroot\\temp\\"+ "Output.pdf"); Response.End(); Response.ClearContent(); Response.ClearHeaders(); Response.Buffer = false; Download option is comming,when trying to open that pdf file after downloading or just trying to open. Error Meassage is ...... "There is an error Opening this Document.The File is damaged and could not be Repaired." --- NOTE::: In Crystal Report Viewer the data is showed. How can I solve that.I am using .Net version 2003

    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