Copy SSRS report content to clipboard - asp.net

I have a button("Copy to Clip") in each row of a Gridview. On this buttton click I want to copy a SSRS report which is stored in database in binary format to Clipboard. Can somebody help please?
Thanks

Make an ajax call to your report server using url parameters to get the report in the format you want.
CSV would be a good format to paste into your clipboard.
http://localhost/reportserver?/Folder/report&param=val&rs:Command=Render&rs:Format=CSV
Then use a library like ZeroClipboard to paste the contents to clipboard. Its cross browser compatible as it uses flash.

Related

Download an excel file as attachment using Qt browser

I am working on Qt browser(code taken from Qt Tab Browser Example). This Qt browser successfully downloads an image file, but not an excel/pdf file. I need to download an excel/pdf file as attachment on click of a button. Excel generation code at back-end uses PHPExcel to generate and finally saves it using 'php://output'.
On browser side, when I read through QNetworkReply's 'readAll()' function, some encoded string '��ࡱ�' gets printed and nothing gets saved in QFile object, totally empty file.
How do I get the desired excel file from this encoded string ?
Please, any help. It is Linux OS and I use LibreOffice if it matters.
Well, got the answer. I was printing QNetworkReply object's content on the console using reply->readAll() before reading it into the file and Qt documentation states that:
QNetworkReply is a sequential-access QIODevice, which means that once
data is read from the object, it no longer kept by the device.
Therefore, i ended up with an empty file. Found this when i printed the size of the 'reply' object. Also, found some eventLoop related help from here(Roozbeh's answer).
Hope it helps someone else as well. Thanks SO !

Wordpress "I think you have a wrond seperator"

I am uploading my wordpress website database from excel. How ever getting this error
I think you have the wrong separator. Please go to the settings page and change your separator!
This may be the excel version problem as MS excel have no support for ; & ,. So if your database contains any of this symbol ms - excel will not support it. When you open such databse from ms-excel & made changes then Go to Save as & keep CSV format instead of default excel format & save it. That will definitely work..
For more information refer this link

How to send excel file directly to printer or print html code?

I have an ASP.Net 3.5 (C#) site that loads an excel file and then I want to print on a label printer at teh user's default printer?
Excel File is populated on sheet1
Print Area has been set in the file
When I print from excel to the label printer it prints fine.
I would like to send the excel file to the user's default printer. and have it automatically print the print area or the first sheet.
I would be open to sending a HTML String that has my data formatted in a table if that is possible. That would eliminate any need for the excel file.
Microsoft Excel is not installed on the webserver so using the Excel Refrence is out. But I do have the Microsoft Office SDK 2.0 and can use that if needed.
Thanks in advance for any tips or any directions.
Anything you could do manually, you can record using the macro recorder and figure out the code. Here is a generated code for sending files to my printer:
Application.ActivePrinter = "HP LaserJet P2014 on Ne03:"
ExecuteExcel4Macro "PRINT(1,,,1,,,,,,,,2,""HP LaserJet P2014 on Ne03:"",,TRUE,,FALSE)"
You could change the variables to match your own printer

Code to upload an excel file and read it in a dataset

I have a requirement , where in I have to upload an .xlsx file on the server and then read the file into a data table using c# , asp.net.
I need to get your file onto the server.
I need to open the (uploaded?) file.
I need to read the contents of the file, applying any nessesary data parsing.
I need to display the results in a gridview.
Help would be appreciated.

Exporting a HTML Table to Excel from ASP.NET MVC

I am currently working with ASP.NET MVC and I have an action method that displays few reports in the view in table format.
I have a requirement to export the same table to an Excel document at the click of a button in the View.
How can this be achieved? How would you create your Action method for this?
In your controller action you could add this:
Response.AddHeader("Content-Disposition", "filename=thefilename.xls");
Response.ContentType = "application/vnd.ms-excel";
Then just send the user to the same view. That should work.
I'm using component, called Aspose.Cells (http://www.aspose.com/categories/.net-components/aspose.cells-for-.net/).
It's not free, though the most powerful solution I've tried +)
Also, for free solutions, see: Create Excel (.XLS and .XLSX) file from C#
Get data from database using your data access methods in dot net.
Use a loop to get each record.
Now add each record in a variable one by one like this.
Name,Email,Phone,Country
John,john#john.com,+12345,USA
Ali,ali#ali.com,+54321,UAE
Naveed,naveed#naveed.com,+09876,Pakistan
use 'new line' code at the end of each row (For example '\n')
Now write above data into a file with extension .csv (example data.csv)
Now open that file in EXCEL
:)

Resources