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. C#
  4. Printing Crystal reports

Printing Crystal reports

Scheduled Pinned Locked Moved C#
questionhelp
2 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
    sharon
    wrote on last edited by
    #1

    Hello, I am trying to pring a crystal report with parameters without previewing it first. I succeeded to pring report without parameters with the ReportDocument object. I succeeded also to print report with parameters (I inserted parameters to ParameterFields and put it in crystalReportViewer.ParameterFieldInfo) from the CrystalReportViewer but in this way the report is open in another window, and then I print it from the object. But I want to print the report with the parameters without showing it on screen first, how can I do it? Thank u for any help, sharon

    S 1 Reply Last reply
    0
    • S sharon

      Hello, I am trying to pring a crystal report with parameters without previewing it first. I succeeded to pring report without parameters with the ReportDocument object. I succeeded also to print report with parameters (I inserted parameters to ParameterFields and put it in crystalReportViewer.ParameterFieldInfo) from the CrystalReportViewer but in this way the report is open in another window, and then I print it from the object. But I want to print the report with the parameters without showing it on screen first, how can I do it? Thank u for any help, sharon

      S Offline
      S Offline
      sharon
      wrote on last edited by
      #2

      ok I did it : ReportDocument report = new ReportDocument(); report.Load(@"G:\Rp3Receipt.rpt",OpenReportMethod.OpenReportByTempCopy); ParameterFieldDefinitions parametersColl = report.DataDefinition.ParameterFields; ParameterFieldDefinition paramName1 = parametersColl["prmNameInReport1"]; ParameterFieldDefinition paramName2= parametersColl["prmNameInReport2"]; ParameterValues values = new ParameterValues(); ParameterDiscreteValue val = new ParameterDiscreteValue(); val.Value = paramValue1;// the value I want to give the parameter values.Add(val); paramName1.ApplyCurrentValues(values); //-----------second parameter values = new ParameterValues(); val = new ParameterDiscreteValue(); val.Value = paramValue2; values.Add(val); paramName2.ApplyCurrentValues(values); report.PrintOptions.PrinterName = @"\\...\HPLaserJ5"; report.PrintToPrinter(1,false,1,1);

      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