Trouble viewing this newsletter? Click here to read it online
Dundas Software Ltd. Brought to you by!

Editor's Note: Poll Result

Last month's technical newsletter included a poll to find out what language readers prefer to code in, C# or VB.NET. As such, here is the result of the poll visualized in a nice Dundas Chart:

So I guess that solves that question, with 61% of respondents preferring C# compared to 39% preferring VB.NET. I'd like to say that while the comments written by many of you were rather humorous, there was a trend in the reasons given for language preference: C# is preferred because it's like C++ and Java, while VB.NET is preferred because it's not like C++ and Java.

There will be another poll in the near future, if only because I enjoyed reading the comments so much.

Terrence Sheflin

In this Issue: June 21, 2006


Send your feedback


Gauge Auto Color

Being developers in the support team, we often find it difficult to assist fellow developers who make poor choices for palette colors. Fortunately, we enlisted the help of our graphic artists and made a few templates in the form of a class add-on, which can be used to improve the look and feel of your Gauge without the requirement of being a graphic artist.

The add-on includes 5 color palettes for both Circular and Linear Gauges:

  • Pale Blue
  • Midnight
  • Simple Black
  • Pale Grey
  • Electric Blue

Using this add-on is extremely easy with only one line of code necessary to use the static class.

The full add-on class file is available in both C# and VB.NET, as well as a sample application which shows the different palettes and demonstrates how to use the add-on.

Extended Spline Chart

Dundas Chart for .NET includes a common chart type that is quite popular: Spline Chart. The spline type series in Chart represents data in a non linear cardinal spline where a sequence of connected data points form a curve.

Normally in a spline chart the only y-values obtainable are those in the data set; it is not possible to find the y-value of some arbitrary x-value that exists in the graphed spline but not in the data set. The Extended Spline Chart add-on adds this functionality to Spline Chart, allowing you to obtain any y-value for any x-value that exists in the spline with the function FindYforX().

The spline add-on also contains two more functions, FindMaximumOnSpline() and FindMinimumOnSpline() which find the maximum and minimum points on the spline whether they exist in the data set or not.

Tips n' Tricks Chart | Gauge | Diagram

General Tips

Dundas Calendar for Reporting Services Released!
Dundas Software is pleased to announce a new addition to our product line-up: Dundas Calendar for Reporting Services. You will be happy to know that this product behaves much like other Dundas Software products, so you will have no problem finding properties when developing your application. As well, Dundas Chart for Reporting Services also includes a wizard similar to our other SSRS products so that you can modify the look and feel of Calendar with ease. External assemblies are also available in Dundas Calendar which means you can easily make your own add-ons.

One of the most pleasing features in Dundas Calendar is the fact that the wizard allows you to simply click on a date to add it to the Holiday collection. From a developer's perspective, this is a feature that makes project creation fast and easy.
read more »

Scale Breaks
This month Dundas Software released Dundas Chart for .NET v5.5. One of the many new features available in this release is Scale Breaks. Scale Breaks is a powerful technology which allows you to customize your chart so that large differences between the high and low values of the data being plotted does not ruin the readability of your chart. Put a different way, scale breaks are intentional breaks in the y-axis used to redistribute data points within a chart. Adding scale breaks to your chart can result in much better legibility.

Scale Breaks are enabled by setting the ScaleBreakStyle.Enabled property, found in the AxisY object, to True. The ScaleBreakStyle object also contains numerous properties to help customize the Scale Breaks on your Chart so that you can achieve the look you want.
read more »

Interactive Ajax Features
Dundas Chart for ASP.NET v5.5 uses AJAX to implement the following interactive features:

  • Internal and External Toolbars.
  • Context Menus.
  • Property Dialogs.
  • Zooming and Scrolling.

As well as these built-in features, Dundas Chart for ASP.NET also exposes a number of different events that are fired by Chart via AJAX. These events include Click, Callback, CallbackComplete, CommandFired and CommandFiring. These events allow you to modify Chart using server side code without a post-back instead of having to use JavaScript.

Dundas Chart v5.5 also includes a new toolbar, legend, and context menu to make it easier to customize Chart. Adding and removing items from these new objects is also very easy; removing a Command from the toolbar is no harder than setting the Visible property to False.
read more »

Streaming Real-Time Data From a Database
Dundas Gauge for .NET makes it easy to stream data from a database into Gauge. However, there is a choice of when and how to access the data: Access the database whenever more data is required, or, at the start of the program, put all of the data from the database into some data set and only access that. While this may seem slightly confusing, we have simplified things by making a sample project with two aspx pages: one aspx page that accesses the database via a DataReader every time data is required, and another aspx page that populates a DataSet from the database and only accesses this object. While the decision is ultimately based upon the environment and needs of the specific project, this sample will allow you to test each scenario before you begin or deploy your own project.
read more »

Connective Lines: What's the difference?
There are 4 types of connective lines and they can be divided into 2 groups:

  1. ConnectorLine and RoutingConnector classes
  2. ElementLine and ElementRoutingLine classes
They are similar in that you can use them to connect the diagram elements, but the connective lines from group 1 can use the static utility class ElementFunctionality's method ConnectElements to connect 2 diagram elements via the specified connector. The ConnectorLine and RoutingConnector classes implement the IConnector interface which is required as the first parameter in the static ElementFunctionality utility class's ConnectElements method.

Unlike the connective lines from group 1, the connective lines from group 2 do not implement the IConnector interface and can be used to establish the connection between the diagram elements using the Element class's Glue method. For more information, including code snippets, please refer to the full article.
read more »

Dundas Q & A Chart | Gauge | Diagram

Chart for.NET

Q. How can I set HTML attributes of Dundas Chart for ASP.NET?
A. Dundas Chart for ASP.NET includes a property called Attributes that allows you to set any arbitrary HTML attribute that does not correspond to the properties of the control. An example of this is the property width, which cannot be set directly in the control. Using a line of code such as: chart1.Attributes["width"] = "50%"; would add a width parameter to the output img tag. For more information, please refer to the full article.
read more »

Q. Do AJAX-based interactive Chart features require complicated JavaScript?
A. Absolutely not. To enable, use and customize most interactive features of Chart such as the Toolbar, Context Menus, Zooming and Scrolling, only code in ASP.NET is required. When using Chart's callback or other more complicated features, some JavaScript may be necessary.
read more »

Q. I have the Microsoft Visual Studio 2002/03 installation of Dundas Chart for ASP.NET. How can I use AJAX with the Chart?
A. The client callback feature uses an implementation that is based on ASP.NET 2.0. For this reason, callbacks are only available in the Visual Studio 2005 version. Visual Studio 2002-03 developers can utilize an alternate AJAX development technique, demonstrated by clicking here.
read more »

Q. I have installed Dundas Chart for ASP.NET Professional Edition. Can I use Chart's AJAX based functionality?
A. Yes. Scrolling, zooming and client callbacks are all available in the Visual Studio 2005 installation of Dundas Chart for ASP.NET Professional Edition. Dundas Chart for ASP.NET Enterprise Edition includes additional interactive features such as the Toolbar, User Interface, Chart Commands, and Context Menu.
read more »

Chart for Reporting Services

Q. Why does Dundas Chart for Reporting Services show US local settings at run time and ignore my data's local format?
A. Dundas Chart and Gauge are reporting services items that apply US local settings by default unless the local language is specified in the designer using the report items property pages. By using the Language property you can specify the language of your text data. You can also instruct Chart and Gauge to display different numerical formats of data by setting the NumeralLanguage property.
read more »

Q. My Chart is in a sub report and is appearing as an image not found placeholder, 'X', or not at all. Everything else on the page is rendering fine. What's wrong?
A. This is a known bug in Microsoft Reporting Services and has been fixed as part of SQL Server SP1. Please download and install SP1 to resolve this issue.

Gauge for .NET

Q. I have a Dundas Gauge rendered as a SmartClient control. When I scroll, the image seems to freeze or not show up at all. Why is this?
A. In a recent IE patch a bug was introduced that causes this problem. This bug has since been fixed by Microsoft, and an update is available with this fix. For more information and the patch to fix this problem, please refer to the Microsoft article.

Q. I am using Dundas Gauge for ASP.NET (VS2005) with calculated values and real-time streaming. The first time the application is run, everything works as expected. However, when run again after having closed the browser, the calculated values are always zero.
A. This is caused by ASP.NET 2.0. If you stop the web instance (or restart IIS), or change the project in any way the calculated values will work again. The reason for this odd behavior is that if a session is accessed in a callback (i.e. the RealTimeData event) for the first time, the session will not retain its value on subsequent accesses. To solve this problem, you must simply write to the session in the Page_Load event when it is fired outside of a post-back and callback.
read more »

Diagram for .NET

Q. How can I establish a connection between elements programmatically?
A. You can easily establish a connection between elements programmatically by using the following steps:

  1. Create the elements
  2. Add the connection point(s) to the created elements
  3. Create the connecting lines
  4. Add the created elements and connecting lines to the Elements collection of the Page
  5. Call ElementFunctionality class's ConnectElements() method which connects the points via the specified connector
After this, you can apply a layout engine to layout the connected elements.
read more »

Q. How can I color the area between elements inside of a group?
A. To color the area between elements in a group, you must add a custom rectangle to the diagram that has the same dimensions as the group's rectangle. Once this new rectangle is added, fill it with the color you want to appear between the elements. The rectangle will resize with the entire group resulting in a fill between the elements. For source code detailing how to do this, please refer to the full article.
read more »