将 Crystal Report 详细信息部分打印到已整理的第二页
我有一份 Crystal XI Release 2 报告,我的客户希望在两页上看到该报告。 他希望报告在第一页上打印某人的人口统计信息,例如(姓名、地址等),并在第二页上打印该人的总数。 第一页将包含尽可能多的行,第二页将包含与第一页一一对应的相同数量的行。 然后第三页将包含一个新页面,从第一页结束的地方开始。
他基本上正在寻找类似于 Excel 打印方式的打印(请不要告诉我导出到 Excel 并从那里打印)。
我想出了两个想法来做到这一点,但只实现了一个。 第一个是运行两份报告(一份用于人口统计信息,另一份用于总数),以某种方式将其整理在一起。 我对此并没有很深入,但我没有花大量时间研究这个,所以我仍然认为这可能是一个选择。
第二种方法是将报告设计扩展到两个横向页面的宽度,添加我的字段,然后在准备打印之前将页面尺寸更改回单个横向尺寸。 这种方式可以工作,但可能会导致一些奇怪的问题。 一个是,如果您尝试在第二页上编辑/添加字段,当报表大小设置为单页横向时,字段将移动到第一页的最右侧,这是有道理的,因为我认为这应该是是设计器的可编辑区域,所以我假设您不应该在该区域之外有字段。
总而言之,第二种方法可行,但我知道必须有更好的方法来做到这一点。 我想看看是否有人有类似的请求或有其他更好的想法来做到这一点。 谢谢
I have a Crystal XI Release 2 report that my client wants to see on two pages. He wants the report to print the demographic information such as (name, address, etc...) for a person on the first page and the totals for the person need to print on the second page. The first page will include as many rows as will fit and the second page will have the same amount of rows which correspond one for one to the first page. Then the third page will contain a new page of people starting where the first ended.
He basically is looking for printing similar to how Excel prints (and please don't tell me to Export to Excel and print from there).
I came up with two ideas for doing this, but only got anywhere with one. The first was to run two reports (one for the demographic info and the other for the totals) which would be collated together somehow. I didn't get very far with this, but I didn't spend a ton of time researching this so I still think this could be an option.
The second way was to extend the report design to the width of two landscape pages, add my fields, and then change my page size back to a single landscape size before I get ready to print. This way sorta works, but can cause some weird issues. One is that if you try to edit/add a field on the second page when the report size is set to a single page landscape the fields are moved to the far right of the first page which makes sense because I would think that is supposed to be the editable region of the designer so I'd assume you're not supposed to have fields outside of this region.
All in all, the second way works, but I know there has to be a better way to do this. I wanted to see if anyone has had a similar request or have some other ideas on a better way to do this. Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我想不出在水晶中执行此操作的简单方法。
您可以对数据源进行所有修改,并每 20 行(或者一页上适合的行数)复制一次。 然后,您将设置 2 个详细信息部分,一个用于人口统计信息,另一个用于总计。 然后根据余数(页码,2)有条件地抑制它们。
或者您可以使用接受分页参数并且每页仅返回 20 行的子报表。 但我什至不确定是否可以将子报表参数链接到页码特殊字段。
你的第二种方法如何运作? 额外的字段会以某种方式打印在下一页上吗? 然而,问题是,当您返回一页时,这些字段保留在设计器之外,如果您需要编辑,它们都会移回设计器内? 编辑之前不能增加页面宽度吗? 如果每次都能正确打印出来,那还不错。
I can't think of an easy way to do this in Crystal.
You could get all hacky on the datasource and duplicate every 20(or however many fit on one page) rows. Then you would set up 2 details sections, one section for demographics and the other for totals. Then conditionally suppress them depending on remainder(pagenumber, 2).
Or you could use a subreport that accepts paging parameters and only returns 20 rows per page. But I'm not even sure if you can link a subreport parameter to the pagenumber special field.
How does your second way work? The extra fields just get printed on the next page somehow? However, the problem is that the fields stay outside the designer when you go back to one page and if you need to edit they all move back inside the designer? Couldn't you increase the page width before editing? That's not too bad if it somehow prints it out correctly every time.
我想我会将其标记为答案,因为我仍然无法找到更好的解决方法。 如果有人找到更好的方法,然后发布回复,如果有效,我认为可以切换答案。
为了解决这个问题,我所做的是将我的打印机设置为“Microsoft Office Document Image Writer”,然后将宽度更改为允许的最宽值,即 36”。然后我将本节开头的人口统计信息添加到大约 11" 并将总计放在第一部分结束位置的右侧,然后选择另一个页面宽度。
然后,我进行所需的任何更改,并将打印机设置回我想要使用的正确尺寸的打印机。 执行此操作后,您会发现可编辑区域仅扩展到第一页,但您可以在右侧看到第二页的字段。 如果您尝试编辑第二页上的字段,该字段将移动到位于第一页最右侧的可编辑区域的最右侧,因此请确保在进行编辑之前重置打印机。
我想我还必须调整部分专家布局选项卡上详细信息部分的宽度,才能正确打印报告。 我将其设置为两页的总大小,以便我的看起来正确。
我认为这可能是一个非常罕见的问题,但如果您遇到类似的问题,这就是我解决它的方法。
I guess I will mark this as the answer since I still haven't been able to figure out a better way around it. If anyone finds a better way then post a response and if it works I think can toggle the answer.
What I do to get around this is to set my printer to the "Microsoft Office Document Image Writer" and then change the width to the widest it will allow which is 36". Then I put the demographic information from the beginning of the section to around 11" and put the totals stating just to the right of where the first section ended and go for another page width.
Then I make whatever changes that I need to make and set the printer back to the printer I want to use for the correct size. After you do this you will find that the editable area only extends to the first page, but you can see the second page of fields to the right. If you try to edit a field on the second page the field will move to the far right of the editable region which is at the far right of the first page so make sure you reset your printer before making edits.
I think I also had to play around with the width of the detail section on the layout tab of the section expert to get the report to print correctly. I set it to the combined size of the 2 pages for mine to look correct.
I think that this is probably a super rare issue, but if you are having a similar issue, that is how I get around it.