Unable to store Data to Excel File in IIS [Resolved]

Posted by Manorama under IIS on 4/25/2013 | Points: 10 | Views : 1562 | Status : [Member] | Replies : 1
hi to all......
here i done the application in MVC3.Functionality of Export to excel is its working Fine . and Its Stores the Data In My Local System .When I Load My project into IIS 7;

The Data is not Storing into Excel ..and also it is not showing any error in another's System

Here i wrote the code after click on button it goes to store in the Excel.

This is my code...

[HttpPost]
public ActionResult Index(FormCollection fc)
{
HttpFileCollectionBase Files = HttpContext.Request.Files;
string fileName = Files[0].FileName;
fileName = @Url.Content(fileName);


string testcaseId = fc["TestCaseID"].ToString();

var result = (from tab1 in db.TestKeywords
join tab2 in db.Keywords_tbl
on tab1.KeywordName equals tab2.KeywordName into newTable
from tab3 in newTable
join tab4 in db.Parameter_tbl
on tab3.KeywordId equals tab4.KeywordId
where tab1.TestCaseId == testcaseId
select new
{
tab1.TestCaseId,
tab1.KeywordName,
tab3.Description,
tab4.ParamName,
tab4.ParamDescription,
tab4.ParamValue
}).ToList();


TextWriter sw = new StreamWriter(fileName);

sw.WriteLine("TestCase ID\tKeyWord Name\tKeyWord Description\tParameter Name\tParameter Description\tParameter Value");
sw.WriteLine(
);

foreach (var item in result)
{
sw.Write(item.TestCaseId + "\t");
sw.Write(item.KeywordName + "\t");
sw.Write(item.Description + "\t");
sw.Write(item.ParamName + "\t");
sw.Write(item.ParamDescription + "\t");
sw.Write(item.ParamValue + "\n");
}

sw.Close();

return View();

}

Please Guide me .

Thanks in Advance

ManoRama

ManoRama


Responses

Posted by: Jitendrasoft09 on: 4/26/2013 [Member] [MVP] Starter | Points: 50

Up
0
Down

Resolved
Hi,
This could be the problem of MVC3 dll configuraion on IIS, please check below link that would be helpful for you.
http://czetsuya-tech.blogspot.in/2011/06/how-to-deploy-mvc3-powered-website-to.html

Jitendra Kumar
If my post helps you, plz mark as an answer.

Manorama, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response