如何使用C#中的报表查看器打印收据 [英] How to print receipt using report viewer in C#

查看:86
本文介绍了如何使用C#中的报表查看器打印收据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一份'销售'表格。我已手动将列添加到dgv。它工作正常。

但是当我尝试将它与我的新类'收据'绑定时,它显示了错误,当绑定数据控件时,无法将行编程添加到dgv中。



我将在两天内面对这个问题。任何在这种情况下工作的人都会帮助我。任何指南? < b



我尝试了什么:



我无法'适当尝试一下。我已经搜索了很多但没有成功...



我也试过这个

Datagridview1.datasource = ReceiptbindingSource



但是当绑定数据控件时,无法将相同的错误行添加到datagridview

I have a form 'sales'. I have added columns manually to dgv. It works fine.
But when I tried to bind it with my new class ' receipt ' it showed my the error that Rows cannot be programaticaly added to dgv when data control is bound.

I am facing this issue from two days. Anyone who have worked in this scenario plz do help me. Any guidens? <b

What I have tried:

I couldn't properly try out things. I have searched alot but not succeed...

Also I tried this
Datagridview1.datasource=ReceiptbindingSource

But same error rows cannot be added programaticaly to datagridview when data control is bound

推荐答案

这与标题有什么关系你的帖子?

问题很明显 - 你不能同时手动添加行并控制绑定。



你可以但是,在数据集中添加行...请参阅此链接上的解决方案

将行添加到数据绑定DatagridView [ ^ ]
What has this got to do with the title of your post?
The problem is clear - you can't do both manually add rows and have the control bound.

You can, however, add rows to the dataset ... see the solution on this link
Add Rows To Databound DatagridView[^]


这篇关于如何使用C#中的报表查看器打印收据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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