Question about creating a file on a remote machine from a server
-
I have an ASP.net web application that is running on a server machine. This application accesses a database which is also on the server and allows the user to view crystal reports containing this data using their web browser. I want to allow the user to export a report to pdf format for printing reasons. This is the code I am using below:
private void btnExport_Click(object sender, System.EventArgs e) { ReportDocument RPTDoc = new ReportDocument(); ExportOptions EXPOp = new ExportOptions(); DiskFileDestinationOptions DiskOpt = new DiskFileDestinationOptions(); PdfRtfWordFormatOptions pdfRtfWordOpts = new PdfRtfWordFormatOptions (); string FileName; RPTDoc.Load((string)Session["SelectedReport"]); //System.IO.File.Create("C:\\temp.rtf"); FileName = "C:\\documents and settings\\" + this.User.Identity.Name.ToString() + "temp.rtf"; DiskOpt.DiskFileName = FileName; EXPOp.DestinationOptions = DiskOpt; EXPOp.ExportDestinationType = ExportDestinationType.DiskFile; RPTDoc.ExportOptions.FormatOptions = pdfRtfWordOpts; EXPOp.ExportFormatType = ExportFormatType.RichText; RPTDoc.Export(); Response.ClearContent(); Response.ClearHeaders(); Response.ContentType = "application/rtf"; Response.WriteFile(FileName); Response.Flush(); Response.Close(); System.IO.File.Delete(FileName); }
My question is how do I specify where on the users system to create the rtf file? I am not sure if my code is correct or not it seems like it would work if the web application was running on a machine acting as both the client and server? I need it to work from a remote server to clients using the application over the LAN. Thanks in advance for helping a newbie. Frank :wtf: