dynamic parameter and single parameter in ssrs Report ax 2012
[DataContractAttribute,SysOperationContractProcessingAttribute(classStr(ALE_PositionVacantUIBuilder))]
class ALE_PositionVacantContract
{
Ale_Period period;
ProjId projId;
}
[DataMemberAttribute('period')]
public Ale_Period parmPeriod(Ale_Period _period = period)
{
period = _period;
return period;
}
.................................................................
class ALE_PositionVacantController extends SrsReportRunController
{
#define.ReportName('ALE_PositionVacantReports.Report')
}
public static void main(Args _args)
{
ALE_PositionVacantController controller = new ALE_PositionVacantController();
ALE_PositionVacantContract contract;
contract = new ALE_PositionVacantContract();
controller.parmReportName(#ReportName);
controller.parmShowDialog(true);
controller.startOperation();
}
.....................................................................
class ALE_PositionVacantUIBuilder extends SrsReportDataContractUIBuilder
{
ALE_PositionVacantContract positionVacantContract;
DialogField peroidDialogField;
}
..............................
public void build()
{
positionVacantContract = this.dataContractObject();
peroidDialogField = this.addDialogField(methodstr(ALE_PositionVacantContract,parmPeriod), positionVacantContract);
}
............
public void getFromDialog()
{
positionVacantContract = this.dataContractObject();
super();
}
..........
private void peroidLookup(FormStringControl _formStringControl)
{
Query query = new Query();
QueryBuildDataSource qbdsProjTable;
SysTableLookup sysTableLookup;
// Create an instance of SysTableLookup with the current calling form control.
sysTableLookup = SysTableLookup::newParameters(tableNum(Ale_PeriodMaster), _formStringControl);
// Add fields to be shown in the lookup form.
sysTableLookup.addLookupfield(fieldNum(Ale_PeriodMaster, Name), true);
qbdsProjTable = query.addDataSource(tableNum(Ale_PeriodMaster));
sysTableLookup.parmQuery(query);
// Perform the lookup
sysTableLookup.performFormLookup();
}
..............
public void postBuild()
{
super();
peroidDialogField = this.bindInfo().getDialogField(this.dataContractObject(), methodStr(ALE_PositionVacantContract,parmPeriod));
peroidDialogField.registerOverrideMethod(methodStr(FormStringControl, lookup), methodStr(ALE_PositionVacantUIBuilder, peroidLookup), this);
peroidDialogField.lookupButton(2);
}
.......
public void postRun()
{
//super();
}
.......
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
[
SRSReportQueryAttribute(querystr(ALE_PositionVacantProjTable)),
SRSReportParameterAttribute(classstr(ALE_PositionVacantContract))
]
class ALE_PositionVacantDP extends SrsReportDataProviderPreProcessTempDB//SRSReportDataProviderBase //SrsReportDataProviderPreProcess //
{
int serialNo;
Ale_Period period;
ALE_PositionVacantTmp positionVacantTmp;
}
................
[SRSReportDataSetAttribute('ALE_PositionVacantTmp')]
public ALE_PositionVacantTmp getpositionVacantTmp()
{
select * from positionVacantTmp;
return positionVacantTmp;
}
..............
[SysEntryPointAttribute(true)]
public void processReport()
{
ProjTable projTable;
ALE_PositionVacantContract contract = this.parmDataContract() as ALE_PositionVacantContract;
Query q = this.parmQuery();
QueryRun qr = new QueryRun(q);
period = contract.parmPeriod();
while (qr.next())
{
projTable = qr.get(tableNum(ProjTable));
}
}
No comments:
Post a Comment