09-16-2014 04:20 PM
I want to run a report on a button on saleslogix web dynamically assign value through code coz I want to use the product Id to filter the record. for example in a product detail when I click the report button it will run the report and use the product Id which is the current product display on the product detail page/form.
I found this post and seems not working because of some files that are not supported at version 8.1 which is what Im using at the moment.
Any Idea and suggestion are highly appreciated. Thank you.
09-16-2014 11:38 PM
Hi Romnick,
The following is an example of dynamically creating a detail report in 8.1 that is exported as an Excel spreadsheet:
CreateExcelReport: function (reportId) { require([ 'Sage/MainView/ReportMgr/ReportWizardController', 'Sage/MainView/ReportMgr/Crystal/CrystalReportsUtility', 'Sage/Reporting/Enumerations' ], function(ReportWizardController, CrystalReportsUtility, CrystalEnumerations) { var condition = CrystalReportsUtility.getCurrentEntityCondition(); var options = { reportId: reportId, reportOptions: { wizardOptions: { hiddenSteps: [CrystalEnumerations.CrystalReportWizardStep.Conditions, CrystalEnumerations.CrystalReportWizardStep.ExportOptions] }, scheduleOptions: { executionType: CrystalEnumerations.ExecutionType.OnDemand }, exportOptions: { outputFormat: CrystalEnumerations.ReportExportFormat.Excel }, conditionOptions: { conditions: [condition], conditionsConnector: CrystalEnumerations.ReportConditionConnector.And } } }; ReportWizardController.startWizard(options); }); },
Currently the API is not documented; however, the source code includes documentation in many places. Please take a look at the scripts under jscript\Sage\MainView\ReportMgr and jscript\Sage\Reporting.
Thanks
Mike