Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Question about creating a file on a remote machine from a server

Question about creating a file on a remote machine from a server

Scheduled Pinned Locked Moved ASP.NET
questioncsharpasp-netdatabasesysadmin
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    frank21
    wrote on last edited by
    #1

    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:

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups