📄 uprn.dfm
字号:
object frmPrn: TfrmPrn
Left = 192
Top = 114
Width = 696
Height = 480
Caption = #25171#21360
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = []
OldCreateOrder = False
PixelsPerInch = 96
TextHeight = 13
object frxReport1: TfrxReport
Version = '3.18'
DotMatrixReport = False
IniFile = '\Software\Fast Reports'
PreviewOptions.Buttons = [pbPrint, pbLoad, pbSave, pbExport, pbZoom, pbFind, pbOutline, pbPageSetup, pbTools, pbEdit, pbNavigator]
PreviewOptions.Zoom = 1.000000000000000000
PrintOptions.Printer = #39044#35774
ReportOptions.CreateDate = 39141.815437465280000000
ReportOptions.LastChange = 39141.845616504630000000
ScriptLanguage = 'PascalScript'
ScriptText.Strings = (
'begin'
''
'end.')
StoreInDFM = False
Left = 72
Top = 56
Datasets = <>
Variables = <>
Style = <>
end
object frxDesigner1: TfrxDesigner
DefaultScriptLanguage = 'PascalScript'
DefaultFont.Charset = DEFAULT_CHARSET
DefaultFont.Color = clWindowText
DefaultFont.Height = -13
DefaultFont.Name = 'Arial'
DefaultFont.Style = []
DefaultLeftMargin = 10.000000000000000000
DefaultRightMargin = 10.000000000000000000
DefaultTopMargin = 10.000000000000000000
DefaultBottomMargin = 10.000000000000000000
DefaultPaperSize = 9
DefaultOrientation = poPortrait
Restrictions = []
RTLLanguage = False
Left = 144
Top = 56
end
object frxDBDataset1: TfrxDBDataset
UserName = 'DB1m'
CloseDataSource = False
DataSet = Query1Master
Left = 40
Top = 120
end
object Query1Detail: TADOQuery
Connection = DM.ADOConnection1
CommandTimeout = 0
DataSource = DS1Master
EnableBCD = False
Parameters = <
item
Name = 'id'
DataType = ftString
Size = -1
Value = Null
end>
SQL.Strings = (
'select * from #temp3'
'where sheetid=:id'
'order by gxno')
Left = 48
Top = 192
end
object Query1Master: TADOQuery
Connection = DM.ADOConnection1
CommandTimeout = 0
EnableBCD = False
ParamCheck = False
Parameters = <>
SQL.Strings = (
'select * from #temp2')
Left = 48
Top = 248
end
object ADOQuery1: TADOQuery
CommandTimeout = 0
EnableBCD = False
ParamCheck = False
Parameters = <>
SQL.Strings = (
'declare @cnt int, @id int, @spno varchar(30)'
''
'select a.qty,b.*,sheetid=0,c.khid,c.NeedDate,c.moid,c.poid'
'into #temp1'
'from mobody a, cpgx b, moHead c'
'where a.moid='#39'%0:s'#39' and a.spno=b.spno and c.moid='#39'%0:s'#39
'order by dept,b.spno,gxno'
''
'select distinct id=0,dept,spno,moid,khid,NeedDate,poid'
'into #temp2'
'from #temp1'
''
'select @id=0'
'update #temp2 set @id=@id+1,id=@id'
''
'update #temp1'
'set sheetid=b.id'
'from #temp1 a, #temp2 b'
'where a.dept=b.dept and a.spno=b.spno'
''
'--'#27599#39029'8'#20010#24037#24207
'DECLARE Cursor1 CURSOR FOR'
'SELECT id,spno from #temp2'
''
'OPEN Cursor1'
'FETCH NEXT FROM Cursor1 INTO @id,@spno'
''
'WHILE @@FETCH_STATUS = 0'
'BEGIN'
' select @cnt=count(1) from #temp1 where sheetid=@id'
' while (@cnt<8) begin'
' insert into #temp1(sheetid,gxno,spno) values(@id,@cnt+1000,@' +
'spno)'
' select @cnt=@cnt +1'
' end'
''
' --insert Detail column header'
' insert into #temp1(sheetid,gxno,spno) values(@id,-1,@spno)'
''
' FETCH NEXT FROM Cursor1 INTO @id,@spno'
'END'
''
'CLOSE Cursor1'
'DEALLOCATE Cursor1'
''
'--'#26126#32454#25918#20837'#temp3'#34920
'select C1=space(30),C2=space(30),C3=space(30),C4=space(30),C5=sp' +
'ace(30),'
' C6=space(30),C7=space(30),C8=space(30),C9=space(30),'
' sheetid,spno,Qty,gxno,gxname,gxprice,dept,LineID=identity' +
'(int,1,1)'
'into #temp3'
'from #temp1'
'order by sheetid, gxno'
''
'update #temp3'
'set gxno=(select count(1) from #temp3 a'
' where a.sheetid=#temp3.sheetid and a.LineID<=#temp3.Li' +
'neID)-1'
''
'--'#20462#27491#26576#20123#24037#24207#30340#21152#24037#21333#20215
'update #temp3'
'set gxPrice=b.rate'
'from #temp3 a, matmore b'
'where a.dept=b.dept and a.Qty>=b.LowLevel and a.Qty<b.HighLevel'
' and (a.gxPrice is null or a.gxPrice=0)'
''
'----'#25104#21697#21152#24037#37096#38376#21069#20004#20010#27721#23383#20026#8220#20914#21046#8221#30340#65292#21152#24037#36153#25353#21152#24037#36153#29575#34920#25191#34892#12290
'update #temp3'
'set gxPrice=b.rate'
'from #temp3 a, matmore b'
'where a.dept like '#39#20914#21046'%%'#39' and b.dept='#39#20914#21046#39' and a.Qty>=b.LowLevel a' +
'nd a.Qty<b.HighLevel'
' and (a.gxPrice is null or a.gxPrice=0)'
''
'update #temp3'
'set C3=gxname,C5=gxPrice'
''
'update #temp3'
'set C1='#39#32534#21495#39', C3='#39#29983#20135#24037#24207#39', C4='#39#29983#20135#25968#37327#39', C5='#39#21333#20215#39','
' C6='#39#37329#39069#39', C7='#39#29983#20135#32773#39', C8='#39#23436#25104#26085#26399#39', C9='#39#22791#27880'('#19981#33391#21697')'#39','
' C2=spno'
'where gxno=0'
''
'update #temp3'
'set C1='#39#21517#31216#39','
' C2=(select spname from cp a where a.spno=#temp3.spno)'
'where gxno=1'
''
'update #temp3'
'set C1='#39#35268#26684#39','
' C2=(select spspec from cp a where a.spno=#temp3.spno)'
'where gxno=2'
''
'update #temp3'
'set C1='#39#35746#21333#25968#39','
' C2=(select top 1 cast(Qty as float) from #temp3 a where a.gx' +
'no=1 and a.sheetid=#temp3.sheetid)'
'where gxno=3'
''
'update #temp3'
'set C2='#39#29992#26009#35268#26684#39
'where gxno=4'
''
'update #temp3'
'set C2=(select ljspec from cp a where a.spno=#temp3.spno)'
'where gxno=5'
''
'update #temp3'
'set C2='#39#39046#26009#20154#39
'where gxno=6'
'')
Left = 48
Top = 312
end
object DS1Master: TDataSource
DataSet = Query1Master
Left = 120
Top = 248
end
object frxDBDataset2: TfrxDBDataset
UserName = 'DB1d'
CloseDataSource = False
DataSet = Query1Detail
Left = 112
Top = 120
end
object frxReport2: TfrxReport
Version = '3.18'
DotMatrixReport = False
IniFile = '\Software\Fast Reports'
PreviewOptions.Buttons = [pbPrint, pbLoad, pbSave, pbExport, pbZoom, pbFind, pbOutline, pbPageSetup, pbTools, pbEdit, pbNavigator]
PreviewOptions.Zoom = 1.000000000000000000
PrintOptions.Printer = #39044#35774
ReportOptions.CreateDate = 39144.003619456030000000
ReportOptions.LastChange = 39144.004053877320000000
ScriptLanguage = 'PascalScript'
ScriptText.Strings = (
''
'begin'
''
'end.')
StoreInDFM = False
OnGetValue = frxReport2GetValue
Left = 272
Top = 56
Datasets = <>
Variables = <>
Style = <>
end
object Query2Detail: TADOQuery
Connection = DM.ADOConnection1
Parameters = <>
SQL.Strings = (
'select a.*, b.spname,b.spspec, Qty2=0'
'into #temp1'
'from invBody a left join sp b'
'on a.spno=b.spno'
'where a.invid='#39'%0:s'#39
''
'declare @cnt int'
'select @cnt=count(1) from #temp1'
'while (@cnt<8) begin'
' insert into #temp1(spno,Qty2) values('#39#39',999999)'
' select @cnt=@cnt +1'
'end'
''
'select * from #temp1 order by Qty2')
Left = 264
Top = 184
end
object Query2Master: TADOQuery
Connection = DM.ADOConnection1
Parameters = <>
SQL.Strings = (
'select a.*,b.khname'
'from invHead a left join kh b'
'on a.khid=b.khid'
'where a.invid='#39'%0:s'#39)
Left = 264
Top = 248
end
object frxDBDataset3: TfrxDBDataset
UserName = 'DB2m'
CloseDataSource = False
DataSet = Query2Master
Left = 232
Top = 128
end
object frxDBDataset4: TfrxDBDataset
UserName = 'DB2d'
CloseDataSource = False
DataSet = Query2Detail
Left = 304
Top = 128
end
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -