Report Design
 Crystal Reports Forum : Crystal Reports for Visual Studio 2005 and Newer : Report Design
Message Icon Topic: VS2005 Crystal Paremeters Post Reply Post New Topic
Author Message
Smitty200
Newbie
Newbie
Avatar

Joined: 02 Feb 2007
Online Status: Offline
Posts: 1
Quote Smitty200 Replybullet Topic: VS2005 Crystal Paremeters
    Posted: 02 Feb 2007 at 8:55am

I have a report that was written in Crystal XI and it takes two parameters. Both are date's. I imported the report into a vs2005 web app. The prompt screen for the two parameters comes up and displays two text boxes with calendar controls. When dates are selected they are entered into the text boxes in this format "Friday, February 2 2007" how can i change the format to 2/2/2007. Any help would be appreciated.

IP IP Logged
BrianBischof
Admin Group
Admin Group
Avatar

Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Quote BrianBischof Replybullet Posted: 02 Feb 2007 at 12:50pm
Are you saying that it shows the Crystal Reports long date format in the parameter prompt dialog box or when it is displayed on the report output?

Some things to try are going into Report | Options to change the default date settings. Also change your system settings for the default date format. Another thing to consider, you have to set the date format BEFORE creating the date fields. Setting the format doesn't go back and change the format of existing report variables, only new ones.
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>
IP IP Logged
EdwardQ
Newbie
Newbie
Avatar

Joined: 12 Apr 2007
Location: United States
Online Status: Offline
Posts: 14
Quote EdwardQ Replybullet Posted: 11 May 2007 at 1:08pm
What I done for parameters is created a MulitView page that has the Crystal view in view2.   View1 has 2 Calendar controls for the user to select the date and a button to run the report.   This removes the "Opps I put the date in wrong".
 
code behind
public partial class Vehicle_Reports_RepairsByVIN : System.Web.UI.Page
{
    ReportDocument MainRpt = new ReportDocument();
 
 protected void Page_Load(object sender, EventArgs e)
  {
      if (mvMain.ActiveViewIndex == 1)
          Report_Load();
  }
 
  protected void Page_UnLoad(object sender, EventArgs e)
  {
      MainRpt.Close();
  }
 
  protected void Report_Load()
  {
        MainRpt.Load(Server.MapPath("RepairsByVIN.rpt"));
 
        string StartDate = CalStart.SelectedDate.ToShortDateString();
        string EndDate = CalEnd.SelectedDate.ToShortDateString();
       
        MainRpt.SetParameterValue("StartDate", StartDate);
        MainRpt.SetParameterValue("EndDate", EndDate);
        
        MainRpt.SetDatabaseLogon("user", "userpassword", "SQLServer", "DBName");
 
        CrvReportViewer.ReportSource = MainRpt;


  }
 
   protected void BtnRunReport_Click(object sender, EventArgs e)
  {
      if (CalStart.SelectedDate < CalEnd.SelectedDate)
      {
          mvMain.ActiveViewIndex = 1;
          Report_Load();
      }
      else
          lblError.Text = "Please Choose a Start Date before a End Date.";

  }
 
 
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.016 seconds.