
Hey team,
I'm making a SSRS report on the estimates for a project for different customers. I have a requirement where on my dialog form of the report if the user selects ReportLevel = "Estimate" then display the report this way:
When ReportLevel = "Project"
When ResportLevel = "Customer"( the sum of all types of costs for all the projects for 1st customer should be shown)
In case of the customer view I'm having a problem. I have to display the total of fees,3rd party cost,Production Insurance, CSS cost for all the projects under that customer. I'm not getting it how can I do it. I'm getting it same way as the above two conditions. Please help me with this. My code:
[SRSReportParameterAttribute(classstr(ProjectEstimateContract))]
class ProjectEstimateDP extends SRSReportDataProviderBase
{
ProjectEstimatesTmp projectEstimatesTmp;
int counter1 = 0;
TransDate _tempdate,_tempdate1;
[SRSReportDataSetAttribute(tableStr(ProjectEstimatesTmp))]
public ProjectEstimatesTmp getProjectEstimatesTmp()
{
select * from projectEstimatesTmp;
return projectEstimatesTmp;
}
public void processReport()
{
ProjectEstimates projectestimates;
ProjectEstimateContract contract;
EstimateThirdPartyCostStages thirdPartyCostStages;
CustTable custable;
ProjectEstimatesTmpClass estimatetmpclass = new ProjectEstimatesTmpClass();
ProjId projId;
ProjTable projTable;
ReportLevel reportlevel;
TransDate fromdate,todate,startedate,startthirdpartydate;
FeeStages feestage;
real thirdpartycost,ecost,prodinsurance,csslevy;
contract = this.parmDataContract() as ProjectEstimateContract;
projId = contract.parmProjId();
fromdate = contract.parmProjFromDate();
todate = contract.parmProjToDate();
reportlevel = contract.parmReportLevel();
while select projectestimates
where projectestimates.ProjId == projId
{
startedate = EstimateStartDate::find(projectestimates.RecId,EstimateStages::Stage1,EstimateSection::EFee).StartDate;
startthirdpartydate = EstimateStartDate::find(projectestimates.RecId,EstimateStages::Stage1,EstimateSection::ThirdPartyCosts).StartDate;
if(counter1 == 0)
{
_tempdate = startedate;
_tempdate1 = startthirdpartydate;
counter1 ;
}
int pass = (mthOfYr(startedate) - mthOfYr(_tempdate));
int pass2 = (mthOfYr(startthirdpartydate) - mthOfYr(_tempdate1));
ecost = estimatetmpclass.getTotalEFees(projectestimates.RecId,startenginedate,fromdate,todate,pass);
thirdpartycost = estimatetmpclass.getthirdpartycost(projectestimates.RecId,startthirdpartydate,fromdate,todate,pass2);
prodinsurance = estimatetmpclass.getproductionInsurance(thirdpartycost,projectestimates.ProdInsurance);
csslevy = estimatetmpclass.getCSSLevy(enginecost,thirdpartycost,prodinsurance,projectestimates.CCSLevy);
if(reportlevel == ReportLevel::Customer)
{
projectEstimatesTmp.CustAccountNumber = contract.parmCustomerCode();
select firstonly projtable where projTable.ProjId == contract.parmProjId();
projectEstimatesTmp.CustName = projTable.custName();
projectEstimatesTmp.PotentialFee = ecost;
projectEstimatesTmp.thirdPartyCostTotal = thirdpartycost;
projectEstimatesTmp.IsProdInsurance = projectestimates.IsProdInsurance;
if( projectEstimatesTmp.IsProdInsurance)
{
projectEstimatesTmp.ProdInsurance = prodinsurance;
}
else
{
projectEstimatesTmp.ProdInsurance = 0;
}
projectEstimatesTmp.IsCCSLevy = projectestimates.IsCCSLevy;
if(projectEstimatesTmp.IsCCSLevy)
{
projectEstimatesTmp.CCSLevy = csslevy;
}
else
{
projectEstimatesTmp.CCSLevy = 0;
}
projectEstimatesTmp.InvestmentEstimate = projectestimates.InvestmentEstimate;
projectEstimatesTmp.Total = ecost thirdpartycost prodinsurance csslevy;
projectEstimatesTmp.insert();
}
else
if(reportlevel == TEGReportLevel::Project)
{
projectEstimatesTmp.ProjId = projectestimates.ProjId;
projectEstimatesTmp.PotentialFee = ecost;
projectEstimatesTmp.CustAccountNumber = contract.parmCustomerCode();
select firstonly projtable where projTable.ProjId == contract.parmProjId();
projectEstimatesTmp.CustName = projTable.custName();
projectEstimatesTmp.ProjName = projTable.Name;
projectEstimatesTmp.thirdPartyCostTotal = thirdpartycost;
projectEstimatesTmp.IsProdInsurance = projectestimates.IsProdInsurance;
if( projectEstimatesTmp.IsProdInsurance)
{
projectEstimatesTmp.ProdInsurance = prodinsurance;
}
else
{
projectEstimatesTmp.ProdInsurance = 0;
}
projectEstimatesTmp.IsCCSLevy = projectestimates.IsCCSLevy;
if(projectEstimatesTmp.IsCCSLevy)
{
projectEstimatesTmp.CCSLevy = csslevy;
}
else
{
projectEstimatesTmp.CCSLevy = 0;
}
projectEstimatesTmp.InvestmentEstimate = projectestimates.InvestmentEstimate;
projectEstimatesTmp.Total = e thirdpartycost prodinsurance csslevy;
projectEstimatesTmp.insert();
}
else
{
projectEstimatesTmp.ProjId = projectestimates.ProjId;
projectEstimatesTmp.EstimateCode = projectestimates.EstimateCode;
projectEstimatesTmp.EstimateName = projectestimates.Name;
projectEstimatesTmp.PotentialFee = ecost;
projectEstimatesTmp.CustAccountNumber = contract.parmCustomerCode();
select firstonly projtable where projTable.ProjId == contract.parmProjId();
projectEstimatesTmp.CustName = projTable.custName();
projectEstimatesTmp.ProjName = projTable.Name;
projectEstimatesTmp.thirdPartyCostTotal = thirdpartycost;
projectEstimatesTmp.IsProdInsurance = projectestimates.IsProdInsurance;
if( projectEstimatesTmp.IsProdInsurance)
{
projectEstimatesTmp.ProdInsurance = prodinsurance;
}
else
{
projectEstimatesTmp.ProdInsurance = 0;
}
projectEstimatesTmp.IsCCSLevy = projectestimates.IsCCSLevy;
if(projectEstimatesTmp.IsCCSLevy)
{
projectEstimatesTmp.CCSLevy = csslevy;
}
else
{
projectEstimatesTmp.CCSLevy = 0;
}
projectEstimatesTmp.InvestmentEstimate = projectestimates.InvestmentEstimate;
projectEstimatesTmp.Total = ecost thirdpartycost prodinsurance csslevy;
projectEstimatesTmp.insert();
}
}
}
}
HI skd
Have you solved your problem?
IF not Whether to get the error message?
regards