Code error - SSRS Report

Dear All,

I have written this code:

[SysEntryPointAttribute(false)]

public void processReport()

{

GOD_MembershipRegisterContract membershipRegisterContract = this.parmDataContract() as GOD_MembershipRegisterContract;

TransDate fromDate = membershipRegisterContract.parmFromDate();

TransDate toDate = membershipRegisterContract.parmToDate();

GOD_MembershipNum membershipNum1 = membershipRegisterContract.parmMemNum();// KK added - 1/12/2015 - membership num filter

int counter = 1,ctr;

GOD_membershipPostingProfile membershipPostingProfile;

GOD_GrossSalesTurnover grossSalesTurnover ;

TaxTrans taxTrans;

;

ctr = 0;

// delete_from membershipregistrationGroup;

if(fromDate && toDate && membershipNum1 ) // KK added - 1/12/2015 - membership num filter

{

while select custInvoiceTable

where //custInvoiceTable.GOD_MembershipNum ==‘N0015P’// membershipOuterLoop.MembershipNum

custInvoiceTable.InvoiceDate >= fromDate

&& custInvoiceTable.InvoiceDate <= toDate

&& custInvoiceTable.GOD_MembershipNum == membershipNum1 // KK added - 1/12/2015 - membership num filter

&& custInvoiceTable.InvoiceId != ‘’

{

while select custInvoiceLine where custInvoiceLine.ParentRecId == custInvoiceTable.RecId

{

membershipregistrationGroup.billno = custinvoicetable.invoiceid;

membershipregistrationGroup.billdate = custinvoicetable.invoicedate;

if (this.getdimensioncombinationvalues(custinvoiceline) == ‘3011001035’)

membershipregistrationGroup.entrancefees = custinvoiceline.amountcur;

else

membershipregistrationGroup.entrancefees = 0;

select membershippostingprofile where membershippostingprofile.membershiptype == ‘primary membership’;

if (this.getdimensioncombinationvalues(custinvoiceline) == membershippostingprofile.mainaccountid)

membershipregistrationGroup.primarymembershipamount = custinvoiceline.amountcur;

else

membershipregistrationGroup.primarymembershipamount = 0;

// KK Commented - 1/9/2015

//select membershippostingprofile where membershippostingprofile.membershiptype == ‘multiple membership’;

//if (this.getdimensioncombinationvalues(custinvoiceline) == membershippostingprofile.mainaccountid)

if(custinvoiceline.GOD_MembershipType ==‘Multiple Membership’)// KK Modified -1/9/2015

membershipregistrationGroup.MultipleNR = custinvoiceline.amountcur;

else

membershipregistrationGroup.MultipleNR = 0;

select membershippostingprofile where membershippostingprofile.membershiptype == ‘add-on membership’;

if (this.getdimensioncombinationvalues(custinvoiceline) == membershippostingprofile.mainaccountid)

membershipregistrationGroup.addon = custinvoiceline.amountcur;

else

membershipregistrationGroup.addon = 0;

select membershippostingprofile where membershippostingprofile.membershiptype == ‘international membership’;

if (this.getdimensioncombinationvalues(custinvoiceline) == membershippostingprofile.mainaccountid)

membershipregistrationGroup.irservices = custinvoiceline.amountcur;

else

membershipregistrationGroup.irservices = 0;

select membershippostingprofile where membershippostingprofile.membershiptype == ‘associate membership’;

if (this.getdimensioncombinationvalues(custinvoiceline) == membershippostingprofile.mainaccountid)

membershipregistrationGroup.associates = custinvoiceline.amountcur;

else

membershipregistrationGroup.associates = 0;

select membershippostingprofile where membershippostingprofile.membershiptype == ‘national affiliated membership’;

if (this.getdimensioncombinationvalues(custinvoiceline) == membershippostingprofile.mainaccountid)

membershipregistrationGroup.affiliatedassociation = custinvoiceline.amountcur;

else

membershipregistrationGroup.affiliatedassociation = 0;

// KK Modified Starts - 1/5/2015 - For Regional Affiliated Membership and Regional Institutional Membership

select membershippostingprofile where membershippostingprofile.membershiptype == ‘Regional Affiliated Membership’;

if (this.getdimensioncombinationvalues(custinvoiceline) == membershippostingprofile.mainaccountid)

membershipregistrationGroup.affiliatedassociation = custinvoiceline.amountcur;

else

membershipregistrationGroup.affiliatedassociation = 0;

select membershippostingprofile where membershippostingprofile.membershiptype == ‘Regional Institutional Membership’;

if (this.getdimensioncombinationvalues(custinvoiceline) == membershippostingprofile.mainaccountid)

membershipregistrationGroup.Institutional = custinvoiceline.amountcur;

else

membershipregistrationGroup.Institutional = 0;

// KK Modified Ends - 1/5/2015

select sum(taxamountcur) from taxtrans where taxtrans.Voucher == custinvoicejour::findfromsourcedocumentheader(custinvoicetable.sourcedocumentheader).LedgerVoucher;

membershipregistrationGroup.servicetax = abs(taxtrans.taxamountcur);

membershipregistrationGroup.billamount = membershipregistrationGroup.servicetax+membershipregistrationGroup.entrancefees + membershipregistrationGroup.primarymembershipamount + membershipregistrationGroup.MultipleNR + membershipregistrationGroup.addon + membershipregistrationGroup.irservices + membershipregistrationGroup.associates + membershipregistrationGroup.affiliatedassociation + membershipregistrationGroup.Institutional;// KK Modified -1/8/2015 - Institutional Addition.

membershipregistrationGroup.membershipno = god_membership::find(custinvoicetable.god_membershipnum).membershipnum;

membershipregistrationGroup.membercompanyname = god_membership::find(custinvoicetable.god_membershipnum).membername;

membershipregistrationGroup.state = god_membership::find(custinvoicetable.god_membershipnum).state;

membershipregistrationGroup.membershiptype = god_membership::find(custinvoicetable.god_membershipnum).membershiptype;

membershipregistrationGroup.scale = god_membership::find(custinvoicetable.god_membershipnum).scale;

membershipregistrationGroup.MembershipStatus = god_membership::find(custinvoicetable.god_membershipnum).membershipstatus;

membershipregistrationGroup.contactname = ‘’;

membershipregistrationGroup.address = god_membership::find(custinvoicetable.god_membershipnum).address;

membershipregistrationGroup.admissiondate = god_membership::find(custinvoicetable.god_membershipnum).dateofjoining;

membershipregistrationGroup.resignationdate = god_membership::find(custinvoicetable.god_membershipnum).dateofleaving;

select grosssalesturnover order by fromyear desc

where grosssalesturnover.toyear <= year(todate)-1

&& grosssalesturnover.GST != 0

&& grosssalesturnover.MembershipNumber == membershipregistrationGroup.membershipno ;

membershipregistrationGroup.gstamount = grosssalesturnover.gst;

membershipregistrationGroup.gstyear = grosssalesturnover.fromyear;

if (membershipregistrationGroup.membershipno )

{

membershipregistrationGroup.SrNo = counter;

membershipregistrationGroup.insert();

ctr++;

breakpoint;

}

}

}

}

while select AddOn,Address,AdmissionDate,AffiliatedAssociation,Associates,Institutional,sum(BillAmount),BillDate,sum(TotalInvoiceAmount),srno,

BillNo,ContactName,sum(EntranceFees),sum(GSTAmount),GSTYear,sum(IRServices),MemberCompanyName,MembershipNo,MembershipStatus,

MemberShipType,sum(MultipleNR),sum(PrimaryMembershipAmount),ResignationDate,Scale,SrNo,State,servicetax

from membershipregistrationGroup order by MemberCompanyName

group by servicetax,AddOn,Address,AdmissionDate,AffiliatedAssociation,Associates,Institutional,BillDate,GSTYear,

BillNo,ContactName,MemberCompanyName,MembershipNo,MembershipStatus,MemberShipType,ResignationDate,Scale,State

{

membershipregistration.data(membershipregistrationGroup);

membershipregistration.BillAmount =membershipregistration.ServiceTax+ membershipregistrationGroup.entrancefees + membershipregistrationGroup.primarymembershipamount + membershipregistrationGroup.MultipleNR + membershipregistrationGroup.addon + membershipregistrationGroup.irservices + membershipregistrationGroup.associates + membershipregistrationGroup.affiliatedassociation + membershipregistrationGroup.Institutional;// KK Modified -1/8/2015 - Institutional Addition.

membershipregistration.SrNo = counter;

membershipregistration.insert();

counter ++;

}

}

In my second buffer the value is becoming zero (in outer loop) and hence report is generating blank.

Can u plz suggest if i m doing anything wrng.

Regards,

Kalpna K