简体   繁体   English

如何将Report Pdf文件保存到我的本地文件夹

[英]How to save Report Pdf file to my local folder

How do I save a pdf file in my local folder using c# coding? 如何使用c#编码将pdf文件保存在本地文件夹中? This program is running with command prompt, so I just write a code to pass parameters to my report which is in report server nw the report will send in pdf format and I want to save it in my local folder and access this file to email purpose later. 这个程序是用命令提示符运行的,所以我只是编写一个代码来将参数传递给我的报告,该报告在报告服务器中,报告将以pdf格式发送,我想将其保存在我的本地文件夹中并访问该文件以用于电子邮件目的后来。

I'm missing a lot of info here: Is this a program that you downloaded? 我在这里遗漏了很多信息:这是你下载的程序吗? or is this a program you wrote yourself? 或者这是你自己编写的程序? Or you have yet to write it? 或者你还没写呢?

I'm guessing the last one. 我在猜猜最后一个。 You need to write a console application that accepts parameters and then use a PDF generator tool to generate your PDF. 您需要编写一个接受参数的控制台应用程序,然后使用PDF生成器工具生成PDF。 I'm guessing you're trying to read some data in order to generate a report. 我猜你正试图读取一些数据以生成报告。

Couldn't add this as a comment due to lack of rep so in as an answer it is. 由于缺乏代表而无法将此作为评论添加,因此作为答案。

You can save SSRS server output into PDF format directly. 您可以直接将SSRS服务器输出保存为PDF格式。 I'm assuming using the Report Viewer controls is out of the question for your application. 我假设使用Report Viewer控件对您的应用程序来说是不可能的。 So that leaves accessing the report server directly via the webservice it supplies. 这样就可以通过它提供的Web服务直接访问报表服务器。 See the answer supplied on this question for a nice starter solution. 请参阅此问题提供的答案,以获得一个不错的入门解决方

Reporting services: Get the PDF of a generated report 报告服务:获取生成的报告的PDF

From what you described you'll need to then copy the saved PDF from the download folder into your final destination. 根据您的描述,您需要将保存的PDF从下载文件夹复制到最终目的地。

Hope that helps. 希望有所帮助。

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

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