Notifications
Announcements
No record found.
Hi guys,
I have to create a report for all invoiced sales order items where I'll group it against the item id. In the parameter two months will be given(eg: jan 2012 to august 2012) and the max period range is 12 months. And quantity should be shown in period range( according to month wise categories it in the column)
For example : jan month quantities in quantity period 1 and feb month quantity in quantity period 2 and so on.... The date used to filter is invoice date.
please give us example for that in the Contract class how to do in x++.
Thanks.
HI Riyas,
Add parameters then validate your range.
Please check this if it's helpful: docs.microsoft.com/.../how-to-add-validation-to-a-data-contract-class
Thanks for your replay blue wang,
i already got it same thread so give us example : jan 2012 to august 2012.
Hi Riyas,
You can create new Date type EDT and change Date day property to No. In the contract, you need to create 2 fields (fromDate and toDate) and use new EDT as type of them. In this case, you will see in the dialog value in MMYYYY format.
In the report processing method you can apply date range by InvoiceDate. For example if you have query object you can use queryRange(dateStartMth(fromDate), dateEndMth(toDate)).
PS. You need to use dateStartMth and dateEndMth as selected by user values in the dialog will still keep the day.
About your quantity period 1 ,quantity period 2 , Do you mean period parameter?
www.sqlservercentral.com/.../a-single-parameter-date-range-in-sql-server-reporting-services
Thanks for your replay Sergei Minozhenko,
how to use dateStartMth and dateEndMth dialog so that need to UI builder class Right if yes give me a example.
The only place you need to use dateStartMth and dateEndMth in the dialog is the validation part and process report method on DP class.
MyTransDate is new date type EDT with 'Date Day' property = None
[ DataContractAttribute, ] public class MyContract implements SysOperationValidatable { MyTransDate fromDate; MyTransDate toDate; [ DataMemberAttribute('FromDate'), SysOperationGroupMemberAttribute('Period'), SysOperationDisplayOrderAttribute('1') ] public MyTransDate parmFromDate(MyTransDate _fromDate = fromDate) { fromDate = _fromDate; return fromDate; } [ DataMemberAttribute('ToDate'), SysOperationGroupMemberAttribute('Period'), SysOperationDisplayOrderAttribute('2') ] public MyTransDate parmToDate(MyTransDate _toDate = toDate) { toDate = _toDate; return toDate; } public boolean validate() { boolean ret = true; if (!fromDate || !toDate) { //Both dates must be filled in. ret = checkFailed("@SYS71110"); } if (ret) { if (dateStartMth(fromDate) > dateEndMth(toDate_) { //From date cannot be greater than To date. ret = checkFailed("@SYS120590"); } } return ret; } }
Thanks for your quickly response Sergei.
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.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Martin Dráb 664 Most Valuable Professional
André Arnaud de Cal... 522 Super User 2025 Season 2
Sohaib Cheema 303 User Group Leader