Excel Sheet in asp.net? - asp.net

In web application [asp.net], i am upload the Excel file from admin end. now i want to display that excel sheet in my asp.net at the user end whe he click on button "Show", is it possible to show the uploaded excel sheet in asp.net pages. Tahnk you.

Not sure about any third-party or open source control but you may use ADO.NET OleDB provider through which you can read excel sheet and later you may display content via GridView control.

Related

Image File upload in asp.net framework web application

I wast to use an image as a Fileupload control asp.net application such that when I click on the image, it opens file explorer. Once an image is selected, the the selected image is displayed. I should also be able to store the selected image into a database. Any code to do that?
Please be specific to the point what you have done so far. But I give you link for the solution.
File Upload control to upload file and save record in database

Add external data source in End User Report Designer DevExpress

Can we add external data source in End User Report Designer rather than giving in web.config file.
I just need to add new external data source like in form of popup that will take SQL server path ,username and password
To add custom data sources into the report designer, create these data sources at runtime and add them to the ASPxReportDesigner.DataSources collection.
Take a look at the Web Report Designer - How to add/edit/remove data sources in the web report designer (Custom DataSource wizard) еxample which demonstrates this approach in action.

Open File Dialog Asp.Net

I am creating an excel report in vb.net using the office interop. When the report is completed I am saving the excel file on the C drive. The users have asked to save file anywhere they want not just the c drive. Can someone give me some code to popup an opend file dialog in asp.net?
I want the dialog to popup in a saveAs in ASP.NET. I know how to do it in win forms, but I am creating an excel report in asp.net and calling the worksheet objects SaveAs property that excepts a fileName. So right now I just hardcode a file name in there. The users want to choose a file location
I think what you want is actually rather simple.
You can't save a file to the user's computer due to security restrictions (would you want a website saving a file to your computer?)
What you need to do is:
Complete report
Save report file to location on server, IE (.../myWebsite/files/GUID/myReport.rpt)
Display link on next screen pointing to the report file
Doing this the user can right-click and save the file to wherever they want on their computer.
You can clean up these files on whatever schedule you would like.
Assuming you are actually talking about a desktop, winforms app then you can use the built in FileSaveDialog.
Official documentation is here:
http://msdn.microsoft.com/en-us/library/system.windows.forms.savefiledialog.aspx
but there are tons of tutorials explaining it out there:
http://www.google.co.uk/search?q=vb.net+savefiledialog
You can server files with the Open / Save dialog by using Response.TransmitFile().
The user is then presented with a save as dialog where they can choose the filename and the location on their computer.
You normally do this inside a HttpHandler. A simple one is described here:
http://blogs.msdn.com/petel/archive/2005/12/01/499189.aspx

Asp.net fileupload control postback problems

using ASP.net, vs2008 C#.
Im using a FileUpload control on a webform. The uploading of a file (ie PDF dcouments) to a server directory works ok.
I have on the webform a "preview" button that the user can use to preview the PDF file after they have selected it via the Fileupload browse feature.
I do this by
if (this.FileUpload1.HasFile)
{
localURL = FileUpload1.PostedFile.FileName;
// use this to preview file. Other methods are restricted by local security requirements
Process.Start(localURL);
}
My problems is that after the button click Postback occurs the location of the selected file disappears from the textbox part of the Fileupload control.
How can i keep this info there, so the user does not have to browse again and instead can just click upload to upload the file.
Any help appreciated
thanks
try putting the localURL variable into a session. worked for me once

How to upload pdf file into my own server?

In my site, user want to upload a pdf file and I have to save it into my own server. I don't need the content to be saved. I want the exact file to be copied into my server where the published file of the site exists.How to do this?
Use FileUpload Control and write code like
FileUpload1.PostedFile.SaveAs("Path and Filename");
You can easily use asp.net fileupload control: Uploading files in asp.net using C#
You can use ASP.NET file upload control which will handle this.You can mention where in your server you want to store it

Resources