cncaiker
級(jí)別: 正式會(huì)員
精華主題: 0
發(fā)帖數(shù)量: 3 個(gè)
工控威望: 93 點(diǎn)
下載積分: 576 分
在線(xiàn)時(shí)間: 1(小時(shí))
注冊(cè)時(shí)間: 2015-11-07
最后登錄: 2023-03-20
查看cncaiker的 主題 / 回貼
樓主  發(fā)表于: 2016-04-05 16:05
float Ayear;
float Amonth;
float Aday;
long x;
long y;
long Row;
long StartTime;
string temp;
Ayear=ADate.Year;
Amonth=ADate.Month;
Aday=ADate.Day;
temp=StrFromInt( Ayear, 10 );
if(Amonth<10)
temp=temp+"-0"+StrFromInt( Amonth, 10 );
else
temp=temp+"-"+StrFromInt( Amonth, 10 );
if(Aday<10)
temp=temp+"-0"+StrFromInt( Aday, 10 );
else
temp=temp+"-"+StrFromInt( Aday, 10 );
\\本站點(diǎn)\選擇日期=temp;
ReportSetCellString2("Report2", 7, 1, 30, 11, " "); //清空單元格
ReportSetCellString2("Report2", 38, 1, 61, 11, " "); //清空單元格
ReportSetCellString("Report2", 3, 10, temp);//填寫(xiě)日期
//查詢(xún)數(shù)據(jù)
StartTime=HTConvertTime(Ayear,Amonth,Aday,0,0,0);
ReportSetHistData("Report2", "\\本站點(diǎn)\Fl", StartTime, 3600, "B7:B30");
ReportSetHistData("Report2", "\\本站點(diǎn)\F2", StartTime, 3600, "C7:C30");
ReportSetHistData("Report2", "\\本站點(diǎn)\CODcr1", StartTime, 3600,"D7:D30");
ReportSetHistData("Report2", "\\本站點(diǎn)\pH1", StartTime, 3600, "E7:E30");
ReportSetHistData("Report2", "\\本站點(diǎn)\pH2", StartTime, 3600, "F7:F30");
ReportSetHistData("Report2", "\\本站點(diǎn)\DO1", StartTime, 3600, "G7:G30");
ReportSetHistData("Report2", "\\本站點(diǎn)\Ba_C", StartTime, 3600, "H7:H30");
ReportSetHistData("Report2", "\\本站點(diǎn)\Bb_C", StartTime, 3600, "I7:I30");
ReportSetHistData("Report2", "\\本站點(diǎn)\Ba_BR", StartTime, 3600, "J7:J30");
ReportSetHistData("Report2", "\\本站點(diǎn)\Bb_BR", StartTime, 3600, "K7:K30");
//查詢(xún)數(shù)據(jù)
StartTime=HTConvertTime(Ayear,Amonth,Aday,0,0,0);
ReportSetHistData("Report2", "", StartTime, 3600, "B38:B61");
ReportSetHistData("Report2", "", StartTime, 3600, "C38:C61");
ReportSetHistData("Report2", "\\本站點(diǎn)\ID_0", StartTime, 3600,"D38:D61");
ReportSetHistData("Report2", "\\本站點(diǎn)\ID_1", StartTime, 3600, "E38:E61");
ReportSetHistData("Report2", "\\本站點(diǎn)\ID_2", StartTime, 3600, "F38:F61");
ReportSetHistData("Report2", "\\本站點(diǎn)\F4", StartTime, 3600, "G38:G61");
ReportSetHistData("Report2", "\\本站點(diǎn)\CODcr2", StartTime, 3600, "H38:H61");
ReportSetHistData("Report2", "\\本站點(diǎn)\pH3", StartTime, 3600, "I38:I61");
//填寫(xiě)時(shí)間
x=0;
       while(x<24)
       {
       row=7+x;
       y=StartTime+x*3600;
       temp=StrFromTime( y, 2 );
       ReportSetCellString("Report2", row, 1, temp);
       x=x+1;
       }


請(qǐng)問(wèn)38~61在時(shí)間怎么自動(dòng)填入?