When defining a dataset for a report in Business Central, you can use the following types of columns:
Field in a table
Add a field directly from the data item’s table.
dataitem(Customer; Customer)
{
column(CustomerName; Name) { }
column(City; City) { }
}
Here, Name and City are fields in the Customer table.
A variable
Use a variable declared in report.
dataitem(Customer; Customer)
{
column(Greeting; GreetingText) { }
}
var
GreetingText: Text[50];
procedure OnPreDataItem()
begin
GreetingText := 'Hello, Customer!';
end;
Here, GreetingText is a custom variable added as a column.
An expression
– Use a calculated value or function result.
dataitem(SalesLine; "Sales Line")
{
column(TotalAmount; "Quantity" * "Unit Price") { }
}
Here, the column calculates Quantity * Unit Price for each sales line.
A caption
– Labels or static text not tied to a specific table
dataitem(Customer; Customer)
{
column(ReportTitle; 'Customer Sales Report') { }
}
Here, ReportTitle is a caption displayed in the dataset.
GitHub link: https://github.com/businesscentraljunction/BC-Main/tree/main/Types%20of%20Columns%20in%20a%20Report%20Dataset/src
Thanks For Reading...!!
Regards,
Khushbu Rajvi

Like
Report
*This post is locked for comments