Skip to main content

SSRS Syntax for RDP and Contract Class

  1- -------------------------  Create a contract class   Report_NameContractClass------------------------------

[DataContractAttribute]

 class *Report_Name*ContractClass

{  

 //Defining variables for report parameter.

 *EDT of parameter field*  *Field_reference*;  

  

//Defines parameter properties.

[

DataMemberAttribute('*Parameter_Field_name*')

SysOperationLabelAttribute(literalStr("@SYS190134")),

SysOperationLabelAttribute (“label”),

SysOperationHelpTextAttribute(“help text”),

SysOperationDisplayOrderAttribute(“1”)


]    

//Returns parameter value if found.


public *EDT of parameter field*   Parm*Parameter_Field_name*(*EDT of parameter field*             _*Field_reference*=*Field_reference*)  


 {         

*Field_reference* = _*Field_reference*;  

 return *Field_reference*;  

 } 

 }




2- ----------------------- Create a RDP Class     Perm_TableReportDP ------------------------------------


[SrsReportParameterAttribute(classstr(*ContractClassName*))]  


class *Table_Name*RDP extends SRSReportDataProviderBase


{   

  *Temp_Table_Name*   *Temp_TableBuffer*;          //TEMP TABLE 


  *Table_Name*       *TableBuffer* ;         //PERMENANT TABLE    


  *EDT of parameter field*    *Field_reference*;        //PARAMETER FIELD FROM DATA CONTRACT CLASSS    


  *ContractClassName* Contract; //CONTRACT CLASS FOLLOWED BY CONTRACT    


  [SrsReportDataSetAttribute('  *Temp_Table_Name*  ')] 

   public *Temp_Table_Name* GetData()  


  {        select *Temp_TableBuffer*;   


     return *Temp_TableBuffer*;   


 }     



 public void processReport()   

 {        

     Contract = this.parmDataContract();           

    *Field_reference* = Contract.*Validation_Method_Name*();         


 super();             


while select * from TableBuffer


            where *TableBuffer*.*Parameter_Field_name* == *Field_reference*          


        {            


                    *Temp_TableBuffer*.*Field1*  =  *TableBuffer*.*Field1*;      


                     *Temp_TableBuffer*.*Field2*  =  *TableBuffer*.*Field2*;            


                   *Temp_TableBuffer*.*Field3* =  *TableBuffer*.*Field3*;         


                     *Temp_TableBuffer*.insert();       

 }   

 } 

}


Comments

Popular posts from this blog

Total Amount of Purchase Order in X++

Method 1:  public AmountCur totalAmount()        // PurchLine       purchLine;         AmountCur       amountCur = 0;         while select crosscompany purchLine             index hint PurchLineIdx             where purchLine.PurchId         == purchtables.PurchId               && !purchLine.IsDeleted         {            // amountCur += purchLine.calcLineAmountExclTax(purchLine.PurchQty );                             amountCur += purchLine.calcLineAmount(purchLine.PurchQty + purchLine.ConfirmedTaxAmount );                          }         return amo...

Change Company

change company helps to chnage the value of our field on the mark of the entity value  suppose you are overding a value in 3005 when you change to 1005 and click button the value changes in 1005 too   class LegalEntityRestriction_FYCDeleteExistingEntries     {         /// <summary>         ///         /// </summary>         /// <returns></returns>         public boolean modified()         {             boolean ret;                      //ret = super();             LedgerParameters ledgerparameter;                  ret = super();             if(LegalEntityRestriction_FYCDeleteExistingEntries.valueStr( ) == enum2Str(NoYes::Yes))   ...

Split Method in X++

Split method is used to split value of a Name or Number using a decimal or comma so that we can separate them and use in fields in report or in form   public static void main (Args args)     {         str _Value,beforeDec,afterDec;         int x;         str str1='Jake,Grey';         Names names;          List strlist=new List(Types::String);         ListIterator iterator;           strlist=strSplit(str1,',');         iterator = new ListIterator(strlist);         while(iterator.more())         {             x= x+1;             if(x==1)             {                 beforeDec =iterator.value();           ...