web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Fixed Asset SSRS Report

(0) ShareShare
ReportReport
Posted on by 2,430

Hello,

I design a Fixed Asset Report using Report Data Provider.

Below are the business Logic and i think something is missing in logic because report have empty columns.

Please give me idea if any one design Fixed Asset report.

3173.4.jpg

5148.4.jpg 

private void insertintoSfa()
{

AssetTrans assetTrans;
AssetTable assetTable;

;


assetTable = AssetTable::find(assetBook.AssetId);

select firstOnly assetBook where assetBook.AssetId==assetTable.AssetId;
select firstOnly assetTrans where assetTrans.AssetId==assetTable.AssetId;
{
sfa_Tmp.AcqDate=assetBook.AcquisitionDate;
sfa_Tmp.AssetGroup=assetBook.AssetGroup;
sfa_Tmp.AcqPrice=assetBook.AcquisitionPrice;
sfa_Tmp.AssetId=assetBook.AssetId;
sfa_Tmp.ServiceLife=assetBook.ServiceLife;
sfa_Tmp.AssetDepStartDate=assetBook.DepreciationStartDate;
sfa_Tmp.AssetStatus=assetBook.Status;
sfa_Tmp.TransTxt=assetTrans.Txt;
sfa_Tmp.AssetTransDate=assetTrans.TransDate;
sfa_Tmp.AssetDisposalDate=assetBook.DisposalDate;

sfa_Tmp.insert();
}

}

[SysEntryPointAttribute(false)]
public void processReport()
{
FromDate fromDate;
ToDate toDate;
AssetGroupId assetGroupId;
AssetId assetId;

Query query;
QueryRun queryRun;
QueryBuildDataSource qrds,qrds1;
QueryBuildRange qbr;

AssetBook queryAssetBook;
SFA_Asset_Contract dataContract;

dataContract = this.parmDataContract();
fromDate = dataContract.parmFromDate();
toDate = dataContract.parmToDate();
assetGroupId = dataContract.parmAssetGroupId();
assetId = dataContract.parmAssetId();

query = new Query();

qrds = query.addDataSource(tableNum(AssetTrans));

if(fromDate && !toDate)
{
qbr = qrds.findRange(fieldnum(AssetTrans, TransDate));
if (!qbr)
{
qbr = qrds.addRange(fieldnum(AssetTrans, TransDate));
}
if(!qbr.value()) qbr.value(queryRange(fromDate, dateMax()));
}

if(!fromDate && toDate)
{
qbr = qrds.findRange(fieldnum(AssetTrans, TransDate));
if (!qbr)
{
qbr = qrds.addRange(fieldnum(AssetTrans, TransDate));
}
if(!qbr.value()) qbr.value(queryRange(dateNull(), toDate));

}

if(fromDate && toDate)
{
qbr = qrds.findRange(fieldnum(AssetTrans, TransDate));
if (!qbr)
{
qbr = qrds.addRange(fieldnum(AssetTrans, TransDate));
}
if(!qbr.value()) qbr.value(queryRange(fromDate, toDate));
}

qrds1 = query.addDataSource(tableNum(AssetBook));

if(assetId)
{
qbr = qrds1.findRange(fieldnum(AssetBook, AssetId));
if (!qbr)
{
qbr = qrds1.addRange(fieldnum(AssetBook, AssetId));
}
if(!qbr.value()) qbr.value(assetId);
}
if(assetGroupId)
{
qbr = qrds1.findRange(fieldnum(AssetBook,AssetGroup));
if (!qbr)
{
qbr = qrds1.addRange(fieldnum(AssetBook,AssetGroup));
}
if(!qbr.value()) qbr.value(assetGroupId);
}


// Run the query with modified ranges.
queryRun = new QueryRun(query);
ttsbegin;
while(queryRun.next())
{
assetBook = queryRun.get(tableNum(AssetBook));
this.insertintoSfa();
}
ttscommit;


}

*This post is locked for comments

I have the same question (0)
  • faiz7049 Profile Picture
    2,430 on at

    In query i am using AssetBook Table.

  • Chaitanya Golla Profile Picture
    17,225 on at

    Hi,

    You haven't joined the AssetTrans table to AssetBook table. Please use the following code

    in the method processReport after line query = new Query();

    QueryBuildDataSource qrds,qrds1, qbdsAsset; // Declare qbdsAsset

       query = new Query();

       qbdsAsset = query.addDataSource(tableNum(AssetBook)); // Add these lines

       qrds = qbdsAsset.addDataSource(tableNum(AssetTrans));

       qrds.relations(true);

    Thanks,

    Chaitanya Golla

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
CP04-islander Profile Picture

CP04-islander 16

#2
GiacomoRovai Profile Picture

GiacomoRovai 4

#3
Douglas Noel Profile Picture

Douglas Noel 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans