如何在图片上方画一条线?

[英]How to draw a line above a picture?


How do you display a line above a picture in Crystal Reports? I'm currently using Crystal Reports 8.5.

如何在Crystal Reports中的图片上方显示一条线?我目前正在使用Crystal Reports 8.5。

I am using a jpeg image in the report, with an image header section set to “Underlay Following sections”.

我在报告中使用jpeg图像,图像标题部分设置为“Underlay Following sections”。

I added another header above the image header section, drew the line, and then gave the option “underlay following sections”, but the line is not displaying above the picture.

我在图像标题部分上方添加了另一个标题,绘制了该行,然后给出了“底层以下部分”选项,但该行未显示在图片上方。

How can I add a line that will display above the picture?

如何添加将在图片上方显示的行?

7 个解决方案

#1


If I understand your question, you want to add a line to an image in Crystal Report. Unfortunately, you won't be able to do this with Crystal Reports. Your best option is simply to draw a line above the image. If there is an issue with placement of the line, add another section above the section that contains the image.

如果我理解您的问题,您想在Crystal Report中为图像添加一行。不幸的是,您无法使用Crystal Reports执行此操作。您最好的选择就是在图像上方画一条线。如果放置线条时出现问题,请在包含图像的部分上方添加另一部分。

#2


There's a developer-provided workaround here, using textboxes: http://scn.sap.com/thread/1916479

这里有一个开发人员提供的解决方法,使用文本框:http://scn.sap.com/thread/1916479

  1. Insert a text object and enter nothing.
  2. 插入文本对象并不输入任何内容。

  3. Change the size (the height matches the line width) and background (background color matches the line color).
  4. 更改大小(高度与线宽匹配)和背景(背景颜色与线条颜色匹配)。

  5. Right click on the text object and select Move | To Front. And then the "line" will be on top of the picture.
  6. 右键单击文本对象,然后选择Move |前面。然后“线”将在图片的顶部。

Unforunately, using Crystal Reports 2008, this would only allow me to shrink the textbox to a certain height (0.042 inches), which was still too big for a 1-pixel line.

不幸的是,使用Crystal Reports 2008,这只允许我将文本框缩小到某个高度(0.042英寸),这对于1像素线仍然太大。

#3


A little late response, but this CodeProject answer works. I had the same problem and this workaround did the trick. I quote the answer here.

有点迟到的响应,但这个CodeProject的答案有效。我有同样的问题,这个解决方法做了伎俩。我在这里引用答案。

  1. Create 2 separate reports. The 1st report will be the main report and the 2nd will be a subreport.
  2. 创建2个单独的报告。第一份报告将是主要报告,第二份报告将是一份子报告。

  3. Place all page headers and footers on the main report.
  4. 将所有页眉和页脚放在主报表上。

(Main Report)

  1. Right click on the PageHeaderSection and insert section below.
  2. 右键单击PageHeaderSection并在下面插入部分。

  3. On the new PageHeaderSection, insert the image(your watermark) and set the section to Underlay Following Sections.
  4. 在新的PageHeaderSection上,插入图像(您的水印)并将该部分设置为Underlay Follow Sections。

(Subreport)

  1. Go to your subreport and place your data and lines on it.
  2. 转到子报表并将数据和行放在其上。

(Main Report)

  1. Again, right click on the PageHeaderSection and insert section below.
  2. 再次,右键单击PageHeaderSection并在下面插入部分。

  3. On the new PageHeaderSection, right click, Insert->Subreport
  4. 在新的PageHeaderSection上,右键单击Insert-> Subreport

  5. Select Choose a Crystal Report in a project, then click the 2nd report you've created. Voila! The lines will be now on the top of the image! Just be sure to remove the borders of your subreport.
  6. 在项目中选择“选择Crystal报表”,然后单击您创建的第二个报表。瞧!这些线条现在将位于图像的顶部!请务必删除子报表的边框。

#4


I've never tried to do this before now, but it appears that the Z order functions (under the Move menu- to back, to front, etc...) are not available for lines or images and it appears that the image z order is always above the line even if you have multiple sections and use the "underlay following sections" option.

我以前从未尝试过这样做,但看起来Z顺序功能(在移动菜单下 - 后面,前面等等)不适用于线条或图像,而且看起来图像z即使您有多个部分并使用“底层以下部分”选项,订单也总是在线上方。

My answer is that this can not be done the way you are trying to do it, but what if you try another way.

我的答案是,这不可能按照你想要的方式完成,但如果你尝试另一种方式会怎样。

EDIT: I'm assuming that you are trying to create a strike through in the image in certain instances. Assuming that, you should be able to have 2 images (one normal and one with the line through it) that you should then be able to dynamically change based on you're criteria. You should be able to find many articles on dynamically changing the Crystal Report image. Hope this helps.

编辑:我假设你试图在某些情况下在图像中创建一个打击。假设您应该能够拥有2个图像(一个正常,一个通过它),然后您应该能够根据您的标准动态更改。您应该能够找到许多关于动态更改Crystal Report图像的文章。希望这可以帮助。

#5


What worked for me was to create a subreport that essentially duplicates/replaces the Details. Then the usual process of putting the image in the page header and underlaying following sections. The subreport, including its lines, appear above the watermark for me, but please note I'm using Crystal XI.

对我有用的是创建一个基本上复制/替换详细信息的子报表。然后是将图像放在页眉中并在下面的部分下面的通常过程。子报告(包括其行)出现在水印上方,但请注意我使用的是Crystal XI。

#6


an easy way I added a line is:

我添加一行的简单方法是:

  1. add a text box (length of the line you want)
  2. 添加一个文本框(你想要的行的长度)

  3. right click -> format text
  4. 右键单击 - >格式化文本

  5. click on the tab border
  6. 单击选项卡边框

  7. select either top or bottom border, the line style etc etc
  8. 选择顶部或底部边框,线条样式等

#7


If I understand your question correctly - In the header section, use the line tool to draw the line. It's in the CR Toolbox. Then drag your image after the line.

如果我正确理解您的问题 - 在标题部分,使用线条工具绘制线条。它在CR工具箱中。然后在线后拖动图像。

智能推荐

注意!

本站翻译的文章,版权归属于本站,未经许可禁止转摘,转摘请注明本文地址:http://www.silva-art.net/blog/2009/07/09/68fedca81cb2dcead314820d4b903947.html



 
© 2014-2019 ITdaan.com 粤ICP备14056181号  

赞助商广告