Crystal reports 水晶报表自定义图表

Crystal reports 水晶报表自定义图表,crystal-reports,crystal-reports-2008,crystal-reports-2010,Crystal Reports,Crystal Reports 2008,Crystal Reports 2010,我想在crystal report中实现一个看起来像进度条(渐变图像)的图形,并根据百分比放置一个包含标记的圆。如中所示。任何人请帮助我如何实现这一点Crystal Reports本机不支持这种类型的图形 这是一个近似值: 创建条形图和圆形图(忽略分数) 创建新报告(它将是一个子报告) 在细节部分放置两个图像;相互对齐 添加三个数字参数:低、高、分数 在条形图的左边缘添加低参数;将高参数添加到右边缘 在圆形图像上方添加分数参数和位置;大小匹配图像的宽度 创建一个名为“位置”的公式(见下文) 右

我想在crystal report中实现一个看起来像进度条(渐变图像)的图形,并根据百分比放置一个包含标记的圆。如中所示。任何人请帮助我如何实现这一点

Crystal Reports本机不支持这种类型的图形

这是一个近似值:

  • 创建条形图和圆形图(忽略分数)
  • 创建新报告(它将是一个子报告)
  • 在细节部分放置两个图像;相互对齐
  • 添加三个数字参数:低、高、分数
  • 在条形图的左边缘添加低参数;将高参数添加到右边缘
  • 在圆形图像上方添加分数参数和位置;大小匹配图像的宽度
  • 创建一个名为“位置”的公式(见下文)
  • 右键单击圆形图像并选择大小和位置。。。;将位置公式添加到X位置的条件公式中
  • 对Score参数的X位置条件公式执行相同的操作
  • 抑制除细节以外的所有部分
  • 根据需要在其他报表中嵌入子报表
公式文本:

//{@Position}
//
// RETURNS: position in inches
// TODO: set properties to match your layout
//
// width of circle image (inches)
Local Numbervar circleDiameter:= 0.5;

// X position of left edge of image (inches)
Local Numbervar barLeftX:=1;

// X position of right edge of image (inches)
Local Numbervar barRightX:=3;

// width of bar image
Local Numbervar barWidth:= barRightX - barLeftX;

// relative position of score in relation to low and high scores
Local Numbervar relativePosition:={?Score} / ({?High} - {?Low});

// calculate position of image's X position (return value in INCHES)
barLeftX + (barWidth * relativePosition) - (circleDiameter/2)
// 
// convert inches to twips (1440 twips/inch); confusing because UI uses inches
//
{@Position}*1440
条件公式文本:

//{@Position}
//
// RETURNS: position in inches
// TODO: set properties to match your layout
//
// width of circle image (inches)
Local Numbervar circleDiameter:= 0.5;

// X position of left edge of image (inches)
Local Numbervar barLeftX:=1;

// X position of right edge of image (inches)
Local Numbervar barRightX:=3;

// width of bar image
Local Numbervar barWidth:= barRightX - barLeftX;

// relative position of score in relation to low and high scores
Local Numbervar relativePosition:={?Score} / ({?High} - {?Low});

// calculate position of image's X position (return value in INCHES)
barLeftX + (barWidth * relativePosition) - (circleDiameter/2)
// 
// convert inches to twips (1440 twips/inch); confusing because UI uses inches
//
{@Position}*1440
出于某种原因,Crystal Reports 2008忽略了条件公式。我会做一些调查并发布调查结果

否则,考虑图表替换:


漂亮的照片!用水晶做这个很有趣