简体   繁体   English

水晶报表中的按需子报表

[英]On demand sub reports in crystal reports

I have a report where I am using an on-demand sub-report. 我有一个使用按需子报告的报告。 But my user is viewing this report from a java application. 但是我的用户正在从Java应用程序查看此报告。 So whenever he run the report he will view this report in PDF. 因此,无论何时运行报告,他都将以PDF格式查看该报告。

Report format: 报告格式:

country name         location            sales

<on-demand subreport>

Now once he run the report he will get all the above fields data in PDF format. 现在,一旦他运行报告,他将以PDF格式获取上述所有字段数据。

So now if clicked on location field data in PDF will he get the sub-report's data. 因此,现在如果单击PDF中的位置字段数据,他将获得子报表的数据。

PDF isn't intended to generate dynamic content. PDF并非旨在生成动态内容。 As such, you'll need to find an approach that will render the desire content in a static manner. 这样,您将需要找到一种可以静态方式呈现需求内容的方法。

I would suggest that you parameterize your report to display one of these options: 我建议您参数化报告以显示以下选项之一:

  1. main only 仅主要
  2. main + subreport 主报告+子报告

The PDF will either contain the main report's content or the main and subreport's content. PDF将包含主报表的内容或主报表和子报表的内容。

** edit ** If you are using BusinessObjects Enterprise (BOE), you could use the openDocument API to generate a new report instance or the most-recently-generated instance. **编辑**如果使用的是BusinessObjects Enterprise(BOE),则可以使用openDocument API生成新的报表实例或最近生成的实例。 I don't know if Crystal Reports Server supports this feature for certain. 我不知道Crystal Reports Server是否确实支持此功能。

If you are rendering reports in a Java application, then you will need to a way to intercept the hyperlinks--a server, most likely. 如果要在Java应用程序中呈现报告,则将需要一种截获超链接的方法,即服务器。 By in large, you'd be reinventing Crystal Reports Server/BOE. 总的来说,您将重新发明Crystal Reports Server / BOE。

Basically I understand as you need two thing. 基本上我了解您需要两件事。

  1. you need to generate a report and export/generate in pdf. 您需要生成报告并以pdf格式导出/生成。

  2. in you need to attach link or something like editable field pdf. 您需要附加链接或类似可编辑字段pdf的内容。

For First answer, you can easily hide/show of sub-report in crystal report side. 对于“第一答案”,您可以轻松地在Crystal报表侧隐藏/显示子报表。 but not after report generate in pdf. 但不会在生成pdf报告之后。

So for second answer, you need to pdf professional or editable allow version. 因此,对于第二个答案,您需要使用pdf专业版或可编辑的允许版本。 after you get that you simply use itextsharp.dll (to generate pdf from asp.net-see below link). 得到后,您只需使用itextsharp.dll(从asp.net生成pdf-请参见下面的链接)。

So finally I think, does not needed crystal report. 所以最后我认为,不需要水晶报告。

please check this link. 请检查此链接。 How to create an editable pdf in asp.net? 如何在asp.net中创建可编辑的pdf?

Pdf's fields should remain editable using itextsharp in asp.net Pdf的字段应使用asp.net中的itextsharp保持可编辑状态

Creating a fillable PDF form with ITextSharp 使用ITextSharp创建可填充的PDF表单

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM