This is a migrated thread and some comments may be shown as answers.

User interaction in winforms report viewer

5 Answers 108 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Daniel Sprague
Top achievements
Rank 1
Daniel Sprague asked on 04 Nov 2015, 04:26 PM

I have a standard winforms app displaying numerous Telerik reports in a winforms ReportViewer, using Reporting Q3 2015.

My users would like a couple features implemented:

1.  Ability to select/copy/paste report content from a report to some other app.

When the report is instantiated in the report viewer and mouse is over it, a hand cursor appears, enabling scrolling of the report, but no other functionality.  

Is there a way to alter that behavior to allow a user to select some content in the report, then CTRL-C it, similar to what can be done in reports in the Telerik web report viewer?

I don't need to allow editing of the report at runtime, just "mousedown -> drag to select -> ctrl-c".

 

2. Ability to export reports to PDF or Excel without having to save first.

I found this article: http://www.telerik.com/help/reporting/faq-display-pdf-browser.html

Obviously the winforms report viewer already has export to PDF/Excel functionality in the report toolbar... Is there a way to override that click event?  

Of course I could simply put a new button on the form, enabling that export without saving first functionality... but having 2 export buttons certainly isn't efficient.

 

If it makes any difference, in my app I have some reports implemented as classes from a library, and others as trdx files.  So can go either way if it makes things easier.

 

Thanks much for assistance with these issues.

5 Answers, 1 is accepted

Sort by
0
Stef
Telerik team
answered on 09 Nov 2015, 12:55 PM
Hello Daniel,

On your questions:
  1. The report is rendered as an image in the WinForms ReportViewer control. Thus copy/paste operations cannot be supported. Instead the document can be exported from the viewer or in code in a suitable format for further processing.
  2. Reports loaded in the viewer are already processed for the selected report parameters' values, if any. Thus using the viewer's export options results in rendering in the selected format.
    If there are report parameters, which AutoRefresh is set to false, the end-user may need to click the Preview button to update the document before exporting.
    The export functionality can be used also through the viewer's API, or you can export programmatically a separate instance of the report via ReportProcessor.

Let us know if you have any further questions.

Regards,
Stef
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Daniel Sprague
Top achievements
Rank 1
answered on 11 Nov 2015, 03:07 PM

Thanks Stef for your response.  That helps.  Just curious though... with your reply to #1, guess I'm not quite getting it.

I get the part about reports being rendered as an image.  But at the same time, we have some reports that include user interaction features, such as clicking a +/- for expanding/collapsing or embedded/inline hyperlinks.

Those interactive elements, are they rendered "on top" of the image or something?

Thanks again.

0
Daniel Sprague
Top achievements
Rank 1
answered on 11 Nov 2015, 04:07 PM

Stef, for #1, I have an idea.  It's simple in concept, but might not be possible.  

Suppose I have displayed in a report a data field 'customer name'.  I need to enable users to copy the cust name to the windows clipboard.

Is it possible to render the customer name on the report as a hyperlink, then when a user clicks it, the customer name string is placed in the windows clipboard.  Then they can paste that in an email or whatever.

Please let me know if this is possible, and provide some basic steps or a sample project to help me go in the right direction.

Thanks much!

0
Stef
Telerik team
answered on 16 Nov 2015, 12:02 PM
Hello Daniel,

The report is rendered as an image, where actions are supported by additional mechanism (we are sending meta data which items have actions, and their coordinates). The supported actions would not allow you to add functionality to copy content associated with the item.

We will appreciate it if you include the case description in the feature request for custom actions in our feedback portal.


A possible solution to have copy/paste is to use a WebBrowser control and load a page with the HTML5 Viewer in the WinForms application. The attached demo project illustrates the result. If there are issues on export and print, you can perform the operation in code through the ReportProcessor e.g. Exporting Report Programmatically.


I hope this information is helpful.

Regards,
Stef
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
B
Top achievements
Rank 1
answered on 18 Nov 2015, 08:01 PM

Thanks Stef.  

I briefly considered that as a possible solution.  But only briefly because it is a considerable amount of work... but, have to give the users what they want :) 

Have a great day. 

 

Tags
General Discussions
Asked by
Daniel Sprague
Top achievements
Rank 1
Answers by
Stef
Telerik team
Daniel Sprague
Top achievements
Rank 1
B
Top achievements
Rank 1
Share this question
or