Dundas for Reporting Services的一些的使用技巧
2008-09-27 09:56
281 查看
如何让Chart的Y轴或2nd Y轴只显示最大值和最小值?
原理很简单,就是设置Y轴的interval是此轴的最大值即可,但是interval是不支持Expression表达式来获取Y轴最大值的,那么就需要在Dundas中写Code来实现。
在Dundas的属性设置窗口中选择Advanced,单击ViewCode按钮,在下拉列表中选择PostApplyData方法,C#实现代码如下:
// Parameter: chartObj - represents the chart object
chartObj.ChartAreas[0].AxisY.Interval=
chartObj.ChartAreas[0].AxisY.Maximum-chartObj.ChartAreas[0].AxisY.Minimum;
完成后单击Compile按钮,下方出现Compiled OK后Code即生效,运行Report即可看见效果。
使用了Series Groups后如果自定义每个Series的颜色或者Maker类型?
当你在Dundas中使用了Series Groups,那个每个添加到Dundas的Series都会依据这它来分组显示。并且分组出来的Series的颜色是Dundas随机定义的。要想修改分组出来的Series的颜色或者其Maker设置,也可以通过在Dundas中写Code来实现。
在Dundas中,每个Series都有一个默认的Name,分别是"Series 1"、"Series 2"...依次排下去。我们只要分别判断每个Series的Name,然后再分别采用不同的设置即可。在Dundas的属性设置窗口中选择Advanced,单击ViewCode按钮,在下拉列表中选择PrePaint方法,C#示例Code如下:
// Parameter: chartObj - represents the chart object
// Parameter: sender - the chart object that will be painted
if( sender is Series ){
Series series = (Series) sender;
switch(series.Name){
case "Series 1":
series.Color=Color.LightYellow;
series.MarkerStyle=MarkerStyle.Diamond;
break;
case "Series 2":
series.Color=Color.Red;
series.MarkerStyle=MarkerStyle.Square;
break;
}
}
完成后单击Compile按钮,下方出现Compiled OK后Code即生效,运行Report即可看见效果。
如果Series出现的顺序不固定,那么我们还可以通过LegendText来判断Series。LegendText的值是在Series Groups中用来group的那一列的值。我们可以用switch(series.LegendText)来判断。
原理很简单,就是设置Y轴的interval是此轴的最大值即可,但是interval是不支持Expression表达式来获取Y轴最大值的,那么就需要在Dundas中写Code来实现。
在Dundas的属性设置窗口中选择Advanced,单击ViewCode按钮,在下拉列表中选择PostApplyData方法,C#实现代码如下:
// Parameter: chartObj - represents the chart object
chartObj.ChartAreas[0].AxisY.Interval=
chartObj.ChartAreas[0].AxisY.Maximum-chartObj.ChartAreas[0].AxisY.Minimum;
完成后单击Compile按钮,下方出现Compiled OK后Code即生效,运行Report即可看见效果。
使用了Series Groups后如果自定义每个Series的颜色或者Maker类型?
当你在Dundas中使用了Series Groups,那个每个添加到Dundas的Series都会依据这它来分组显示。并且分组出来的Series的颜色是Dundas随机定义的。要想修改分组出来的Series的颜色或者其Maker设置,也可以通过在Dundas中写Code来实现。
在Dundas中,每个Series都有一个默认的Name,分别是"Series 1"、"Series 2"...依次排下去。我们只要分别判断每个Series的Name,然后再分别采用不同的设置即可。在Dundas的属性设置窗口中选择Advanced,单击ViewCode按钮,在下拉列表中选择PrePaint方法,C#示例Code如下:
// Parameter: chartObj - represents the chart object
// Parameter: sender - the chart object that will be painted
if( sender is Series ){
Series series = (Series) sender;
switch(series.Name){
case "Series 1":
series.Color=Color.LightYellow;
series.MarkerStyle=MarkerStyle.Diamond;
break;
case "Series 2":
series.Color=Color.Red;
series.MarkerStyle=MarkerStyle.Square;
break;
}
}
完成后单击Compile按钮,下方出现Compiled OK后Code即生效,运行Report即可看见效果。
如果Series出现的顺序不固定,那么我们还可以通过LegendText来判断Series。LegendText的值是在Series Groups中用来group的那一列的值。我们可以用switch(series.LegendText)来判断。
相关文章推荐
- Dundas for Reporting Services的一些的使用技巧
- Dundas Chart for Reporting Services for SQL Server
- Dundas Gauge for Reporting Services
- Gradle for Android(七)——一些使用技巧
- Dundas Chart for Reporting Services for SQL Server
- Dundas Gauge for Reporting Services
- SQL Server Reporting Services 开发技巧总结
- C# Devexpress 中控件的一些使用技巧
- 网上看到一些不错的SQL语句的使用技巧,分享出来(在哪拷的我真不记得了)
- UINavigationController使用的一些技巧
- IDEA 配合使用maven 的一些技巧
- UE中使用正则表达式的一些技巧
- 使用BizTalk Adatper for Web Service中的策略与技巧
- dd的一些使用技巧
- 关于一些Code::Blocks的使用技巧
- sql*plus使用的一些技巧
- 141107●VS2012的一些使用技巧
- 一些VS2013的使用技巧
- 一些linux使用技巧
- 定制化高效使用Map的一些经验技巧