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. Passing Date parameters to crystal reports in asp.net application

Passing Date parameters to crystal reports in asp.net application

Scheduled Pinned Locked Moved ASP.NET
questioncsharpasp-nethelp
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.
  • F Offline
    F Offline
    frank21
    wrote on last edited by
    #1

    I am looking for some help in passing a start and end date parameter to a crystal report from within an asp.net application. I currently have an aspx page with two calender objects one for start date and one for end date. When the user selects both a start date and an end date I want to pass these values to my crystal report so that the data the user sees in the report is filtered by these dates. I currently have this code: ParameterField1.ParameterFieldName = "SelectedFilterDates"; ParameterRangeValue RangeValue = new CrystalDecisions.Shared.ParameterRangeValue(); RangeValue.StartValue = (DateTime)Session["StartDate"]; RangeValue.EndValue = (DateTime)Session["EndDate"]; ParameterField1.CurrentValues.Add(RangeValue); ParameterFields.Add(ParameterField1); CrystalReportViewer1.ParameterFieldInfo = ParameterFields; CrystalReportViewer1.ReportSource = CurrentReport; Will this code work? I am not exactly sure what I need to add to the report as far as parameter fields? Please help if you can! Another question, if I have a report with more than one date field can I switch which date field the parameters are used in? What if the user selects a date range that is not in the range within the values of the report? Thanks for helping out a newbie! Frank

    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