简体   繁体   English

将Crystal报表导出为小于A4的pdf文件

[英]Exporting crystal reports to pdf with size smaller than A4

I'm trying to export a Crystal Report to PDF (or .doc or something else that Crystal Reports support) and then put it in my file system with a size smaller than A4. 我正在尝试将Crystal Report导出为PDF(或.doc或Crystal Reports支持的其他格式),然后将其放入尺寸小于A4的文件系统中。 This is being done through Visual Studio 2010. I want to do this because the report has an image that is not that big and thus creating an A4 page with that small image would be ugly. 这是通过Visual Studio 2010完成的。我要这样做是因为报表中的图像不大,因此使用较小的图像创建A4页面将很丑陋。 If the size could be A5 or something similar, that would be great. 如果大小可以是A5或类似的大小,那将是很好。

Thank you in advance, 先感谢您,

Rafael Valente 拉斐尔·瓦伦特

So, i couldn't solve this issue with Crytal Reports after spending almost 2 days looking for a solution. 因此,在花了将近2天的时间寻找解决方案后,我无法使用Crytal Reports解决此问题。 Then i started to look for other reporting solutions, like SSRS. 然后,我开始寻找其他报告解决方案,例如SSRS。 In Visual Studio, we can actually create a report with a .rdlc format (Add --> New Item --> Reporting --> Report). 在Visual Studio中,我们实际上可以创建.rdlc格式的报告(添加->新项目->报告->报告)。 This format allows you to work with Report Viewer through VS and do the workaround to export succesfully to PDF (or other reading/writting format like .doc) or even an image. 此格式使您可以通过VS使用Report Viewer,并采取变通方法将其成功导出为PDF(或其他阅读/书写格式,例如.doc)或图像。

This is my code: 这是我的代码:

在此处输入图片说明

I hope this is helpfull and can prevent other people for going crazy with things like this. 我希望这对您有所帮助,并且可以防止其他人为此类事情发疯。

Best regards, Rafael Valente 最好的问候,拉斐尔·瓦伦特

EDIT: This code is written in a normal class in VS. 编辑:此代码是在VS中的普通类中编写的。 If you're using a .apsx item, then you can change the code and try to work with HTTP Response collection. 如果您使用的是.apsx项目,则可以更改代码并尝试使用HTTP响应集合。

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

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