开发者

How to print the contents of (CrystalDecisions) ReportDocument.ExportToStream without creating a file?

开发者 https://www.devze.com 2023-02-25 09:52 出处:网络
As titled: How to print the contents of (CrystalDecisions) ReportDocument.ExportToStream(Type=PDF) without creating a file?

As titled:

How to print the contents of (CrystalDecisions) ReportDocument.ExportToStream(Type=PDF) without creating a file?

Because we are having issues on access rights of the ASP.NET server printer when executing RptDoc.PrintToPrinter

(Users would log in our system using their Active Directory Account, the printer right is granted to these user accounts instead of to NETWORK SERVICE/the IIS/ASP.NET worker process, our system will impersonate these AD user accounts to do the printing)

(We als开发者_StackOverflowo do not prefer caching the generated crystal report as a PDF file and do the print)

Thanks a lot!


You need to call the ExportToHttpResponse method

crReport.ExportToHttpResponse(ExportFormatType.PortableDocFormat, Response, false, "Exported Report");

The parameters being:

  • formatType - the format type to export the report
  • response - the response object of the page
  • asAttachment - whether the report will be exported as an attachment
  • attachmentName - the name of the exported report


Try to use

ReportDocument.PrintToPrinter(1, True, 0, 0)

PrintToPrinter(nCopies As Integer, collated As Boolean, startPageN As Integer, endPageN As Integer)
0

精彩评论

暂无评论...
验证码 换一张
取 消