Report.DetailGrid.Recordset.ConnectionString = "..."; Report.DetailGrid.Recordset.QuerySQL = "...";
Report.DetailGrid.Recordset.ConnectionString = yourBuildConnectionString;
Report.ParameterByName("Parameter1").AsString = "..."; Report.ParameterByName("Parameter1").AsBoolean = true; Report.ParameterByName("Parameter1").AsDateTime = ...; Report.ParameterByName("Parameter1").AsFloat = 9.78; Report.ParameterByName("Parameter1").AsInteger = 95;
Report.ControlByName("StaticBox1").AsStaticBox.Text = "..."; Report.ControlByName("MemoBox1").AsMemoBox.Text = "..."; Report.ControlByName("PictureBox1").AsPictureBox.LoadFromFile("%参数为图像文件的文件路径或URL%"); Report.ControlByName("Barcode1").AsBarcode.Text = "..."; Report.ControlByName("FreeGrid1").AsFreeGrid.CellAt(1,2).Text = "YourText";
var sr = Report.ControlByName("SubReport1").AsSubReport.Report;
Report.DetailGrid.Recordset.Edit(); //准备修改当前记录的值 //或者: Report.DetailGrid.Recordset.Append(); //增加新记录,通常在 FetchRecord 事件中调用 Report.FieldByName("Field1").AsString = "..."; Report.FieldByName("Field2").AsBoolean = true; Report.FieldByName("Field3").AsDateTime = ...; Report.FieldByName("Field4").AsFloat = 9.78; Report.FieldByName("Field5").AsInteger = 95; Report.DetailGrid.Recordset.Post();备注:在设置字段值之前,必须要调用 Edit 或 Append 方法,最后要调用 Post 方法。如果是在 Edit 方法之后设置字符串类型的字段,必须要设置此字段的“长度(Length)”属性为非0。
Report.Printer.PrinterName = ...; Report.PrintAsDesignPaper = false; //如果需要报表生成的打印页面与当前打印机的页面设置保持一致,必须将此属性设置为false Report.Printer.PaperSize = ...; Report.Printer.PaperName = ...; Report.Printer.PaperWidth = ...; Report.Printer.PaperLength = ...; Report.Printer.PaperOrientation = ...; Report.Printer.LeftMargin = ...; Report.Printer.RightMargin = ...; Report.Printer.TopMargin = ...; Report.Printer.BottomMargin = ...; Report.Printer.Copies = ...; Report.Printer.Collate = ...; Report.Printer.Duplex = ...;
Report.Printer.DesignPaperSize = ...; Report.Printer.DesignPaperName = ...; Report.Printer.DesignPaperWidth = ...; Report.Printer.DesignPaperLength = ...; Report.Printer.DesignPaperOrientation = ...; Report.Printer.DesignLeftMargin = ...; Report.Printer.DesignRightMargin = ...; Report.Printer.DesignTopMargin = ...; Report.Printer.DesignBottomMargin = ...;
var RecordNoColumn = Report.DetailGrid.AddColumn("RecordNo", "记录号", "", 1.5); RecordNoColumn.ContentCell.FreeCell = true; //设为自由格 var RecordNoBox= RecordNoColumn.ContentCell.Controls.Add(3).AsSystemVarBox; //grctSystemVarBox 3 系统变量框。 RecordNoBox.SystemVar = 4; //grsvRecordNo 4 明细记录的当前记录号,从1开始计数。 RecordNoBox.Dock = 5; //grdsFill 5 部件框的各个边缘分别停靠在父容器的各个边缘,并且适当调整大小。