Jan Schreuder on .Net

.Net code samples, experiences, observations

View my professional profile on LinkedIn

Recent Posts

Tags

News

  • Inappropriate comments will be deleted at my discretion.

    The information and code samples in this weblog is provided "AS IS" without warranty of any kind, either expressed or implied, including but not limited to the merchantability and/or fitness for a particular purpose.

Community

Email Notifications

Tool suppliers

Tools

General

Microsoft

Favorite blogs

Archives


December 2005 - Posts

How to: Set parameters on a Crystal Report

It is possible to add parameters to reports. Using these parameters you can allow users to set date ranges, or pass other information to a report. Using the following method, you can set the parameters:

/// <summary>
/// Set value for report parameters
/// </summary>
/// <param name="name">Parameter name.</param>
/// <param name="value">Value to be set for the specified parameter.</param>
public void SetParameter(string name, object value)
{
    //Access the specified parameter from the parameters collection
    CrystalDecisions.CrystalReports.Engine.ParameterFieldDefinition parameter = _reportDocument.DataDefinition.ParameterFields[name];
 
    // Now get the current value for the parameter and clear them
    CrystalDecisions.Shared.ParameterValues currentValues = parameter.CurrentValues;
    currentValues.Clear();
 
    // Create a value object for Crystal reports and assign the specified value.
    CrystalDecisions.Shared.ParameterDiscreteValue newValue = new CrystalDecisions.Shared.ParameterDiscreteValue();
    newValue.Value = value;
 
    // Now add the new value to the values collection and apply the 
    // collection to the report.
    currentValues.Add(newValue);
    parameter.ApplyCurrentValues(currentValues);
}
Java event and views on SOA

Last week, I was asked to take pictures at a Java event organized by the Java Compentence group in LogicaCmg. The event was hosted at the LogicaCmg head-office in Amstelveen. An interesting event. The java community heavily depends on open-source tools on frameworks. But a lot of times I could not help thinking that we Microsofters are better equiped. Microsoft is very good in providing tools in one integrated environment. For Java development I feel you need to depend on various tools from various providers. Integrations is still not as advanced. But correct me if I'm wrong.

I was there like a real paparazi. Obviously, I was wearing a Microsoft shirt to the event. The picture below shows some of our java colleagues at the bar, after the event.

The reason for this post however is that the Java compentence also has it's own weblog, which you can find at http://www.bloggingaboutjava.org. I read a very good post about SOA development there, written by Okke van 't Verlaat, explaining why he thinks SOA is not always such a good idea. Even though half the world, and nearly all architects, think it is.