C#调用Codesoft .LAB文件循环列印,出现列印条码不连续问题
C# 调用.LAB文件,循环传入值,返回1~10的条码。代码:
string strFilePath = System.Windows.Forms.Application.StartupPath + @"\" + "test.lab";
ApplicationClass lbl = new ApplicationClass();
lbl.Documents.Open(strFilePath, false);
Document doc = lbl.ActiveDocument;
doc.Printer.ShowSetup();
for (int i = 1; i <= 10; i++)
{
doc.Variables.FreeVariables.Item("SN").Value = i.ToString();//给LAB文件赋值
int Num = 1;//设定列印份数
doc.PrintDocument(Num);//列印
}
设计需求为1、2、3、4、5、6、7、8、9、10按顺序产生条码,但现在的情况是列印时经常出现不按顺序产生条码,
如:1、2、10、3、4、5、6、7、8、9或1、8、2、3、4、5、6、7、9、10等情况。
请问各位大侠有遇到过这种情况么? 求解决! 谢谢了! --------------------编程问答-------------------- 没人会吗? 自己顶一个!
补充:.NET技术 , C#