解决方法:
DataSet dsPrintLotLabelID = new DataSet(); dsPrintLotLabelID.Tables.Add(dataPrint.Tables[0].Copy()); //设置数据集名称这句是关键,有时候不设置也可以打印,有时候打印出来空白 dsPrintBoxLabelID.DataSetName = "SQLDataSet"; dsPrintBoxLabelID.Tables[0].TableName = "t1"; StiReport stireport2 = new StiReport(); stireport2.Load(path + BoxLabelID + ".mrz"); stireport2.RegData(dsPrintLotLabelID); stireport2.Dictionary.Synchronize(); if (cbIsPrint.Checked) { stireport2.Show(); } else { stireport2.Print(false, printerSettings); }
标签:Tables,stireport2,标签,打印,空白,StiReport,dsPrintLotLabelID From: https://www.cnblogs.com/weifeng123/p/17335603.html