C# - How To Cause A Browser To Open A Tab Delimited Txt File In Excel
Mar 18, 2011
We have a tab delimited file that we are making available for download. The file extension is txt, but the users want it to open automatically in Excel. The previous developer had used the following code:
The ContentType is being set to Excel, but that doesn't seem to have any effect. I am guessing the txt file extension is causing it to be picked up by notepad or the like instead. I have tried just renaming it to a xls extension, which works but Excel complains that I am trying to trick it or it might be a corrupted file.
I have huge excel files that I have to open from web browser. It takes several minutes to load huge file. Is it possible to open a single worksheet (single tab) at a time from excel file that contains many worksheets? I have to do this using C# / asp.net MVC
I'm exporting the GridView to Excel. It works fine and I receive a prompt to Save/Open/Cancel the file although I need the file to be saved automatically in the provided (passed to the Export function) location and opened in the same browser window where the Gridview was.
My question is, when this opens up in the browser, it takes over the whole page. Is there a way to limit the height? The reason I'm asking is, I have three menu items above the page to open up a specific pdf. So if I click on one of the links to view that pdf, the pdf show up, but the links disappear because of the PDF.
I also don't want to use iframe to populate the PDF.
I'm new to asp.net and C# really, mostly just done windows apps in VB.net.
Also, trying to move from Crystal Reports to SSRS.
I found some code to render a SSRS report as a pdf. But this is saving the pdf locally. I have code that opens the report after it's saved, in the browser.
Rather than save the "results" locally, how to I go about just opening file in the browser. Code: results = rsExec.Render(format, deviceInfo, out extension, out encoding, out mimeType, out warnings, out streamIDs); [code]...
I can place an Excel file in the root directory, use Browse and view an xlsx, xlsm or any other Excel file and it (sometimes) pops up in a browser window with no option to save or do anything other than view the Excel document (you can type in the cells and it gives you the option to save if there are any changes). I'm trying to find out how to do that exact thing client-side.
We have a server that allows a client to upload an Excel file and we want them to be able to review it only. If there is a way to bypass the Open message box that pops, that would be ideal, but just getting it to display in a separate, small browser window would be just what the doctor ordered. The Excel files are varied so the content is always different and not necessarily formatted the same. That removes the ability to go with named ranges and definitions.
Currently with the code we have, users can press a view button to review the file they uploaded for errors but it opens up the full version of Excel and then throws errors because it tries to force a save to a temp file. Not exactly ideal and very confusing to the user. I don't habve the exact code available to me at the moment, but I'm hoping that someone can point me in the right direction.
I have a mail list where i can select many mails and download (with/without opening the mail). During the download process i update the mail status(download/open) and show the content in pdf. In normal browser dialog opens where user can save open or cancel options exits. But if the user cancel then the update process done on the mail should not happen. so i think about doing the update process if the user clicks open or save but how can i identity that client control (i think it depend on the browser)
The issue is present if i download and unopened mail and click cancel button in the dialog box the pdf creation code i have done is in this link
which i used to open that dialog in browser to save pdf
There is a file with an extension .cert sitting on web server. when i tried to access it through URL, i couldn't open it and didn't give any error message also. I verified the file existence in that folder and also i could open it using notepad. Is there any MIME to be added to open this file?
I want to open docx file in IE from asp.net. The IIS has mime type correctly mapped. I can open pdf fine but docx will always prompt me to download like content-disposition='attachment'. Is there any setting to be done?
There are bunch of files stored in a DataBase as varbinary/image data. I am writing a program to extract these file data and send them to the browser so file can be opened or saved. My method is,
BUT this method creates a file in the Server and then transmit to the browser. Means 100s of files will be created in the server when I open 100s of files with this process, naturally I want to avoid that.
Is it possible to do this without creating a copy of the file in the server ?