Include PDF, XLS, DOC and other formats in SQL Report - sql-server

we currently use SQL Server Reporting Services to create reports based on SQL data. We are at the moment able to include images coming from a varbinary(Max) column of a SQL database table. Now in those table several other formats are stored including PDF and MS Word and Excel documents. We would like to render a report including those documents at the end but we could not find any suggestions, especially for doc and xls format.
Is that possible? And if yes, how?
Thanks for your help :)
Tom

I faced the same requirement in my project and the solution I see is preprocess those embedded documents, converting them to an images (per page in embedded documents). And then SSRS report itself will simply use image rendering control to embed those documents.

It looks like iText can meet all your requirments http://itextpdf.com/

Related

Exporting SQL Server 2014 database data into a Microsoft Office Word 2010 document

What I got:
An SQL Server database with x amount of tables
An empty Word 2010 document
What I would like to achieve:
To fill the empty Word document with data from a specific table in my database.
What I've tried so far:
Microsoft Office guide to import data using the Data Connection Wizard (found here)
This didn't work out very well for me and I'm not very sure why.
Question
Am I approaching this in the right manner with the Data Connection Wizard, or am I missing out on something less complicated and more suiting of my needs?
There are many options. Assuming that you want to use the data writing a document and do it more often than once (so automated) you can execute one of the following:
"For the knowledgeable": create a SQL script that spits out RTF (or maybe even XML for docx) and open the RTF in Word. The SQL script can of course be encapsulated in a web page or exe. Note that is can be quite hard to get tables right. Try to stick to TAB-s.
"From within Word": we use ourselves our own product Invantive Composition (free version available for download). You enter the view or table names as blocks in the template designer (modeller ribbon) and press Publish in the end user ribbon.
"The BI way": use a program such as iReports or Crystal Reports or Access, and write a report that you save as RTF, doc or docx.
You could try SQL Workbench. I've always had great success with it, they also feature exports as CSV if I'm not mistaken. Read more here.

Insert PDF files in RDLC report as an annex

I am developing a WPF application in VB. Net and I'm using SQL Server Reporting to create my reports.
I have a report that contains the specifications for a machine and I would add the PDF file that contains additional information to report and then print it.
Is it possible to dynamically add PDF files in a RDLC report?
Or is there a way to solve this problem
Thank you
i dont think that reports server has any inbuilt support for pdf's. You might be able to buy one, but i think i would save the pdf's as jpegs and just put those in the report instead

Extract Binary Data from SQL Server using T-SQL

I have a database to which I upload files (such as PDFs, images, etc). I save these to the database as Varbinary (max).
I upload these files using C# MVC. What I was wondering is how can I view these files using a T-SQL query, not .net.
Is this possible?
Not directly.
Why don't you write a simple viewer application?
There are free and commercial ones out there. I haven't used this one, but it does have a trial version: SQL Image Viewer
No, you need to extract the files in order to view them.
SQL Server and SSMS (SQL Server Management Studio) don't have a facility to view binary data in this way.
You can use the sp_OAxxxx functions (the COM interaction functions) to create the appropriate viewers, but ultimately these viewer will require the data written to disk.

SQl Server 2008 FILESTREAM, Indexing Services, and FTS

I need to implement a service to search PDFs. Initially I started using SQL Server 2008 FTS, but soon realized that my PDFs would have to be stored in the DB itself. I was then pointed to Indexing Services as well as to the SQL 2008 FILESTREAM data type so that I can store PDFs in the file system. So how do these three (Indexing Services, FTS, and the FILESTREAM option) relate with each other? Do I need to use all three together to implement my search?
Also, Do hosting services like DiscountASP typically have these enabled? Or should I consider switching to Lucene.NET?
WE used to use a PDF iFilter which allows you to store the PDF in the DB and then perform a FTS against it. HOwever, we now convert our PDFs to text and store the text in the full text index. This allows us to store all our docs now (we store .doc, .pdf etc) in the same index.
DiscountASP does allow FTS /iFTS on the hosted database.
If you know in advance what you want to find (eg you get hundreds of PDFs a day and will need to find the ones with certain "known-before-reception" strings then you could make a text version on reception, create index entries for the PDF file, and then throw away the text.
If you do not know the search terms in advance, life becomes much slower :( There is a program called PDF Search that claims to do full-text search in PDF files. I haven't needed to use it, so I can't say how it is, but it's here: http://www.getpdf.com/.
Hope this helps

How should I import highly formatted data from Excel to a database?

What is the best way to import highly formatted data from Excel to SQL server.
Basically I have 250+ Excel files that have been exported from a reporting tool in a format that our business users would prefer. This is a 3rd party tool that can not export data in any other format. I need to "scrub" these files on a monthly basis and import them into a database. I want to use SQL Server 2005
File formats look like this:
Report Name
Report Description
MTH/DEC/2003 MTH/JAN/2004 MTH/FEB/2004
Data Type Data Type Data Type
Grouping 1 1900 1700 2800
Grouping 2 1500 900 1300
Detail 300 500 1000
Detail 1100 200 200
Detail 100 200 100
you could write a simple parser application. there are many api that will handle reading excel files.
I have written one in java and it only took a day or two.
here is one api.
Good Luck
EDIT: Forgot to mention we will also need a sql api such as JDBC. Again we use JDBC for the majority of our applications and works great.
Personally I would do it using SSIS. It might not be trivial to set up as the file format looks relatively complex (but that I suspect might be true no matter what tool you use), but as long as it stays consistent, it will run quickly each month and SSIS packages are easy to put under source control. Since SSIS is part of SQL Server it is easy to make sure allthe servers have it available. The key is do have a good understanding of how that format relates to how you store data in the database. THat's the hard part no matter what tool you use.
Assuming that you have Microsoft Excel, you can also use Excel's own exposed ActiveX interface. More information here:
http://msdn.microsoft.com/en-us/library/wss56bz7(VS.80).aspx
You could use that in anything that can use ActiveX (C++, VB6, VB.NET etc...) to create a parser as well, to follow-up on what Berek said.
I have done this before with perl and MYSQL. I wrote a simple perl script which parsed the file and output the contents to a .sql file. Then, this can eather be done manually or included in the perl script, open MYSQL and use the .sql file.
This may seem a bit simplistic, but you could simply dump the data in csv format and do some parsing of the output to convert to insert statements for SQL.
For a java based application , POI (http://poi.apache.org/) is pretty good for Excel integration applications.
You might want to look at CLR procedures and functions in SQL Server. With a CLR procedure you could do all of your scrubbing in a VB or C# .NET application but still run the jobs from SQL Server just like any other stored procedure or UDF.

Resources