Hi Everyone,
Due to new in development i am unable to use AOT query and its datasources in my RDP class.
Can someone tell that how do i use attached AOT query in RDP class(and also where necessary) :
My Purpose is to display all related data source field on the report like Person Name,Personnel Number, Position, Department, image etc.
x---------------x-------------------x
<
public void processReport()
{
//AssetId assetId;
//AssetGroupId assetGroupId;
//boolean boolInclTax;
Query query;
QueryRun queryRun;
QueryBuildDataSource queryBuildDataSource;
QueryBuildRange queryBuildRange;
AssetTable queryAssetTable;
EA_Condition_Contract dataContract;
// Get the query from the runtime using a dynamic query.
// This base class method reads the query specified in the SRSReportQueryAttribute attribute.
query = this.parmQuery();
// Get the parameters passed from runtime.
// The base class methods read the SRSReportParameterAttribute attribute.
dataContract = this.parmDataContract();
AssetId = dataContract.parmAssetId();
AssetConditionId = dataContract.parmAssetConditionId();
// boolInclTax = dataContract.parmInclTax();
// Add parameters to the query.
queryBuildDataSource = query.dataSourceTable(tablenum(AssetTable));
if(AssetId)
{
queryBuildRange = queryBuildDataSource.findRange(fieldnum(AssetTable, AssetId));
// if (!queryBuildRange)
//// {
// queryBuildRange = queryBuildDataSource.addRange(fieldnum(AssetTable, AssetId));
// }
// If an account number has not been set, then use the parameter value to set it.
if(!queryBuildRange.value())
queryBuildRange.value(AssetId);
}
if(AssetConditionId)
{
queryBuildRange = queryBuildDataSource.findRange(fieldnum(AssetTable, Condition));
if (!queryBuildRange)
{
queryBuildRange = queryBuildDataSource.addRange(fieldnum(AssetTable, Condition));
}
// If an account statement has not been set, then use the parameter value to set it.
if(!queryBuildRange.value())
queryBuildRange.value(AssetConditionId);
}
// if(boolInclTax)
//{
// queryBuildRange = queryBuildDataSource.findRange(fieldnum(CustTable, InclTax));
// if (!queryBuildRange)
// {
/// queryBuildRange = queryBuildDataSource.addRange(fieldnum(CustTable, InclTax));
// }
// If flag to include tax has not been set, then use the parameter value to set it.
// if(!queryBuildRange.value())
// queryBuildRange.value(int2str(boolInclTax));
// }
// Run the query with modified ranges.
queryRun = new QueryRun(query);
ttsbegin;
while(queryRun.next())
{
tmpAssetTable.clear();
queryAssetTable = queryRun.get(tablenum(AssetTable));
tmpAssetTable.AssetId = queryAssetTable.AssetId;
tmpAssetTable.AssetConditionId=queryAssetTable.Condition;
tmpAssetTable.Name = queryAssetTable.Name;
// tmpAssetTable.AssetGroupName = queryAssetTable.AssetGroup();
tmpAssetTable.insert();
}
ttscommit;
}
>/
thank you