7

I have a reportviewer in windows form application which is showing RDLC report. I need to copy a text of that report and save it in notepad. Can anybody help? enter image description here

e.g I need to copy the text "LiFTER ASSY" only, but without exporting directly from reportviewer itself.

Sagar Dev Timilsina
  • 1,310
  • 15
  • 32

3 Answers3

2

You either export or copy it yourself by typing. It's read-only the generated report.

Dragos
  • 296
  • 2
  • 4
  • 13
1

You can export the report to pdf, excel or word. From there you can try to copy the text.

Dimitar Tsonev
  • 3,711
  • 5
  • 40
  • 70
  • That's not a solution in my context. Exporting is not solution, but I need to copy only specific words form the report. eg. "Nation" from entire essay about nation. And I think that exporting the report might not be an efficient solution. Its faster rather typing. Therefore I need to copy specific texts. – Sagar Dev Timilsina May 01 '14 at 07:13
  • When you export the report its the same like you see it in rendered in the application. If you export it in excel, you can copy the cell content for example – Dimitar Tsonev May 01 '14 at 07:19
  • I have already understood what you mean, but please,, that is not a solution for me. I hope my question is clear to you. – Sagar Dev Timilsina May 01 '14 at 07:21
  • Can you please provide screenshot of the report. – Dimitar Tsonev May 01 '14 at 07:23
0

Since 2005 I've been waiting for this feature!

The only workarround I've ever found is to use the Hyperlink event from ReporViewer in order to emulate the copy action (based on http://www.devx.com/dotnet/Article/30424/0/page/6).

In the report, set an hiperlink like:

="copy:" & Fields!SomeField.Value

And then in the code:

private void reportViewer_Hyperlink(object sender, HyperlinkEventArgs e)
{
    Uri uri = new Uri(e.Hyperlink);
    if (uri.Scheme.ToLower() == "copy")
    {
        System.Windows.Forms.Clipboard.SetText(uri.Authority);
        e.Cancel = true; // Load the customer details in another form
        ((ReportViewer)sender).RefreshReport();
    }
 }
Alex
  • 797
  • 10
  • 30