in Search
ATTENTION: I've decided to put the upgrade on hold due to a compatibility issue of our server environment with the latest CS installer package. CS 2008 now requires SQL Server 2005 as the backend DB but our database server currenlty has SQL Server 2000 installed on it. I'll resume the upgrade once I figure out when Telligent is releasing a patch to the schema compatibility issue. For now, we will continue to use the old version of CS while waiting for the said patch. If you have any questions about this process, please don't hesitate to post them on our forums and I'll answer them as soon as I can. Thanks for your patience and support guys! I'll let you know as soon as this is resolved. - Keith Rull
Latest post 08-08-2008 5:12 AM by euo. 5 replies.
Page 1 of 1 (6 items)
Sort Posts: Previous Next
  • 07-29-2008 2:40 PM

    • drizzle
    • Top 500 Contributor
    • Joined on 07-29-2008
    • Posts 3
    • Points 60

    asp.net/c# help with crystal reports.

    Hi. Im currently doing my thesis and im suppose to generate monthly reports about our sales. Im having a hard time filtering the date. Yung gusto ko po kasi mangyari is that, may 2 textboxes. yung isang textbox is FROM: (date), the other one is TO:(date).. then when i click the "generate" button, it will show the report. I have no idea on how to do it. I have very basic knowledge about the language and im not that good and experienced in programming. Any kind of help will do. Thanks!

    • Post Points: 20
  • 07-29-2008 4:37 PM In reply to

    • marl
    • Top 10 Contributor
    • Joined on 12-15-2007
    • Long Beach, CA
    • Posts 319
    • Points 3,995

    Re: asp.net/c# help with crystal reports.

    any specific problem? Saan ka ba may problema?

    devpinoy sig
    • Post Points: 20
  • 07-29-2008 9:06 PM In reply to

    • drizzle
    • Top 500 Contributor
    • Joined on 07-29-2008
    • Posts 3
    • Points 60

    Re: asp.net/c# help with crystal reports.

    all i get is "missing parameter values".. here is my code.. I dont know how to replace the codes that are commented out..

    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 System.Data.SqlClient;

    using CrystalDecisions.CrystalReports.Engine;
    using CrystalDecisions.Shared;

    public partial class test : System.Web.UI.Page
    {
        string connstring = ConfigurationManager.ConnectionStrings["JDIConnectionString"].ConnectionString;

        protected void Page_Load(object sender, EventArgs e)
        {
           
        }

        private void ConfigureCrystalReports()
        {
            string reportPath = Server.MapPath("ProductByCategory.rpt");
            crystalreport.ReportSource = reportPath;

            string StartDate;
            string EndDate;

            //ParameterFields parameterFields = crystalreport.ParameterFieldInfo;

            ConnectionInfo connectionInfo = new ConnectionInfo();

            connectionInfo.DatabaseName = "JDI";
            connectionInfo.ServerName = "JOSHMC/SQLEXPRESS";
            connectionInfo.IntegratedSecurity = true;

            //if (!IsPostBack)
            //{
            //    Session["StartDate"] = StartDate;
            //    Session["EndDate"] = EndDate;
            //}
            //else
            //{
            //    StartDate = Session["StartDate"].ToString();
            //    EndDate = Session["EndDate"].ToString();
            //}


        }

        private void Page_Init(object sender, EventArgs e)
        {
            ConfigureCrystalReports();
        }

        private void SetDBLogonForReport(ConnectionInfo connectionInfo)
        {
            TableLogOnInfos tableLogOnInfos = crystalreport.LogOnInfo;

            foreach (TableLogOnInfo tableLogOnInfo in tableLogOnInfos)
            {
                tableLogOnInfo.ConnectionInfo = connectionInfo;
            }

            SetDBLogonForReport(connectionInfo);
        }

        protected void Calendar1_SelectionChanged(object sender, EventArgs e)
        {
            txtboxFROM.Text = Calendar1.SelectedDate.ToShortDateString();
            txtboxTO.Text = Calendar1.SelectedDate.ToShortDateString();
        }


        protected void btnGenerate_Click(object sender, EventArgs e)
        {
            crystalreport.Visible = true;

            txtboxFROM.Text = Calendar1.SelectedDate.ToShortDateString();
            txtboxTO.Text = Calendar1.SelectedDate.ToShortDateString();

            //ArrayList arrayList = new ArrayList();

            //foreach (ListItem item in supplierlist.Items)
            //{
            //    if (item.Selected)
            //    {
            //        arrayList.Add(item.Value);
            //    }
            //}

            //Session["arrayList"] = arrayList;

            Session["StartDate"] = txtboxFROM.Text;
            Session["EndDate"] = txtboxTO.Text;
            ConfigureCrystalReports();
        }
    }

    • Post Points: 20
  • 07-29-2008 9:23 PM In reply to

    • xyz
    • Top 200 Contributor
    • Joined on 07-29-2008
    • Posts 5
    • Points 55

    Re: asp.net/c# help with crystal reports.

     I have not explored Crystal Report bundled with the latest Visual Studio but using VS 2003 .NET Framework 1.1 this is how we assign a value to Report Parameter.

    report.SetParameterValue("ParamName", CType(ParamValue, DateTime))

    the above code assumes that your ParamValue is in Type String, kung ang ParamValue mo is in Date na you can use the code below.

    report.SetParameterValue("ParamName", ParamValue)

     

    Filed under:
    • Post Points: 20
  • 07-30-2008 1:19 AM In reply to

    • drizzle
    • Top 500 Contributor
    • Joined on 07-29-2008
    • Posts 3
    • Points 60

    Re: asp.net/c# help with crystal reports.

    I dont know how to set my parameters and how to configure the select expert at the field report explorer in the crystal reports. Is there any way i can manually code my select expert?

    • Post Points: 20
  • 08-08-2008 5:12 AM In reply to

    • euo
    • Top 500 Contributor
    • Joined on 10-06-2006
    • Posts 1
    • Points 5

    Re: asp.net/c# help with crystal reports.

    ..you may want to try to pass your dates as parameters upon retrieving the records from your database so that the dataset you're going to LOAD to the reportdocument is already filtered..

     

    • Post Points: 5
Page 1 of 1 (6 items)