Click here to Skip to main content
15,888,521 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
When I am trying to export excel in MVC only value data is export ,null value data not export .

What I have tried:

I am trying to show all the data in export to Excel in MVC 5. I want to display the fields of null value also .
Posted
Updated 8-Aug-20 10:41am
Comments
Richard Deeming 7-Aug-20 6:00am    
There's a secret problem somewhere in your secret code. You should fix that.

Seriously, if you want anyone to stand a chance of helping you, you need to improve your question[^] to show us the relevant parts of your code, and a sample of the data you're trying to export.
Patrice T 8-Aug-20 17:49pm    
lol, if you tell him the secret problem, you will have to kill him.
Archana K 11-Aug-20 1:53am    
Yes I know that. But that was my task assign to me to find out the solution.
Richard Deeming 11-Aug-20 3:43am    
If the only information you were given is what you've posted in the question, and you don't have access to the source code or the running application, then there's no way you can solve it either.

If, on the other hand, you do have access to the source code and the running application, then you need to provide a lot more detail in your question.

Remember, we can't see your screen, access your computer, or read your mind. All we have to work with is what you type in the "describe the problem" box.

At the moment, all we know is that you're running some code we can't see to export some data we can't access, and that something is missing from your export.
ZurdoDev 7-Aug-20 12:56pm    
Include the null values.

1 solution

If you want to display the fields of Null values, you need to update your Database Table by removing NOT NULL Constraints on the columns you expect NULL Values to be shown. You can refer to this Article for more info => Import And Export Data Using Excel File In ASP.NET MVC[^]

The community is ready to help if you post some code where you are facing some Errors, even this is not the case, in the future try to post some code snippets with your question.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900