give Excel file as a link to download in jsp page - excel

How can I give a link to user to download an excel file link on JSP?
my excel will be stored under Web-INF , one folder above my JSP page.
Thanks ahead.

Sample Excel File

Related

How to store generated pdf in webapp/resource folder of jsf application programmatically?

I am generating a pdf file from a database data. I want to store the file in webapp/resources so that I can have a relative link for my pdf to put it in my jsf page. Please let me know if there is a way to store pdf in relative path (webapp/resource)

How can we convert an html file to sharepoint2010 site page

How can we convert an html file to sharepoint and how can we uplaod and apply the css and jQuery files to the share point site..please help me on this
HTML files cannot be converted to Sharepoint page on Sharepoint2010. if you have styles on the page its advisible to upload the same (incl .css and .js) on one document library and provide the ref on the uploaded HTML page . or else you can use that HTML on an Article page which you create , add a Content editor webpart and paste those HTML scripts with .css and .js reference on that
Hope this helps
Regards
Arjun

Opening .pdf files using a <a href> link

I have a .pdf document in a folder called docs, that is inside of my WebContent folder.
I want to have a link to show the address to this file, so that when the user click it, he can see the document's content.
The code is this:
See document
When I execute it, I get the error:
HTTP Status 404 - /Web/docs/jsftutorial.pdf
I tested this with a .txt file, and it works, but why not with a .pdf?
Thank you!!
I found a tutorial on how to Read and open the PDF in a new browser window here:
http://balusc.blogspot.com.br/2006/05/pdf-handling.html
Now it works!

Watermark and print pdf file C# asp.net 4.0

I have a pdf file stored at some location on my server. On click of a link I want to add a text-watermark to this pdf file and then print it.
something like this:
in aspx say we have a (button a link-button or a simple link)
<a id="abc" href="../test.pdf" onclick="watermarkAndPrintPdf()"> PrintPdf </a>
or
<asp:linkbutton id="abc" runat="server" onclick="watermarkAndPrintPdf()" Text="Print Pdf"/>
Now when user click this link my code should add watermark(which will probably the loged-in user name) and print this document.
I want to know what ['watermarkAndPrintPdf()'] this function will be.......
Note:-It is a web application in C# asp.net 4.0.
(I don't mind if print dialog box opens or It prints without it.)
Please help....
would suggest taking a look at PDFsharp it's an open source dll for producing pdf's through code, there are a number of examples of producing a watermark on this page of the PDFsharp website:
http://www.pdfsharp.com/PDFsharp/index.php?option=com_content&task=view&id=40&Itemid=51
If you need any help using it I am more than willing to lend a hand as I have used this package to produce pdf's in the past.
hope this helps.

How to modify Sharepoint filetype icons depending on parts of the filename?

We have a SharePoint Document library, where we store html files with links to external files. Samples:
mypicture.jpg.html
mywordfile.docx.html
mypdffile.pdf.html
and so on. Now by default all Files show up with the HTML Icon, referenced in the DOCICON.XML file. Thats of course correct as the .html extension shows, it is a HTML file. But we want the files to have different icons, based on their original file type.
Is there a way to automatically change the Icon
during rendering or
when we save the file to the library (via SharePoint API)?
Any other approachs?
Why not use a little jquery to change the icon during rendering? Each doc in your library should be contained in
<td class="ms-vb-icon"><a tabindex=...><img ... src="/_layouts/images/ichtm.gif"></a></td>
I think you can slurp that into an array, assign a new var that's just the href stripped of path/filename. and .html, and use that to replace htm in the src tag.
Could you not just edit the DOCICON.xml to add the ".jpg.html" and ".docx.html" extensions in?
For a full listing of icon files see all "ic*.gif" files in the TEMPLATE\IMAGES directory under the 12 hive. Unfortunately, this will not solve your problem, but this is where you can change it based on the extension, if you so choose.
Note that a blog I wrote a while back has a different focus, but does discuss where the icons come from: http://wiki.threewill.com/display/is/2007/10/14/External+Link+for+Editing+a+SharePoint+Document.

Resources