Search code examples
c#pdfcrystal-reportsexport

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. 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. If the size could be A5 or something similar, that would be great.

Thank you in advance,

Rafael Valente


Solution

  • So, i couldn't solve this issue with Crytal Reports after spending almost 2 days looking for a solution. Then i started to look for other reporting solutions, like SSRS. In Visual Studio, we can actually create a report with a .rdlc format (Add --> New Item --> Reporting --> Report). 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.

    This is my code:

    enter image description here

    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. If you're using a .apsx item, then you can change the code and try to work with HTTP Response collection.