This code snippet explains how to generate a Crystal Reports report in PDF format and show it in the client browser. I assume you have already created designed a report using Crystal Reports. In the above function, GetConnectionInfo will simply read the connection details from the config file and store the details in a CrystalDecisions. This ConnectionInfo is later used by the report to get connected to the server. ConnectionInfo needs the following properties to be set, and the code is given below:.
After setting the connection details, we need to set the parameters if any for the report. In my case, I will get the required parameters from the query string. Before explaining how to zip a folder, let me explain how to direct the zipped folder to the browser so that the client can download and save it. This code assumes you know the path to the zipped folder.
In order to zip a folder, you need to add a few namespaces. All these namespaces are part of the Visual J library, vjslib. So first, you need to add this library to the application. You can find this library in the. NET framework version path. The following function will create individual PDF reports, put them in a newly created folder, zip the folder, and return the name of zipped file to the caller:. This article only gives you an outline of how to do things, since the complete code is out of the scope.
Sign in Email. Forgot your password? Search within: Articles Quick Answers Messages. Tagged as VB7. Stats How to zip a folder in ASP. V K Sumesh Rate me:. So first we download the dll through this link Ionic. Assemblies Required After downloading the Ionic. Go to zip-v1. We must add the following namespace: using Ionic. NET with the help of Ionic. Those files we can convert into zip format. Code line number 07 describe that the particular name of the file inside the zip file. Code line number 08 define the name of the zip file we are going to create.
Design Output Created the Zip file. Inside The Zip File. I hope this article is useful for all. FindControl "chkSelect" , CheckBox. Checked Then. FindControl "lblFilePath" , Label. AddFile filePath, "Files". End Using. View Demo. Related Articles. Add Comments. Thank you for the feedback. The comment is now awaiting moderation. You will be notified via email when the author replies to your comment. Please select a comment to reply. You can add your comment about this article using the form below.
Make sure you provide a valid email address else you won't be notified when the author replies to your comment Please note that all comments are moderated and will be deleted if they are Not relavant to the article Spam Advertising campaigns or links to other sites Abusive content. Please do not post code, scripts or snippets.
Required Invalid Email Address. Security code:. Required Invalid security code. I declare, I accept the site's Privacy Policy. Add Comment. Disclaimer : The code samples and API available at www. You are free to use it for commercial as well as non-commercial use at your own risk, but you cannot use it for posting on blogs or other tutorial websites similar to www.
0コメント