Ok, I will try to debug again and make sure the temp table buffer first.
Meanwhile, probably it will be best if I put the RDP class it self, just to make sure I'm doing it correctly, provided the data is wrong. So the logic (after I simplify and remove un necessary code, is like below:
[
SRSReportParameterAttribute(classstr(MyContractClass))
]
class MyRDPClass extends SrsReportDataProviderPreProcessTempDB
{
TempReportDB TempReportDB;
Name selectSite;
TempTable TempTable;
[SRSReportDataSetAttribute(tablestr(TempReportDB))]
public TempReportDB getTempReportDB()
{
select TempReportDB;
return TempReportDB;
}
[SysEntryPointAttribute]
public void processReport()
{
MyContractClass contract;
Query query;
QueryRun queryRun;
QueryBuildDataSource qbds;
contract = this.parmDataContract() as MyContractClass;
selectSite = contract.parmSelectSite();
if (!selectSite || selectSite == "Asia")
{
this.processSiteAsia();
}
if (!selectSite || selectSite == "Europe")
{
this.processSiteEurope();
}
if (!selectSite || selectSite == "EMEA")
{
this.processSiteEMEA();
}
query = new query();
qbds = query.addDataSource(TableNum(TempTable));
queryRun = new QueryRun(query);
while (queryRun.next())
{
TempTable = queryRun.get(tableNum(TempTable));
TempReportDB.clear();
TempReportDB.FieldAA = TempTable.FieldAA;
TempReportDB.FieldBB = TempTable.FieldBB;
TempReportDB.FieldCC = TempTable.FieldCC;
TempReportDB.insert();
}
}
public void processSiteAsia()
{
tblAsia tblAsia;
while select * from tblAsia
{
TempTable.clear();
TempTable.fieldAA = tblAsia.code;
TempTable.fieldBB = tblAsia.name;
TempTable.fieldCC = tblAsia.amountABC;
TempTable.insert();
}
}
public void processSiteEurope()
{
tblEurope tblEurope;
while select * from tblEurope
{
TempTable.clear();
TempTable.fieldAA = tblAsia.EUCode;
TempTable.fieldBB = tblAsia.name;
TempTable.fieldCC = tblAsia.amountEU;
TempTable.insert();
}
}
public void processSiteEMEA()
{
tblEMEA tblEMEA;
while select * from tblEMEA
{
TempTable.clear();
TempTable.fieldAA = tblEMEA.ID;
TempTable.fieldBB = tblEMEA.customer;
TempTable.fieldCC = tblEMEA.balanceamount;
TempTable.insert();
}
}
}
Thanks