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
Guest User
Tech Writer
2.1k
472.7k
CrystalReport is blank with no data?
Aug 5 2020 4:29 AM
Hi Team
I have created a crystal report, but the issue its empty there is no data. While i check from the column with the database there is a record. Please help mates, what could be the reason for this irregularity?
public
ActionResult Download_ExcelReport()
{
//var _db = new eNtsaRegistration();
var data = (from q
in
db.eNtsaRegForms select
new
{
Id = q.Id,
FirstName = q.FirstName!=
null
?q.FirstName:
""
}).ToList();
ReportDocument rpt =
new
ReportDocument();
rpt.Load(Server.MapPath(
"~/Reports/uYiloReporting.rpt"
));
rpt.SetDataSource(data);
Response.Buffer =
false
;
Response.ClearContent();
Response.ClearHeaders();
try
{
Stream stream = rpt.ExportToStream(CrystalDecisions.Shared.ExportFormatType.Excel);
stream.Seek(0, SeekOrigin.Begin);
return
File(stream,
"application/vnd.ms-excel"
,
"eNtsaRegistrationForm.xls"
);
}
catch
{
throw
;
return
View();
}
}
Reply
Answers (
4
)
Unabel to add mvc view in am asp.net core 3.1 web application
Azure Function and Database First Connection String