Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > .NET 1.0 and Visual Studio.NET > VS.NET 2002/2003
|
VS.NET 2002/2003 Discussions about the Visual Studio.NET programming environment, the 2002 (1.0) and 2003 (1.1). ** Please don't post code questions here ** For issues specific to a particular language in .NET, please see the other forum categories.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VS.NET 2002/2003 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 8th, 2003, 04:43 AM
Registered User
 
Join Date: Sep 2003
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to display description of default values

Hi!,

I am trying to display the description of default values specified for the parameters in the crystal report using c#. I could display only the default

values but not the descriptions.

The code attached below works fine and displays the default values.

Any help will be highly appreciated.

Many thanks in advance,
Braja

-----------------------------------------------------------------
using System;
using System.Collections;
using System.ComponentModel;
using System.Configuration;
using System.Data;
using System.IO;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using CrystalDecisions.Shared;
using CrystalDecisions.CrystalReports.Engine;
using CrystalDecisions.Web;
using CrystalDecisions.ReportAppServer.ClientDoc;
using CrystalDecisions.ReportAppServer.CommonControls;

namespace ReportViewer
{
/// <summary>
/// Summary description for Test.
/// </summary>

public class Test : System.Web.UI.Page
{

private void Page_Load(object sender, System.EventArgs e)
{

//Load the report into the report document
ReportDocument crReportDocument = new ReportDocument();
crReportDocument.Load("MyReport.rpt");

ParameterValues crParameterValues = new ParameterValues();
ParameterDiscreteValue crParameterDiscreteValue = new ParameterDiscreteValue();

foreach(ParameterFieldDefinition crParameterFieldDefinition in crReportDocument.DataDefinition.ParameterFields)
{

if(crParameterFieldDefinition.DefaultValues.Count > 0)
{

Response.Write("<select name='Prompt' size='1'>");

for(int i=0;i<crParameterFieldDefinition.DefaultValues.Cou nt;i++)
{
crParameterDiscreteValue = (ParameterDiscreteValue) crParameterFieldDefinition.DefaultValues[i];
Response.Write("<option Value='" + crParameterDiscreteValue.Value + "'>" + crParameterDiscreteValue.Value + "</option>");
}

Response.Write("</select>");
}

}

}

#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();
base.OnInit(e);
}

/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
}
}






Similar Threads
Thread Thread Starter Forum Replies Last Post
Default Namespace does not display elements. AjayLuthria XSLT 2 April 17th, 2007 10:11 AM
read field description and display on webpage wpiass Access ASP 7 October 5th, 2005 06:41 AM
Default values? Raymie_C Access VBA 2 May 16th, 2005 11:48 AM
Default Values davest Access VBA 2 October 19th, 2004 05:57 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.