Hi,
I need to generate the output value as PDF or excel as per the end user choice.
Which is the best choice to handle. whether in Angular or MVC.
AngularJS:
- $scope.ReportGenerate = function () {
- TransactionReportData();
- }
- function TransactionReportData() {
- var ReportData = {
- Customername: $scope.SelectedCustomer.Identifier,
- Transactionid: $scope.Transactionid,
- StartDate: $('#StartDate').val() + " 00:00:00",
- EndDate: $('#EndDate').val() + " 23:59:59",
- OrderID: OdrID
- };
- var result = TransactionSearchService.GenerateReport(ReportData);
- result.then(function (response) {
- $scope.RPTData = response.data;
- if ($scope.RPTData.ErrorInfo == null) {
- $scope.ReportGenerateFormat = $scope.RPTData.ReportTransactions;
- }
- else {
- $scope.ErrorMessage += $scope.RPTData.ErrorInfo.Code;
- $scope.ErrorMessage += " : ";
- $scope.ErrorMessage += $scope.RPTData.ErrorInfo.Description;
- }
- });
- };
Controller :
- public ActionResult GenerateReport(string data)
- {
- DataContractJsonSerializer jsonObjectPersonInfo = new DataContractJsonSerializer(typeof(Transsearchdata));
- MemoryStream stream = new MemoryStream(Encoding.UTF8.GetBytes(data));
- Transsearchdata Search = (Transsearchdata)jsonObjectPersonInfo.ReadObject(stream);
- Transactionsearch TransSearchData = new Transactionsearch();
- TransactionReportResponse response = TransSearchData.ReportData(Search, "en");
- return Json(response, JsonRequestBehavior.AllowGet);
- }
How to do achieve this in MVC with angularjs.
It would be great if someone support.