Create a new SSRS Report:
1. Create the temporary table for the Report
-> ReportTableTMP, ReportLineTMP
-> Set the Parameter TableType to InMemory or TempDB
2. Create the classes for Controller, Contract and Dataprovider
The Controller-Class
public class Report_Controller extends SrsReportRunController
{
}
public static void main(Args _args)
{
Report_Controller controller;
CustInvoiceTrans CustInvoiceTrans;
;Report_Contract contract = new Report_Contract();
Controller = new Report_controller();
Controller.parmReportName(SSRSReportSTr(ReportNAME),DESIGNName));
Controller.parmArgs(_args);
controller.parmLoadFromSysLastValue(false);
controller.parmShowDialog(false); //No Dialog
CustInvoiceTrans = _args.record();
contract.parmCustInvoiceTrans(CustInvoiceTrans);
Controller.parmReportContract().parmRdpContract(contract);
Controller.startOperation();}
The Contract-Class
[DataContractAttribute]
public class Report_Contract
{
CustInvoiceTrans CustInvoiceTrans;
}and the parmMethode for CustInvoiceTrans...
The Dataprovider -Class
[SRSReportParameterAttribute(classStr(Report_Contract))] <-- These Parameter are necessary
public class ReportDP extends SRSReportDataProviderBase
{
ReportTableTmp TableTMP;
REportLineTmp LineTmp;
}
[SRSReportDataSetAttribute(tableStr(ReportTableTmp))]
public ReportTableTmp getReportTableTmp() <-- you Need this for every temporary table you want to use in the Report
{
select * from ReportTableTmp ;
return ReportTableTmp ;
}
[SRSReportDataSetAttribute(tableStr(ReportLineTmp))]
public ReportLineTmp getReportLineTmp()
{
select * from ReportLineTmp;
return ReportLineTmp;
}
[SysEntryPointAttribute]
public void processReport()
{
REportContract contract;
;
contract = this.parmDataContract();
CustInvoiceTrans = contract.parmCustInvoiceTrans();
//Fill the ReportTableTMP
//Fill the ReportLineTMP
}
The MenuItem parameter for the Report
How to call the Report from Code
private void printReport()
{
SRSPrintDestinationSettings printSettings;
Report_contract contract = new Report_contract();
Report_controller controller = new Report_controller(
;
// set Report Name
controller.parmReportName(
// set contract
contract.
controller.parmReportContract(
// get Print settings from contract
printSettings = controller.parmReportContract(
// set print medium
printSettings.printMediumType(
// supress dialog
controller.parmShowDialog(
// run report
controller.startoperation();
}
And now only the Report is missing.