Save Excel as Image in SQL Server Field - c#

I am converting an MS Access 2003 application to C# (VS 2010) and SQL Server 2008.
It's all pretty basic except for one thing. I've got embedded excel spreadsheets in the application. In Access they are edited and saved as OLE DB objects. The spreadsheet is then displayed as an image in the report. I have converted the Access Reports to Crystal Reports and converted data shows just fine in the reports.
I can create the spreadsheet and save it to a file, but what I can't figure out is how to create and save an Excel Spreadsheet as an image in my SQL Server field so Crystal can put it in the report.
I also know images are deprecated in SS 2008 so any ideas on how to move my whole report to something else would be appreciated.
FYI: An older post suggested Lenni Lobel's articles, but they are not there anymore.

Sounds like there are two requirements here:
Be able to access the file data via Crystal
Be able to efficiently store a spreadsheet in a SQL Server 2012 database column.
Your choices (other than Image columns) would appear to be FileStream and VarBinary. Here's a comparison: VARBINARY vs. FILESTREAM.
I can't comment on Crystal's ability to access either of those, unfortunately.

You can use OLE object in Crystal reports to show the excel file (without saving it as a picture) This will probably work fine for all computers where Excel is installed.

Related

Integrating SharePoint 2013 with SSRS report Data or Extracting Data from SSRS into SharePoint using a TimerJob

I have a requirement to get data out of an SQL Server Reporting Services based system straight into a SharePoint list from where that data will then be processed.
At present, users export the data into an Excel spreadsheet and then start modifying columns on that spreadsheet and exchange it among various stakeholders every two hours.
My intention is to bypass the export to Excel portion of the current process and instead create a timer job (created using .NET, C# and SSOM) that gets the data directly out of SSRS into my SharePoint List.
Thank you
If you familiar with SSRS, I suppose you know ETL also, so you could import the updated excel spreadsheet(maybe from a fixed path, so you just need save the files there) to a SQL Server table. Then create external content type from the table and display data in SharePoint by creating external list.
One thread for your reference

Export SQL server data into a CSV file

I've just taken care of a project that requires converting data from the old website (built in C# web form) to the new one (using PHP).
In the old database, there is a product table contains 1600 products that I need to export into a CSV file then import to the new database but I have no idea to do that.
I can access the current server but I don't see any .cs file (code-behind file). I also have no idea how to export that table to a CSV file using myLittleTools (The SQL server management tool that Plesk provide).
Can any have me please?
Thank you very much.
Try SQL Server Import and Export Wizard. This is a tool provided by MSSQL .
Reference links here:
https://learn.microsoft.com/en-us/sql/integration-services/import-export-data/import-and-export-data-with-the-sql-server-import-and-export-wizard
https://learn.microsoft.com/en-us/sql/integration-services/import-export-data/get-started-with-this-simple-example-of-the-import-and-export-wizard
You can export to either or excel or directly map two tables of different databases and transfer data
According to the MyLittleAdmin site you can opent the table to view the data and export it form there.

Export a SSRS 2005 report in XML to PDF

I'm using C# with ASP.NET(2.5) and SQL Server 2005.
I have an SSRS 2005 Report (*.rdl) stored in a varbinary field in the database, and I need to generate a report (in PDF or image file) and send it by e-mail, with some parameters. The CRUD part is OK, but I can't generate the report and export to PDF from an XML string (that I get from the varbinary field).
I don't have any code to give to you folks (sorry). I tried lots of tutorials from the web and none of them suited for me. I also searched here in stack overflow and didn't find anything.
Note 1: I know how to do it from a file stored in a hard drive, for example. I don't want to save the file I get from the varbinary field in the hard drive and generate the report from it. I want to generate the report from the XML string stored in a variable.
Note 2: I'm new to C#, and have another silly question: Crystal Report (.rpt) and SSRS (.rdl) are different files (different XML structures), right?
Firstly, in answer to Note 2, Crystal Reports and SSRS are competitors, so yes, the formats are different.
Secondly, you want to use the ReportExecutionService class. If you have any report parameters to set, use SetExecutionParameters() and Render() with Format=PDF.

How to export crystal report directly to pdf in c# 2010?

How to export crystal report to pdf directly, instead of saving on disk, it open and user has to save it through pdf file option.
I have tried , export to disk , export functions but none work as required...
I have taken reference from these pages
http://www.tek-tips.com/viewthread.cfm?qid=1398387
http://www.tek-tips.com/viewthread.cfm?qid=1028856
http://social.msdn.microsoft.com/Forums/en/vscrystalreports/thread/3201734e-8e88-4b04-b7f5-848ac1ce4fb5
http://forums.asp.net/t/1585859.aspx/1
Any help will be appreciated. Thanks.
I am Currently using vs 2010 c# and sql server 2005 and Sap Crystal Report.
In order to open the crystal report in PDF format, you first need to save it. You should export the PDF to a temp folder (eg: System.IO.Path.GetTempPath()), then open it.
If your user wants to keep it, he can save it where he wants.
In fact, if you look at the Crystal Report Viewer, it does the same exact thing. It saves the .rpt using a guid then open it.

How to display a SQL Reporting Service report in Excel

At the moment i am using VSTO to take a SQL Reporting Services report and display it in Excel 2003 using the ReportViewer control. So bascially on a winform hosted inside Excel.
But i also need to be able to display it without the ReportViewer control i.e. just straight into the cells of my Excel sheet.
I'm wonder how I should go about this.
I can retreive the report in CSV format. So should I just loop through the cvs formatted report and insert directly into my Excel sheet one row after another or is there a better way?
You might want to look at what I did trying to print a RS report without user input. It uses RS's web services endpoint to deliver the report into the application. The only difference is that instead of using an IMAGE format, you'd use an EXCEL format on the render call.
Viewing the Reporting Services reports in a web browser has an Export option right at the top of the report. Excel is one of those options. It even exports the formatting. Note that this is for SSRS 2005 - I do not know if anything changed in SSRS 2008.
Can you not just dump the data directly into Excel using CopyFromRecordset?

Categories