This is my step and Code:
1. I prepare my project by create Temp table to be a buffer for data and report that I need to have.
2. In a tmp table /MOT_C9991_Tabletmp/ I setup to be tempDB and I create field in this table to be my buffer to display in my report.
3. I create a class /MOT_C9991_BlankReportContract/ to support a parameter in my report.
this is a code: (No error)
[DataContractAttribute]
public class MOT_C9991_BlankReportContract
{
str itemid;
str dataareaid;
[DatamemberAttribute('Item Id')]
public str saleItemID(str _ItemID= ITEMID)
{
ITEMID=_ITEMID;
return ITEMID;
}
[DataMemberAttribute('Data Area Id')]
public str saleDATAAREAID(str _DATAAREAID=DATAAREAID)
{
DATAAREAID=_DATAAREAID;
return DATAAREAID;
}
}
4. I create a class /MOT_C9991_BlankReportDP/ to query data to buffer in my temp table that I can show in my report
this is a code:(No Error)
[SRSReportParameterAttribute(classstr(MOT_C9991_BlankReportContract))]
public class MOT_C9991_BlankReportDP extends SrsReportDataProviderPreProcess
{
MOT_C9991_Tabletmp MOT_C9991_Tabletmp;
[SRSReportParameterAttribute('MOT_C9991_Tabletmp')]
public MOT_C9991_Tabletmp GetData()
{
MOT_C9991_Tabletmp tableTmp;
select * from tableTmp;
return tableTmp;
}
public void processreport()
{
MOT_C9991_Tabletmp tableTmp;
MOT_C9991_BlankReportContract contract;
str _DataAreaId, _ItemId;
SalesLine saleLineTable;
contract = this.parmDataContract();
_DataAreaId = contract.SaleDataAreaId(); // Corrected case
_ItemId = contract.SaleItemId(); // Corrected case
while select salesid, ItemID, Dataareaid, Lineamount from saleLineTable
where saleLineTable.ItemID == _ItemId && saleLineTable.DataAreaID == _DataAreaId
{
tableTmp.salesID = saleLineTable.salesid;
tableTmp.itemID = saleLineTable.itemid;
tableTmp.DataArea = saleLineTable.DataAreaId;
tableTmp.LineA = saleLineTable.LineAmount;
tableTmp.insert();
}
}
}
5. this step I would like to map my dataset to my data provider but when I processed I didn't see any fields.
what's wrong in my code can someone guide me how to do?
Thank in advance.
BR,
Thanakorn