Copy RDLC report text and paste in notepad
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?
eg I need to copy the text "LiFTER ASSY" only, but without exporting directly from reportviewer itself.
You either export or copy it yourself by typing. It's read-only the generated report.
You can export the report to pdf, excel or word. From there you can try to copy the text.
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();
}
}
链接地址: http://www.djcxy.com/p/20210.html
上一篇: 当SoapClient尝试获取模式文件时发生401身份验证错误
下一篇: 复制RDLC报告文本并粘贴到记事本中