How to Display SSRS Report into Enterprise Portal in Ax 2012

SSRS_OnEP

Step1:

After Creating the SSRS in AX,we need to add that into output menuItem with proper label.
Here label is very important because it will connect between Ep and AX.

Step 2:

\Go to your EP page selct the place where you need to display the Report. And add a  new webPart

Step 3:

  1. To add a web part to a page, use the procedure that is described in How to: Add Web Parts.
  2. When you specify the properties of the Report web part, the Report selection property lists the names of the SSRS reports that have had menu items created for them and can be used in Enterprise Portal. See Accessible Reports for Enterprise Portal for more information about which reports you can use. Choose the report that you want to display.
  3. If the SSRS report uses parameters, you can use the Report parameters to set them.
  4. Specify the Toolbar size property to indicate whether a toolbar should be displayed for the web part.
  5. Specify the Report drillthrough target toolbar size property to specify the size of the toolbar that is displayed when report drill-through is used.
  6. Set the Title property to a name appropriate for the report. This title will be displayed in the Report web part.
  7. Set the Width and Height properties so the SSRS report will display optimally.
  8. Save the changes for the web part and page.
  9. Display the page that contains the report.

Thats it!!!!!!!!!!!!

Advertisements

SSRS Report using DP,Contract,Controller Classes with Parameter table in Ax 2012

SSRS

Here i combined two tables, from second table i am getting the Address

CODE:

DP Class

[ SRSReportQueryAttribute (querystr(Bill_TabMethod_SSRS)),
SRSReportParameterAttribute(classstr(Bill_TabMethodContract))
]
class Bill_TabMethodDP extends SrsReportDataProviderPreProcess
{
Bill_TabMethodTmp bill_TabMethodTmp;

}

[SRSReportDataSetAttribute(“Bill_TabMethodTmp”)]
public bill_TabMethodTmp getBill_TabMethodTmp()
{
select * from bill_TabMethodTmp;
return bill_TabMethodTmp;
}

[SysEntryPointAttribute(true)]
public void processReport()
{
BIll_Child billChild;
BillChildParm billchildparm;
Bill_TabMethod btm;

QueryRun queryRun;
Query query;
Bill_TabMethod billbuffer;
Bill_TabMethodContract srsBill_TabMethodContract;
CustName custName;
ItemName itemName;
QueryBuildDataSource queryBuildDataSource;
QueryBuildRange queryBuildRange;

query = this.parmQuery();

srsBill_TabMethodContract = this.parmDataContract() as Bill_TabMethodContract;
custName = srsBill_TabMethodContract.parmCustName();
itemName = srsBill_TabMethodContract.parmitemName();

// Add parameters to the query.
queryBuildDataSource = query.dataSourceTable(tablenum(Bill_TabMethod));

/*
if(custName)
{
queryBuildRange = queryBuildDataSource.findRange(fieldnum(Bill_TabMethod, CustName));
if (!queryBuildRange)
{
queryBuildRange = queryBuildDataSource.addRange(fieldnum(Bill_TabMethod, CustName));
}
// If an account number has not been set, then use the parameter value to set it.
if(!queryBuildRange.value())
queryBuildRange.value(custName);
}
*/

queryBuildRange = queryBuildDataSource.addRange(fieldnum(Bill_TabMethod, CustName));
// queryBuildRange = queryBuildDataSource.addRange(fieldnum(Bill_TabMethod, ItemName));
queryBuildRange.value(custName);
//queryBuildRange.value(itemName);

queryRun = new QueryRun(query);

while(queryRun.next())
{
billbuffer = queryRun.get(tableNum(Bill_TabMethod));

bill_TabMethodTmp.CustName=billbuffer.CustName;
bill_TabMethodTmp.ItemName=billbuffer.ItemName;
bill_TabMethodTmp.Price=billbuffer.Price;
bill_TabMethodTmp.Quatity=billbuffer.Quatity;
bill_TabMethodTmp.Discount=billbuffer.Discount;
bill_TabMethodTmp.Vat=billbuffer.Vat;
bill_TabMethodTmp.TotalAmt=billbuffer.TotalAmt;
bill_TabMethodTmp.NetAmt=billbuffer.NetAmt;

select billchildparm;
if(billchildparm.Number==1)
{
select billChild where billChild.CustName==billbuffer.CustName;
bill_TabMethodTmp.Address=billChild.Address;
}
else
{
while select billChild where billChild.CustName==billbuffer.CustName
bill_TabMethodTmp.Address+=billChild.Address;
}

bill_TabMethodTmp.insert();

}
/*
//Directly inserting from the Base Table

srsBill_TabMethodContract = this.parmDataContract() as Bill_TabMethodContract;
custName = srsBill_TabMethodContract.parmCustName();
//itemName = srsBill_TabMethodContract.parmitemName();
select btm where btm.CustName==custName;

bill_TabMethodTmp.CustName=btm.CustName;
bill_TabMethodTmp.ItemName=btm.ItemName;
bill_TabMethodTmp.Price=btm.Price;
bill_TabMethodTmp.Quatity=btm.Quatity;
bill_TabMethodTmp.Discount=btm.Discount;
bill_TabMethodTmp.Vat=btm.Vat;
bill_TabMethodTmp.TotalAmt=btm.TotalAmt;
bill_TabMethodTmp.NetAmt=btm.NetAmt;
bill_TabMethodTmp.insert();
bill_TabMethodTmp.clear();

*/

Contract Class

class Bill_TabMethodContract
{
CustName custName;
ItemName itemName;
Description address;
}
}

[DataMemberAttribute(“CustName”)]
public CustName parmCustName(CustName _custName = custName)
{
custName = _custName;
return custName;
}

Controller Class

class Bill_TabMethodController extends SrsReportRunController
{
Bill_TabMethodContract contract;
Bill_TabMethod billTable;
}

protected void preRunModifyContract()
{
contract = this.parmReportContract().parmRdpContract() as Bill_TabMethodContract;
if(this.parmArgs().dataset() == tableNum(Bill_TabMethod))
{
billTable = this.parmArgs().record();
contract.parmCustName(billTable.CustName);
}

}

public static void main(Args args)
{
Bill_TabMethodController srs;
srs = new Bill_TabMethodController ();
srs.parmReportName(ssrsReportStr(JKTestReport,PrecisionDesign1));
srs.parmArgs(args);

srs.parmShowDialog(true);
srs.startOperation();
}