p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   VS.NET 2002/2003 (http://p2p.wrox.com/forumdisplay.php?f=103)
-   -   How to display description of default values (http://p2p.wrox.com/showthread.php?t=3594)

Braja Nayak September 8th, 2003 04:43 AM

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
}
}



All times are GMT -4. The time now is 07:50 PM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.