TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Jaffer Sadiq
NA
155
69.1k
How to generate the output as pdf/Excel n MVC with angularJs
Dec 24 2018 6:26 AM
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;
// I need this value should be generate as PDF and excel and outpurformat display as Array(list)
}
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.
Reply
Answers (
4
)
Excel Open error: “found unreadable content in APPL_1.xlsx”
Why go used for private constructor?