Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > .NET > .NET 1.0 and Visual Studio.NET > VS.NET 2002/2003
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Closed Thread
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old September 8th, 2003, 04:43 AM
Registered User
 
Join Date: Sep 2003
Location: , , .
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
}
}

Closed Thread


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 10:47 PM.


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