如何将数据从datagridview传递到Crystal Report [英] How can I pass data from datagridview to Crystal Report

查看:100
本文介绍了如何将数据从datagridview传递到Crystal Report的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在C#中将数据从datagridview传递到Crystal Report我创建了一个具有相同网格视图列的水晶报表我想通过按钮点击将所有数据从网格视图传递到水晶报表请帮助

解决方案

参考: DataGridView to C#中的Crystal Report [ ^ ]


您好Attiq,



您可以通过查询字符串来完成,就像您要重定向一样到Report.aspx。你可以在你想要水晶报告的gridview专栏中添加

这段代码



< asp:hyperlink id =   HyperLink1 runat =   server font-underline =   true  navigateurl =  <%#Eval( Assigned_To  〜/ Report.aspx?column1 = { 0 } < span class =code-string> )< / pre>< / xml> xmlns:asp =  #unknown >  < /   asp:超链接 >  

< /块引用>

然后它更容易





在你的项目中创建一个类文件并声明你想要的变量显示并双击网格视图双击插入在类文件中生成的变量中的值,并将窗体显示为Form.ShowDialoge()并在窗体的页面加载上插入值

How can I pass data from datagridview to Crystal Report in C# I created a crystal report with the same grid-view columns I want to pass all the data from grid-view to crystal report by a button click please help

解决方案

refer :DataGridView to Crystal Report in C#[^]


Hi Attiq,

You can do it through query string like if you are redirecting to Report.aspx. You can add
this code in your gridview column for which you want the crystal report

<asp:hyperlink id="HyperLink1" runat="server" font-underline="true" navigateurl="<%# Eval("Assigned_To", "~/Report.aspx?column1={0}")</pre></xml>" xmlns:asp="#unknown"></asp:hyperlink>


then it is more easy


make a class file in ur project and declare variable which you want to show and on double click on grid view on double click insert the value in the variable that are made in class file and show the form as Form.ShowDialoge() and insert the values on page load of the form


这篇关于如何将数据从datagridview传递到Crystal Report的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆