Export Data to PDF in ASP.NET Application - asp.net

In My ASP.NET Website, I am taking data inputs and storing it in Database. Now, I need to put a functionality where I can get the stored data in Export to PDF facility where i can save the pdf, having the data in specific format. Can anyone guide in this regard ?

you will need to use a 3rd party framework to do this. Most reporting tools have an option to export a report to PDF. I believe SSRS has this option, I know Crystal Reports has this functionality. I'm sure other reporting tools have this feature too.
There are also tools for directly generating PDFs instead of going through a report. A quick google search of .net pdf generator will be a good starting point. There is also iText which is an open source project for generating PDFs from xml. There is not much documentation on iText sharp and it's not actively developed from my understanding so expect a huge learning curve with this library.
unless the reporting features built into the .net framework (reporting services) can generate a PDF that meets your needs expect to purchase a 3rd party tool to help you create the PDF.

Related

Using Google.Apis.Analytics.v3

I am trying to use Google.Apis.Analytics.v3 for the 1st time, programmatically. We are building dashboard pages to show statistics, within their organisation-until now I have been reporting on information from internal databases.
Now we want to retrieve data from our Google analytics account.
My main tool for development is visual studio and C#. Some of the webpages have been created just using text editors, by a colleague, but I'm happier doing it in visual studio. We are sharing this development with organisations who do not use visual studio. So when I finish work on my webpages, we make 2 small changes to my files and we can be used without needing visual studio.
I have experience also in JavaScript and some jscript. I did find the Google API nuget package for studio and have installed it (not had time to look at it yet).
Some options Google have on their help site involves languages such as Java that we don't have any experience of in the format they appeared to be using it.
Given the above, can someone advise or recommend the best approach I should take for retrieving Google analytics data into our webpages (I do not want users to have to login-it should just seamlessly retrieve the data and display it).
Thanks
You could make an MVC project, where you can take the data and display it in a View. Here you can see some example with GoogleApi and MVC project in C#.

ASP.NET create excel pivot table

May I know if there has something can help to create excel pivot table for ASP.NET? Thanks.
I heard there is a Office Web Component. Is it free and can it make pivot table?
Since we have some complex Excel vba file, we would migrate it into pure web based generated file.
OWC is deprecated. See Office Web Components Lifecycle which states the following:
The most important thing to be aware of is that the Office Web Components technology has been deprecated. This means that only security fixes are being made to all versions of OWC, and no future versions of OWC will be produced. If you are using OWC, you should begin migrating to a new technology as soon as possible. For more information, see the blog post "Office Web Components Roadmap".
Use Excel services instead. See Replacing OWC Reporting with Excel Services for more information.
If you need to generate Excel files on the server side you may consider using the Open XML SDK.

ASP.NET pdf converter

I am looking for easy solution to convert documents from one format(doc, html, xls...) to pdf in ASP.NET.
Is the iTextSharp a good choise? Can iTextSharp convert documents from one format to pdf?
What library can your suggest me to use?
I've been using winnovative for all my PDF generation for the past few years:
http://www.winnovative-software.com/
Fair few good features, and simple to implement, if you don't mind paying for a license.
The default standard for this task should be Microsoft Office SharePoint Server. Another option would be using Microsoft Office applications from ASP.NET with Automation, combined with a PDF Printer (you will need a copy of Microsoft Office installed on the server). There are many PDF printers outthere (Cute PDF for example), but if you can afford a commercial option I recommend Amyuni PDF Converter. There are samples of Word/Excel to PDF conversion using Office+Automation with this product.
I'm working as Developer Evangelist with Aspose. And I would like to share with you that you may try Aspose.Total for .NET product suite, which allows you to convert various file formats (DOC/DOCX/PPT/PPTX/XSL/HTML etc.) into PDF format. You may also select components of your choice. Complete samples, tutorials and support are also available for these components.
Please note that these components are standard .NET assemblies and you can use them either in ASP.NET or Windows Forms applications.
Give the Muhimbi PDF Converter Services a look. It installs in your environment as a scalable and robust Windows Service and has specifically been designed for use from server based applications such as ASP.NET.
It comes with a friendly web services based interface that allows it to be used from most modern environments such as Java and .NET. It supports all common as well as some not so common file formats. Watermarking and PDF Security is included as well. If you have SharePoint in your environment then a SharePoint optimised version is available as well.
Disclaimer, I have worked on this product so the usual disclaimers apply. Having said that, it works great.

Is it possible to automate Visio with ASP.NET?

My clients are trying to revive an ASP.NET 1.0 application (yes, you read that right) that generated data-driven Visio Gantt diagrams. I have access to the code (VB.NET), but there are no notes, comments, or documentation, and no employees from 2003 still around. Compounding the issue, I'm pretty new on the scene (ASP.NET 3.5+ only), so the project structure looks very foreign to me (.resx files?).
I've tried including Visio Interop libs with little success. I tried following this article , but when adding the MS Visio 12.0 type library reference to the project solution in VWD Express 2010, I get an error that reads, "A reference to "Microsoft Visio Viewer 12.0 Type Library" could not be added. Converting the type library to a .NET assembly failed. No process is associated with this object." I don't know what that means but I sense it'll be a huge headache to resolve.
At this point I'm stuck and considering porting this feature to more a current platform. Can anybody suggest anything?
Visio has an xml format (.vdx)
If you don't need Visio to help you with layout or connections, you might be able generate the xml files, then have your ASP app serve them up as consumable Visio files.
If you need Visio's Gantt-chart add-in features, or Visio's export to web or image features, then this might not be the way to go. But if you only need to place shapes on a page, set text and other data fields, and have a fairly simple layout and simple connecting lines, you should be able to go this route.
The last download link in this article is for a presentation on Visio and XML that I gave a while back:
http://www.visguy.com/2006/11/30/visio-and-xml-conference-resources/
You should not access the automation API of any Office program from ASP.NET or any other server environment. It is unsupported, will fail at random, and may cause you to violate the terms of your license with Microsoft.
Tell them "no". You'll be much happier.
Well, you may download and use Aspose.Diagram library. It works with Microsoft Visio files without the installation of Microsoft Office Visio. Developers can create, open and manipulate the elements of diagrams and export to many other supported file formats. Based on your scenario, you may get details from a database backend and then create Visio diagrams. It is achievable using Aspose.Diagram API. Please refer to the technical resources of Aspose.Diagram for .NET API.
I work as a Developer Evangelist at Aspose.

Converting MS Word Documents to PDF in ASP.NET [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
Similar questions have been asked, but nothing exactly like mine, so here goes.
We have a collection of Microsoft Word documents on an ASP.NET web server with merge fields whose values are filled in as a result of user form submissions. After the field merge, the server must convert the document to PDF and stream it down to the browser. Our first inclination was to use the Visual Studio Tools for Office API; however, we ran into this warning from Microsoft:
Microsoft does not currently recommend, and does not support, Automation of Microsoft Office applications from any unattended, non-interactive client application or component (including ASP, ASP.NET, DCOM, and NT Services), because Office may exhibit unstable behavior and/or deadlock when Office is run in this environment.
It looks like the field manipulation can be done using the Open XML SDK, but what's the best way to convert Word 2007 documents to PDF without opening Word? The optimal solution would be low-cost, scalable, have a low memory footprint, be easy to deploy, and have a .NET API.
It's not exactly Open Source, but Aspose has a couple products which can do that,
Aspose.Pdf.Kit
Aspose.Pdf.Kit is a non-graphical PDF® document manipulation component that enables both .NET and Java developers to manage existing PDF files as well as manage form fields embedded within PDF files. Aspose.Pdf is perfect for creating new PDF files; however, developers often need to edit already existing PDF documents. Aspose.Pdf.Kit allows them to do just that. Aspose.Pdf.Kit allows developers to create powerful applications for merging data directly into PDF documents as well as for updating and managing PDF documents. Aspose.Pdf.Kit is a wonderful product and works great with the rest of our PDF products.
and Aspose.pdf
Aspose.Pdf is a non-graphical PDF® document reporting component that enables either .NET or Java applications to create PDF documents from scratch without utilizing Adobe Acrobat®. Aspose.Pdf is very affordably priced and offers a wealth of strong features including: compression, tables, graphs, images, hyperlinks, security and custom fonts. Aspose.Pdf supports the creation of PDF files through API, XML templates and XSL-FO files. Aspose.Pdf is very easy to use and is provided with 14 fully featured demos written in both C# and Visual Basic.
Check out the API and demos. You can download a DLL for free to try it out. I've used both before and they work out great.
There's also iTextSharp which is a C# port of iText, a Java PDF converter. I've heard some people try it with mixed results.
The question is "MS Word Documents to PDF in ASP.NET" so I am very puzzled why Aspose.Pdf and Aspose.Pdf.Kit are recommended above. You need to use Aspose.Words because that's the component that supports Microsoft Word documents to PDF conversion.
Check out Microsoft's resource on Saving Word 2007 Documents to PDF and XPS Formats using C# or VB.
ActivePdf DocConverter - http://www.activepdf.com/
But it requires Office installed on the server for good quality conversion.
Aspose.Words may be the best option for you, but it doesn't convert all visual elements perfectly.
Have a look at the Muhimbi PDF Converter Web Services. It runs on Windows as a service, but can be accessed from any non-Windows web services capable environment including Java and .NET.
Although this solutions requires MS-Office to be installed on a server (not necessarily the same server as your application), it is very robust and provides perfect conversion fidelity. It goes to great lengths to get around the deadlock problems Microsoft refer to in their KB article.
To generate or Modify MS-Word files I recommend using the free Open XML SDK for Microsoft Office. Eric White maintains a really good Blog about it.
Disclaimer, I worked on this product. Having said that, it works great.
You should try using OpenOffice for this. It is Free and supports a whole range of file conversions. I have used it to convert DOC & DOCX files to HTML format with fantastic results.
ABCpdf is another popular component that'll let you convert Word documents to PDF under ASP.NET, however I believe it too makes use of Microsoft Office or OpenOffice.
http://www.websupergoo.com/abcpdf-office-docs.htm
Microsoft PDF add-in for word seems to be the best solution for now but you should take into consideration that it does not convert all word documents correctly to pdf and in some cases you will see huge difference between the word and the output pdf. Unfortunately I couldn't find any api that would convert all word documents correctly. The only solution I found to ensure the conversion was 100% correct was by converting the documents through a printer driver. The downside is that documents are queued and converted one by one, but you can be sure the resulted pdf is exactly like the word docuemtn. I personally preferred using UDC (Universal document converter) and installed Foxit Reader(free version) on server too then printed the documents by starting a "Process" and setting its Verb property to "print". You can also use FileSystemWatcher to set a signal when the conversion has completed.

Resources