我使用VS2017 C#WinForms创建了一个应用程序,使用RDLC reportviewer创建了一个内部表格的报告,该报告运行良好,我想直接打印此报告并将其发送到打印机而不会弹出打印预览对话框。 / p>
请注意我搜索了这个问题,并搜索了这个网站,我找不到解决方案。
尝试使用MSDN主题(演练:打印没有预览的本地报告),但仍然没有运气。
这是我的按钮,它运行多个查询,包括打开一个包含rdlc reportviewer的表单(凭证),该报表查看器加载要在报告中显示的数据:
private void button12_Click(object sender, EventArgs e)
{
SoundPlayer player = new SoundPlayer(Properties.Resources.switch_8);
player.Play();
if (string.IsNullOrWhiteSpace(textBox1.Text) || textBox1.Text == "0")
{
MessageBox.Show("Please select an item!");
}
else
{
MOVE_TO_SOLD();
UPDATE_RECEIPT();
LOAD_DATA();
CLEAR_TEMP();
CHECK_FOR_REC_ID();
GET_NEW_REC_ID();
LOAD_DATA();
txtdiscount.Text = "0";
textBox5.Text = "0";
recowner.Text = recnum.Text;
voucher vr = new voucher();
vr.ShowDialog();
}
}
谢谢!