ComputerGuy
unread,Jan 21, 2008, 4:08:27 PM1/21/08Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting
Hey All.
I am currently working on fixing a Crystal Reports charting error for
a .NET application. There are 10 sets of data that should be plotted
on a graph. This works perfect if all 10 sets have non null values.
Then it will chart a complete line. However sometimes the 10 sets of
data end at different points.
I thought if I inserted a null value the graph would simply not plot
the value. However this does not work. When the application runs I get
an error stating that Crystal Reports does not accept null values.
Error
System.NotSupportedException: DataSet does not support
System.Nullable<>.
at System.Data.DataColumn..ctor(String columnName, Type dataType,
String expr, MappingType type)
at System.Data.DataColumnCollection.Add(String columnName, Type
type)
The datasource for the report is a class.
private double? amountUSD;
private double? peer1AmountUSD;
private double? peer2AmountUSD;
private double? peer3AmountUSD;
private double? peer4AmountUSD;
private double? peer5AmountUSD;
private double? peer6AmountUSD;
private double? peer7AmountUSD;
private double? peer8AmountUSD;
private double? peer9AmountUSD;
private double? peer10AmountUSD;
I then tried to create a DataSet based on the values in the class. I
then set each row to be nullable
col = new DataColumn();
col.AllowDBNull = true;
col.DataType = Type.GetType("System.String");
col.ColumnName = "AmountUSD";
table.Columns.Add(col);
However I still get the same error above. I also selected "Break Lines
for Missing Data" under the chart options however the application
fails as it says that the DataSet does not accept null values. In
order to get the application to work I have to insert dummy values but
that results in an incorrect chart.
Is there anyway to plot a graph like this. It is a simple line graph
showing returns from different sources. Any help would be great as I
serioulsy want to take a hammer to this computer.
Thanks.