如何在不使用数据库的情况下直接将文本框和组合框的值传递给报表查看器? [英] How to pass values of textbox and combo box to report viewer directly without using database ?

查看:85
本文介绍了如何在不使用数据库的情况下直接将文本框和组合框的值传递给报表查看器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在visual studio 2015窗体中工作。



我有国家名称和组合框的文本框和按钮和报告查看器控件



我需要点击按钮从文本框名称和combox国家/地区获取值并在报表查看器中显示这些值?b / b
值?



如何通过c#来做到这一点?



假设我写了

名称michel

国家美国

按下按钮打印

获取价值

michel

美国

在报告查看器中



我尝试过:



如何在不使用数据库的情况下直接将文本框和组合框的值传递给报表查看器?

I work in visual studio 2015 windows form .

I have textbox for name and combobox for country and button and report viewer control

I need when click button get value from text box name and combox country and show these

values in report viewer ?

How to do that by c# ?

suppose i write
name michel
country USA
press button print
get the values of
michel
USA
in report viewer

What I have tried:

How to pass values of textbox and combo box to report viewer directly without using database ?

推荐答案

在您的报表查看器页面上;您可以添加参数(有选项可以这样做),通过编码,您可以为报表查看器分配文本框值。



例如

rp1.parameters.add(@ param,textbox1.text);



试试这种方式。





如果事情适合您,请接受解决方案。
on your report viewer page; you can add parameters(there is option to do so) and through your coding you can assign text box values to your report viewer.

e.g.
rp1.parameters.add("@param",textbox1.text);

try this way.


if things work for you accept the solution.


这篇关于如何在不使用数据库的情况下直接将文本框和组合框的值传递给报表查看器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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