|
Hi to all,
I'm having a problem that I hope someone can help me with.
I'm trying to export data from an asp.net page to an Excel file and I'm basically just outputting HTML to the XLS file and let Excel interprets it, by using this type of coding:
HttpContext.Current.Response.Clear();
HttpContext.Current.Response.ClearHeaders();
HttpContext.Current.Response.ClearContent();
HttpContext.Current.Response.Charset = "utf-8";
HttpContext.Current.Response.ContentEncoding = System.Text.Encoding.GetEncoding("Windows-1252");
HttpContext.Current.Response.AddHeader("content-disposition", String.Format("attachment; filename={0}", "\"File.xls\""));
HttpContext.Current.Response.ContentType = "application/ms-excel";
using (StringWriter sw = new StringWriter())
{
using (HtmlTextWriter htw = new HtmlTextWriter(sw))
{
gridview.RenderControl(htw);
HttpContext.Current.Response.Write(sw.ToString());
HttpContext.Current.Response.Flush();
HttpContext.Current.Response.End();
}
}
However, although this is doing fine for exporting raw text, I now have to export to the same Excel file an image. However, the same kind of method I'm using right now only seems to insert a "linked" image, I mean, the image appears in the file, however, the user viewing the file has to be online since it's a direct link to the file in the server. I would like to able to "embeded" the image in the file, just like how it's made when you insert manually an image using Excel.
However, after some online research I can't seem to find any solution for this. Can anybody help me out here and point me to what a possible solution would be?
I can't use Microsoft.Office.Interop.Excel library, and a third party software isn't advisable also, that's what made me try out the HTML output solution, which worked ok for the text. But now, for inserting an image, what can I do? Is it possible to achieve what I pretend?
Thanks in advance.
|
|
|
|
|
hello
I work on a intranet site of management review, to insert the markes I have files for each module I want only the professor of module has the right
access to his file.How ?
Thanks
|
|
|
|
|
Can you elaborate your requirement? Then It will better to answer your question.
Parwej Ahamad
ahamad.parwej@gmail.com
|
|
|
|
|
Hi ;
1-files visible to the people of Registration Service
2-files for teachers:
semester 1
file visible to teachers of Module 1
file visible to teachers of Module2
file visible to teachers of Module 3
semester 2
file visible to teachers of Module 4
file visible to teachers of modules 5
file visible to teachers of Module 6
3- the other file are visible to all users
Thanks
|
|
|
|
|
You can use Roles. Have a look at this[^].
|
|
|
|
|
i have a requirement same like our codeproject Forum.(Gridview)
Plz suggest some idea in c#.
Thanks in advance
Ramkumar
("When you build bridges you can keep crossing them. ")
http://ramkumarishere.blogspot.com
|
|
|
|
|
|
|
|
public static void Main(object args[])
{
switch(args[0])
{
case 1:
Console.WriteLine("Ask a specific question about what you don't understand");
break;
case 2:
Console.WriteLine("Hire someone");
break;
default:
Console.WriteLine("Google");
break
}
}
OK, here is some ideas in C#
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Ramkumar_S wrote: i have a requirement same like our codeproject Forum.(Gridview)
I have little confusion about your question. will you explain your question please.
|
|
|
|
|
i want to create a Forum (design should be same like our code project forum).
I thing now u are getting my question
Ramkumar
("When you build bridges you can keep crossing them. ")
http://ramkumarishere.blogspot.com
|
|
|
|
|
Thanks guys...
any one tried with gridview , because that code was not develop with grid.
Ramkumar
("When you build bridges you can keep crossing them. ")
http://ramkumarishere.blogspot.com
|
|
|
|
|
Hello,
I would read files on my machine, for exemple if i use the path : 'c:\test\doc.pdf' , he acces on disk c: on my server but i need to read the file on my local disk c:\.
Thank you verry mutch.
|
|
|
|
|
Since you're in ASP.NET forum you must be talking about a web application. So yes of course, the web application is running on the server and thus cannot not access the file system of the system the client (your browser) is running on. You can implement a file upload mechanism from your client to the server, then the server can access the file.
Cheers!
|
|
|
|
|
Hello,
Can you tell me how i cen do this ?
Thank you verry mutch.
|
|
|
|
|
Which part? Uploading the file or accessing it once it is uploaded. In either case look here[^]
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Hi,
I've created few tab panel at runtime
and i'm trying to add every one of them some content.
I know how to add controls, but i hava problems adding HTML tags to spacific once.
Can anyone help me?
10x
|
|
|
|
|
How do you want to do this, server-side or client-side? What have you tried so far?
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Hi All,
I have one .net web application. I am trying to build using MSBUILD on my machine, its not building on my machine. But this same code is building on other colleagues machine.
What can be the reasons for this not building. We have different operating systems on our machines but same MSVS.Net 2008.
Are there any dlls different for these two operating systems. If it can be because of Frameworks on our machine then how can we check the frameworks installed on our machines.
Please help me in this, happy new year to all you guys in advance.
Thanks & Regards,
Md. Abdul Aleem
NIIT technologies
|
|
|
|
|
If you have Visual Studio why are you using MSBUILD? Open the project in VS and built it. Either way there should be a list of errors, either in teh output window or in log files that indicate why the project can not be built.
Also, if you both have VS2008 then you both have (or should) the same .NET Framework.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Hi,
The project is building using Visual Studio on my machine but when I use MSBuild its not building. Thats my problem. The same project when I check in he downloads on his machine it builds using MSBuild. My Build query is : msbuild HrxBuild.xml /p:Environment=QA2.
The error that its giving is Solution File Error MSB11504: File format version is not recogninsed. MSBuild can read the solution files between version 7.0 and 9.0 inclusive.
Error MSB3073: The Command "msbild /t:Clean /P: Configuration=Debug.XXXX.XxxxXpress.sln exited with code 1".
Please help me in this regard.
Thanks & Regards,
Md. Abdul Aleem
NIIT technologies
|
|
|
|
|
Well you have all of the information you need. What version of MSBuild are you using? Obviously not the same one VS is using. Again, why are you using MSBuild to begin with?
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Possibly, it might be a Build Machine (Wild Guess).
We do have the same setup in my work place. They BNR uses MSBUILD only.
|
|
|
|
|
You don't need visual studio for msbuild, it is part of the sdk.
I know the language. I've read a book. - _Madmatt
|
|
|
|