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. General Programming
  3. Visual Basic
  4. vb.net / Crystal Report

vb.net / Crystal Report

Scheduled Pinned Locked Moved Visual Basic
csharpadobehelp
2 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.
  • P Offline
    P Offline
    partt
    wrote on last edited by
    #1

    Dim PKCalls As DataTable = DirectCast(Session("GetPKCallS"), DataTable) PKCalls = New DataTable() Dim sc As New PK.BusinessLogicLayer.Consumer() Dim tDay As Integer Dim tCall As Integer Dim DD As String Dim CallActivity As String tDay = Integer.Parse(txtPast.Text) tCall = Integer.Parse(txtCall.Text) DD = Today.AddDays(-tDay) CallActivity = Today.AddDays(-tCall) PKCalls = sc.GetPKCallSheet(txtGender.Text, txtRace.Text, lblUpDOB.Text, lblLowDOB.Text, ddlSite.SelectedItem.Value, DD, CallActivity) Session("GetPKCallS") = PKCalls Dim cr As New ReportDocument() Dim cx As New ExportOptions() cr.Load("path to Crystal Report file") cr.SetDataSource(Session("GetPKCallS")) Dim N As String N = "CallSheets" & Session("userOffice") & Now & ".rpt.PDF" N = Replace(N, Chr(32), "") N = Replace(N, ":", "") N = Replace(N, "/", "") cr.SaveAs("filepath to destination" & N, ReportFileFormat.VSNetFileFormat) *********************************** *Given the above code, I am able to send this file to where I want it. When I try to open the file I get this: "Adobe Reader could not open 'Name.rpt.PDF' because it is either not a supported file type or because the file has been corrupted" ************************************* Please help, any examples are much appreciated. Thank you.

    D 1 Reply Last reply
    0
    • P partt

      Dim PKCalls As DataTable = DirectCast(Session("GetPKCallS"), DataTable) PKCalls = New DataTable() Dim sc As New PK.BusinessLogicLayer.Consumer() Dim tDay As Integer Dim tCall As Integer Dim DD As String Dim CallActivity As String tDay = Integer.Parse(txtPast.Text) tCall = Integer.Parse(txtCall.Text) DD = Today.AddDays(-tDay) CallActivity = Today.AddDays(-tCall) PKCalls = sc.GetPKCallSheet(txtGender.Text, txtRace.Text, lblUpDOB.Text, lblLowDOB.Text, ddlSite.SelectedItem.Value, DD, CallActivity) Session("GetPKCallS") = PKCalls Dim cr As New ReportDocument() Dim cx As New ExportOptions() cr.Load("path to Crystal Report file") cr.SetDataSource(Session("GetPKCallS")) Dim N As String N = "CallSheets" & Session("userOffice") & Now & ".rpt.PDF" N = Replace(N, Chr(32), "") N = Replace(N, ":", "") N = Replace(N, "/", "") cr.SaveAs("filepath to destination" & N, ReportFileFormat.VSNetFileFormat) *********************************** *Given the above code, I am able to send this file to where I want it. When I try to open the file I get this: "Adobe Reader could not open 'Name.rpt.PDF' because it is either not a supported file type or because the file has been corrupted" ************************************* Please help, any examples are much appreciated. Thank you.

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      What CrystalReports is writing to your file is not a valid .PDF format. The version of CrystalReports that comes with Visual Studio, apparently, doesn't support .PDF. It looks like you'll have to upgrade to the full version of CR from BusinessObjects.com. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

      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