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. Passing database login info to Crystal report - problem going to production

Passing database login info to Crystal report - problem going to production

Scheduled Pinned Locked Moved C#
databasedesignsecurityhelpworkspace
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.
  • J Offline
    J Offline
    jamesc69
    wrote on last edited by
    #1

    Firstly, I have this working in development, however when I publish to the production webserver, instead of generating the report, it asks me for login credentials again. Here is a snapshot of my entire code behind file: using System; using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using CrystalDecisions.CrystalReports.Engine; using CrystalDecisions.Shared; public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { if ((ViewState["ParametersShown"] != null) && (ViewState["ParametersShown"].ToString() == "True")) { ReportListing myListing = new ReportListing(); BindReport(ConfigurationManager.AppSettings["reportlocation"].ToString() + myListing.GetReportFileName(Session["Report"].ToString())); } } protected void btnBuild_Click(object sender, EventArgs e) { CrystalReportViewer1.ParameterFieldInfo.Clear(); DateTime startDate = DateTime.Parse(Session["FromDate"].ToString()); DateTime endDate = DateTime.Parse(Session["ToDate"].ToString()); ParameterFields paramFields = new ParameterFields(); ParameterField crStartDate = new ParameterField(); ParameterField crEndDate = new ParameterField(); crStartDate.Name = "@StartDate"; crEndDate.Name = "@EndDate"; ParameterDiscreteValue dcrStartDate = new ParameterDiscreteValue(); ParameterDiscreteValue dcrEndDate = new ParameterDiscreteValue(); dcrStartDate.Value = startDate; dcrEndDate.Value = endDate; crStartDate.CurrentValues.Add(dcrStartDate); crEndDate.CurrentValues.Add(dcrEndDate); paramFields.Add(crStartDate); paramFields.Add(crEndDate); ReportListing myListing = new ReportListing(); BindReport(ConfigurationManager.AppSettings["reportlocation"].ToString() + myListing.GetReportFileName(Session["Report"].ToString())); CrystalReportViewer1.ParameterFieldInfo = paramFields; ViewState["ParametersShown"] = "True"; ViewState["ReportName"] = Session["Report"].ToString(); } private void BindReport(string FilePath) { ReportDocument Report = new ReportDocumen

    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