![](https://img2023.cnblogs.com/blog/529017/202304/529017-20230407100804653-1526169302.png)
using System; using System.Collections; using System.Collections.Generic; using System.ComponentModel; using System.Windows.Forms; using System.Drawing; using System.Data; using FastReport; using FastReport.Data; using FastReport.Dialog; using FastReport.Barcode; using FastReport.Table; using FastReport.Utils; namespace FastReport { public class ReportScript { private void Data1_AfterData(object sender, EventArgs e) { String str ="001_true;002|false;003_true;004_true;"; string[] temp = str.Split(';'); if (temp.Length > 0) { for (int i = 0; i < temp.Length; i++) { string[] obj = temp[i].Split('_'); if(obj[0] =="001" && obj[1] == "true") { CheckBox1.Checked=true; } if(obj[0] =="002" && obj[1] == "true") { CheckBox2.Checked=true; } if(obj[0] =="003" && obj[1] == "true") { CheckBox3.Checked=true; } if(obj[0] =="004" && obj[1] == "true") { CheckBox4.Checked=true; } } } } } }
预览效果:
博客内容主要用于日常学习记录,内容比较随意,如有问题,还需谅解!!!