Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

i am using an add-on component called eXport.net to export data to an excel worksheet. the sheet must first be saved on the webserver before naything can be done with it. i then include some inline javascript to open the excel spresdsheet in a new window. everything works fine up until the opening of the file in a new window. the file is created on the webserver but will not open up in a new browser window for me. below is the code i am using:

 

SqlDataAdapter da;

DataSet ds;

ds = new DataSet();

da = new SqlDataAdapter("stpDEBgetInsuranceMailMerge", strConnection);

da.SelectCommand.CommandType = CommandType.StoredProcedure;

da.Fill(ds, "SSRFADD");

 

 

eXportNET SF = new eXportNET();

String strFileName;

StringBuilder sb = new StringBuilder();

SF.FileType = "XLS";

SF.SavePath = Server.MapPath("");

strFileName = SF.CreateFileFromDataset(ds);

strFileName = strFileName.Substring(strFileName.LastIndexOf("\\")+1);

 

sb.Append("<SCRIPT>");

sb.Append("window.open('" + strFileName + "');");

sb.Append("</SCRIPT>");

Response.Write(sb.ToString());

 

 

this works from within visual studio when i build and browse but the minute i copy and paste the link into a browser window and click on Export Report button i get the file is created but nothing happens -(no window opended up showing the file)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...