|
|
I Dont know but may be this will work......
http://support.microsoft.com/kb/875447
If work let me... Know......
|
|
|
|
|
Hi Mihir Thanks for reply. i have gone through the link you have given.
this is using reporting services to render any report in any file format. my scenario is totally different as i am having one gridview and i want to display (open or save)the gridview content in pdf file.
here i am not saving my gridview data into database in any format(not even report). so i can't use this as it will work only if we are saving our data or have any data in database as report(using reporting services), then we can use reporting service to display it in any format.
please let me know if i am wrong.
People often say that motivation doesn't last. Well, neither does bathing - that's why we recommend it daily
Akhilesh Singh
|
|
|
|
|
Ok...
Then will it work if the output file is in excel format .... if yes.... try following code...
using System.Data.SqlClient;
using System.IO;
try
{
string strLine = "";
object filePath;
object fileName;
object filePDF;
FileStream objFileStream;
StreamWriter objStreamWriter;
//Create a pseudo-random file name.
filePDF = "Test.xls";
//Set a virtual folder to save the file.
//Make sure that you change the application name to match your folder.
filePath = HttpContext.Current.Server.MapPath("\\Mihir\\Gridview20Excel\\Output");
fileName = filePath + "\\" + filePDF;
//Use FileStream to create the .xls file.
objFileStream = new FileStream(fileName.ToString(), FileMode.OpenOrCreate, FileAccess.Write);
objStreamWriter = new StreamWriter(objFileStream);
//Take the string for data.
strLine = "";
//Enumerate the data that is used to populate the file.
for (int i = 0; i < GridView1.Rows.Count; i++)
{
for (int j = 0; j < GridView1.Rows[i].Cells.Count; j++)
{
strLine = strLine + GridView1.Rows[i].Cells[j].Text + "\t"; // +Strings.Chr(9);
//objStreamWriter
}
objStreamWriter.WriteLine(strLine);
strLine = "";
}
//Clean up.
objStreamWriter.Close();
objFileStream.Close();
}
catch (Exception)
{
throw;
}
|
|
|
|
|
Hi Mihir. thanks for reply.
i tried that one, it is working fine for excel but for pdf no luck, it's saving file, but while opening it's giving error saying either file is currupted or not decoded properly.
please let me know if it is working for you for pdf files.
People often say that motivation doesn't last. Well, neither does bathing - that's why we recommend it daily
Akhilesh Singh
|
|
|
|
|
hi... akhilesh....
I had tried it for PDF ... & Got same ... Error.... so sorry for that.....
in that case may be some toolkit or Lib. will... work... but u r not ready to use them ... so try .. some other thing and if got it share it with me.....
Best of Luck....
|
|
|
|
|
Thnaks and sure , if i get some solution or will able to use link send by you then will surely reply to this message.
bye...
People often say that motivation doesn't last. Well, neither does bathing - that's why we recommend it daily
Akhilesh Singh
|
|
|
|
|
hi ...
my problem is when write follow code in text of a text box
<!--
....
and click a button, fire this exception :
"A potentially dangerous Request.Form value was detected from the client"
how can correct it ?
tanks
|
|
|
|
|
You cann't enter HTML code or any script in the TextBox. Everytime when a page is submitted, ASP.NET validates it and it doesn't allows script for security purpose. still if you to do it then you can by setting page validation to false..
Regards John
|
|
|
|
|
tanks john
yes. as you sad, i must set the validation page property to false. i find it in
http://www.cryer.co.uk/brian/mswinswdev/ms_vbnet_server_error_potentially_dangerous.htm
|
|
|
|
|
I have created one aspx page which contain some controls like textbox,label,dropdownlist etc.,. The aspx page contain one button called "Overlay". Once i click the button , a new overlay page open with in the aspx page.
Pls give the code for this ASAP
Thanks in Advance
|
|
|
|
|
jayarajmrj wrote: Pls give the code for this ASAP
We are not here to do your work. Do it and tell what error it says so that we can solve your problem.
SSK.
|
|
|
|
|
Hi friends
I have created classlibrary in asp2.0.
name is signup.cs it is placed in app_code folder.
how can i call the class in aspx page
regards
saravan
|
|
|
|
|
use Namespace to call that class.
SSK.
|
|
|
|
|
i tried
but i didnot come.
regrds
saravanan
|
|
|
|
|
|
How page post back event works?
what type of work we can handle to page post back?
|
|
|
|
|
Hope this[^] may help you.
SSK.
|
|
|
|
|
I have a Multiview with 3 view placed inside.
There is also a RadioButton List which cycles through the 3 different views,
When I select them
The radio button options will have
* View 1
* View 2
* View 3
I would like to know how to display all 3 view at the same time.
In this case i thought of having this option on the radiolist button
* View 1
* View 2
* View 3
* View All the above
|
|
|
|
|
The MultiView control can only display one View at a time. If you want to have all Views displayed I suggest that you replace the MultiView with 3 Panels and hide/show them accordingly to the selection in the RadioButton list.
-^-^-^-^-^-
no risk no funk ................... please vote ------>
|
|
|
|
|
Hi,
How can i pass server controls to ASP.NET webservice webmethod? Any help will be appreciated. Its very urgent.
Thanks,
Ahmad
|
|
|
|
|
This is second time that we got this question.
Dot Net wrote: How can i pass server controls to ASP.NET webservice webmethod?
Could you please tell me a lit bit about why you wanna pass the server controls to Web Service?
this is very strange to me. I have been working in a lot of web projects that are using Web Service but I never need that kinda situation (passing the server control to webservice) before.. All we passed to webservice are either individual parameter or custom business objects (entity).
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you.
|
|
|
|
|
I am writing an AJAX based chat system with private messaging feature. Multiple users can chat with each other in their own private windows. Window does not pop up as a browser window but i have written a user control for this. In this user control i have used DragPanelExtender and ResizableExtender of ASP.NET AJAX. System queries database after every couple of seconds and fetches messages for the current user. Now if someone has sent a message to the user a new chat window pops up dynamically. I am creating all chat windows in an update panel so that postback could be made seemless. Now the problem is that if a users is dragging his window or resizing it and page gets posted to the server it gives me a javascript error: 'window' is null or not an object. After this error all chat windows freeze on screen. Actually i need a mechanism through which i could create user controls without postback so that previous controls' state could be maintained.
If all this makes any sense to you could you propose any solution for this problem? Thanks in advance.
Thanks,
Ahmad
|
|
|
|
|
Why do you want to pass controls to a web service ? It's almost guarenteed that there's no reason for it, what you probably want to do is pass some information stored in the controls to the web service.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi,
I want to display a table based on the selected item of the listbox. Say I have two tables "Ftable" and "Stable". If item in the listbox is "First" then Ftable should get displayed else Stable should be displayed.
I tried, If listbox.selecteditem="First" Then
Ftable.visible=true
else
Stable.visible=true
EndIf
But it is not working, How else can I do this?
Thank you in advance.
Chaitra N
|
|
|
|