I am new to Jsp. I am developing the tool for testing usage, and have succeeded to open the excel file in the browser from the jsp application. However, i am not able to modify or edit the opened excel sheet.
Please help how to modify the excel in the browser.
You cannot do this when displaying the file inline in a browser or doing a 'Open file' when getting a download popup. Simply because the file is then copied into client's disk file system. If you save the edits, it's saved in the same copy on the client's disk file system. This does not affect the original file in the server side in any way.
There are basically 2 ways to achieve your requirement:
Let client download a copy of the excel file and store it in the client side disk file system, so that the client can edit and save it locally. Give the client the possibility to upload the edited file back. In the server side just replace/backup the original file.
Use HTML forms the smart way to mimic an Excel sheet and use a Java Excel API (Apache POI, JExcelAPI, etc) to map between this data and the actual Excel file which is stored in the server side disk file system.
Have you looked at JExcel?
The FAQs also explain how to use the API with jsp.
Related
I'm trying to find a way to open PDF files directly from its location. I know I can use this to open files.
import pdf from './file.pdf
Open Pdf
But this is not going to work for me, I'm building an item list app with React and Node for a small company I work for, and every new item needs to have a certificate that is in PDF. User needs to be able to add PDF file when creating a new item and open it when needed. They want the app to be live on the internet, but all certificates to be on their local server, so only people that are connected to their network can see them. Is this possible to do?
I was thinking just to save the path to pdf file in the database and then use that path to display it in app. Something like this.
Open certificate
But I can't make it work right now, even when the file is in the same folder as my app.
you can use require function.
Open certificate
I have question about Excel file uploading into database (MySQL or another one). So, is there any options by which I can upload any/random Excel file? I'm not sure how to make it without structure in database but I want to make it automatically with HTML upload. I did it with PHP, HTML and AJAX but I have structure in database and that's an issue because I can't upload Excel file with different data structure. How to automate it?
I can export to page as excel file via this code below:
response.contenttype = "application/vnd.ms-Excel"
response.Addheader "content-disposition", "attachment; filename=test.xls"
But I want to create multiple tabs on the same excel file, how I can do it?
Thanks for helps.
You cannot do that using the response.contenttype directive. that command only transforms a page into excel so you do not have the ability to create a new page as all of your html will be read as one page.
The solution depends on what your requirements are.
Free
The only free solution I know is building a page and pushing it to the browser as an XML file. If you create the file you want in excel and then save it in an XML format, you can open that file and see how the page should be build in asp.
Pros Its free. you do not need permission to install anything to the server. You will just be passing an xml file to the client.
Cons Excel is not the default viewer for xml files, notepad usually is. Most people will not understand how to open your file in excel. This means that this method is really only good for internal applications where you can change everyone's computer to open XML files in Excel by default.
3rd Party Program
When I needed to accomplish this same task I had entertained using 3rd party programs in classic asp. I wish I could remember the program but it would have cost around ~$1,000 to use.
Pros These programs are feature rich and will allow you to do anything you could want in exporting to excel. They are also cleaner and a bit simpler to use over writing your own XML file to open in excel.
Cons Costs money. may require server permissions you do not have. Most programs require you to save the file to the server before serving it to the client
ASP.NET
You can choose to instead create a new page in asp.net and use its excel features to create the file you need.
Pros Also free. Same extensive feature set available in most 3rd programs for classic asp are available with this method.
Cons classic asp and .net are not able to communicate directly so things like password protection on the page will become an issue if that is needed. You obviously need to know or learn the .net framework. Files are saved to the server before being sent to the client.
I have the following problem:
I have a process in SSIS and it generates .cube files and saves the files in Sharepoint folders.
I have users that open the files in excel. Some can see the data in the files and other can not see anything.
There is one user who opens the file on a computer on the company network and can not see the data in the .cube file, but if the same user opens the same file on a personal computer the user can see the data in the file.
Can someone help me?
There are a couple of possibilities here. First off, Excel has something called Trusted Locations. If a file is on a network share, you may need to add that share as a Trusted Location. Check the Excel backstage (or look for a video on Youtube about Trusted Locations) for more info.
Secondly, once the file is downloaded, do the properties of the file show the 'Unblock' button? They shouldn't for a typical intranet setup but there could be something unusual about your particular environment.
I have a c# desktop app which connects to a site via a web browser control. The problem is I need to navigate to a specific section and download a excel file which is generated from a postback. I would like to either automate this process or bypass the file download dialog and save the file directly to a local drive.
Problem
The link is not a standard url. The site uses a postback script to get the file needed which then displays the file download dialog box. E.g. When you click on the button (javascript: postback) the file download dialog box is automatically loaded.
As stated I want to bypass the save options and automatically store the file in a predefined location. Any help would be much appreciated.
I find AutoIt http://www.autoitscript.com/site/autoit/ very useful for these kind of tasks. If you want to integrate it with your C# app, then you can call your AutoIt script via system calls. The difficulty is finding and following the link on the page, that will depend on how the page is laid out.