Click here to Skip to main content
15,912,504 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
iam working on web site
i have data table that contain some dates & Values
what i need is i need to convert this is data table to excel file wit some import points

1- make some columns invisible
2- change the format of dates & values columns
3-add macro for automic sorting excel file after change date i know the macro statement but i don't know to add it from coding
4-i have some fields that contain formula like sum(),count() etc i want to add those formula for those cells to generate values again after changes in excel value
5-i want some rows to be in different colors depend on 1 column value i have 1 coolumn callled rowcolor i want the forground for each row read from this is colum
6- i need this is excel file to be opened not saved on hard disk becasue i work on server so if it save dit'll be saved on server not on local the same like when u export redlc to excel he just open the excel file on memeory then let u to save or close

**************
i know i ask for many requirements but i need helps
& thanks for any body could help me in any of those points
Posted

6- i need this is excel file to be opened not saved on hard disk becasue i work on server so if it save dit'll be saved on server not on local the same like when u export redlc to excel he just open the excel file on memeory then let u to save or close

You do realize that if you open Excel, it will also be opened on the Server, not the Client, and that there is no way you can force Excel to open on the client from the server?

I think you need to re-think your requirement before you start worrying about points 1-5, because if point 6 isn't going to work anyway, then there is no point in spending your time on the others...
 
Share this answer
 
Try this.
Export DataTable to Excel with Formatting in C#[^]

This might not answer all your points, but still you can derive from this.
 
Share this answer
 

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