I' ve created a set of report classes. Currently I m only able to print on a selected sales account and it details. what I wanted is to print a selected range of sales account. from example the sales accountfrom is 520 and sales accountto is 900. Then the report will print the selected salesaccount into the report. Where can I add the range for my code?
// Data provider [ //SRSReporueryAttribute(queryStr()), SRSReportParameterAttribute(classStr(TestingSalesContract)) ] class TestingSalesDataProvider extends SRSReportDataProviderBase { Testing_SalesLine salesLine; Testing_SalesHeader1 salesHeader; Testing_SalesLineTmp salesLineTmp; TestingSalesContract contract; RecordInsertList recordInsertListTmpTable; } [SRSReportDataSetAttribute(tablestr('Testing_salesLineTmp'))] public Testing_salesLineTmp getSalesLine() { ; return salesLineTmp; } [SysEntryPointAttribute] public void processReport() { Testing_SalesAccount salesAccountFrom; Testing_SalesAccount salesAccountTo; ; contract = this.parmDataContract() as TestingSalesContract; salesAccountFrom = contract.parmSalesAccountFrom(); salesAccountTo = contract.parmSalesAccountTo(); while select * from salesLine //select all dat from sales line where salesLine.SalesAccount == salesAccountFrom // if input sales acccount was equal then showdata {// print to tmp table salesLineTmp.clear(); salesLineTmp.SalesAccount = salesLine.SalesAccount; salesLineTmp.CustomerID = salesLine.CustomerID; salesLineTmp.CustomerName = salesLine.CustomerName; salesLineTmp.ItemID = salesLine.ItemID; salesLineTmp.ItemName = salesLine.ItemName; salesLineTmp.ItemPrice = salesLine.ItemPrice; salesLineTmp.ItemQuantity = salesLine.ItemQuantity; salesLineTmp.ItemTotal = salesLine.ItemTotal; salesLineTmp.insert(); } }
//UI builder class TestingSalesUIBUilder extends SysOperationAutomaticUIBuilder { TestingSalesContract contract; DialogField dialogSalesAccountFrom; DialogField dialogSalesAccountTo; } public void build() { contract = this.dataContractObject(); dialogSalesAccountFrom = this.addDialogField(methodStr(TestingSalesContract,parmSalesAccountFrom),contract); dialogSalesAccountTo = this.addDialogField(methodStr(TestingSalesContract,parmSalesAccountTo),contract); }
//contract [DataContractAttribute, SysOperationContractProcessingAttribute(classstr(TestingSalesUIBUilder)) ] class TestingSalesContract { Testing_SalesAccount salesAccountFrom; Testing_SalesAccount salesAccountTo; } [DataMemberAttribute('salesAccountFrom') ] public Testing_SalesAccount parmSalesAccountFrom(str _salesAccountFrom = salesAccountFrom) { salesAccountFrom = _salesAccountFrom; return salesAccountFrom; } [DataMemberAttribute('salesAccountTo') ] public Testing_SalesAccount parmSalesAccountTo(str _salesAccountTo = salesAccountTo) { salesAccountTo = _salesAccountTo; return salesAccountTo; }
// controller class TestingSalesController extends SrsReportRunController { } public static void main(Args _args) { TestingSalesController controller; ; controller = new TestingSalesController(); controller.parmArgs(_args); controller.parmReportName(ssrsReportStr(TestingSales, PrecisionDesign1 )); controller.parmDialogCaption('SalesLine'); controller.startOperation(); }
*This post is locked for comments
never mind I found the problem it was the dataset from visual studio. Thank for helping me Istvan.
Yeah I got what I wan with this query. but I could get the salesAccountTo.
I tried change the "<=" only sales accountfrom work. salesAcoountTo print nthing
This line should be modified:
where salesLine.SalesAccount == salesAccountFrom // if input sales acccount was equal then showdata
in public void processReport()
Where do i add the query? Do you have any example of it?
Hi,
You should modify the processReport() main query to something like this:
salesLine.SalesAccount >= salesAccountFrom && salesLine.SalesAccount <= salesAccountTo
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,253 Super User 2024 Season 2
Martin Dráb 230,188 Most Valuable Professional
nmaenpaa 101,156