Showing posts with label directly. Show all posts
Showing posts with label directly. Show all posts

Sunday, March 25, 2012

Create a PDF file directly to disk?

Hello all,

I use Reporting Services and an aspx page to create a PDF file. I need to save the file directly to a disk file with a name, without asking the user if he want to open or to save it. I'm using the folowing command:

Response.WriteFile("http://" & System.Environment.MachineName & "/ReportServer?%2fReportsApp%2fRptFSUnicoR&rs%3aCommand=Render&rs%3aFormat=PDF&MyID=" & IDFun,True)

Any idea how I do that?

Regards

HttpResponse.WriteFile requires either an absolute or virtual path to a sever-local filesystem location. So, referencing the URL of the report server won't work.

Also, I don't think you'll be able to bypass any browser's download prompt dialog without employing some sort of trusted control to do the HTTP request and file saving for you behind the scenes. SoftArtisans XFile is one such product that can do this.

-Chris

|||

Hi Chris,

Thank you for your answer. I'm afraid I will have to think in another solution.

As Report is generated from Reporting Services I thought I could have another parameter to force the "save" at the time I render the Report.

Best regards

sql

Sunday, March 11, 2012

CR 8.5, VB6, Crviewer how to preset Copies

Ok, I know how to use printout feature and can set number of copies this is fine when going directly to printer, But I have endusers that want to preview the report befre printing.

They however make an easy mistake, the document they are previewing has a requirement of 3 copies when printed. The preview has no obvious way to set that and of course startup with 1 copy. I know I could add a line to run a printout of 2 copies but the previewer form is used by more than one report.

I just want to know is there an easy way to set the copies in the previewer print.

Thanks in advance.This code goes into the VB form that your CRViewer is located. I named mine CRViewer. From the Left drop down list in your code window, choose CRViewer (or whatever you named it), in the right Dropdown list, choose PrintButtonClicked.

Private Sub CRViewer_PrintButtonClicked(useDefault As Boolean)

Dim intCopies As Integer

useDefault = False

intCopies = 3

Report.PrintOut False, intCopies

End Sub