|
Mr Sandeep Thank you very much for your respone to my query.
Yes i want to open my excel file which i uploaded in html format in IE.For example in gmail we have the option to view the file which we uploaded as html.Like that i have to view the excel file in html format.Plse help me.
|
|
|
|
|
Put the all Excel files in one folder in your application
Add one link on your page like
<asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="~/Images/02639_SandeepSureshAkhare_BFSI_Self Appraisal.xls" Target=_self>HyperLink</asp:HyperLink></td>
and open it i think this one of the simplest way to open any file
The other is COM object which makes your application bulky
Thanks and Regards
Sandeep
If you want something you never had,
do something you have never done!
|
|
|
|
|
Thank you verymuch Mr Sandeep for your answer.I need to open my excel file as html document.Not as excel file.If i use the methode which u told, it will be opened as excel file right? I request u to help me to view my excel file as html file.Suppose the name of the file i uploaded is book1.xls.I need to save this in the folder in the name of book.html instead of book1.xls.Then i can use the methode which u told.So i can give the url of hyperlink is book1.html so that it will be opened as html document.I request you to Plse help me or give me the code for this.
|
|
|
|
|
Please Import Microsoft Excel from the COM Tab of the Add Reference Page.
See if this code helps U.
Try to understand this and write Ur code accordingly.
Create a table in the webpage.
Add the rows and its contents dynamically by iterating through the corresponding object.
Excel.Workbook objWorkBook = ExcelObj.Workbooks.Open("d:\\one.xls", 0, true, 5,
"", "", true, Excel.XlPlatform.xlWindows, "\t", false, false, 0, true);
Excel.Sheets sheets = objWorkBook.Worksheets;
Excel.Worksheet objworksheet = (Excel.Worksheet)sheets.get_Item(1);
Excel.Range objRange = objworksheet.get_Range("A" + i, "J" + i);
System.Array objvalues = (System.Array)objRange.Cells.Value;
string[] strArray = ConvertToStringArray(objvalues);
//Code to add data to the existing cells
|
|
|
|
|
Mr Arun I am extremily sorry to tell u that this code didnt help me.Now i have the code to convert excell file into html file as follows
using Excel = Microsoft.Office.Interop.Excel;
Microsoft.Office.Interop.Excel.Application excel = null;
Microsoft.Office.Interop.Excel.Workbook xls = null;
excel = new Microsoft.Office.Interop.Excel.Application();
object missing = Type.Missing;
object trueObject = true;
excel.Visible = false;
excel.DisplayAlerts = false;
xls = excel.Workbooks.Open(strFilePath, missing, trueObject, missing,
missing, missing, missing, missing, missing, missing, missing, missing,
missing, missing, missing);
object format = Microsoft.Office.Interop.Excel.XlFileFormat.xlHtml;
IEnumerator wsEnumerator =
excel.ActiveWorkbook.Worksheets.GetEnumerator();
int i = 1;
while (wsEnumerator.MoveNext())
{
Microsoft.Office.Interop.Excel.Worksheet wsCurrent = Convert.ToString(Microsoft.Office.Interop.Excel.Worksheet.ReferenceEquals);
String outputFile = strFilePath + "." + i.ToString() + ".html";
wsCurrent.SaveAs(outputFile, format, missing, missing, missing,
missing, missing, missing, missing, missing);
}
excel.Quit();
I have added the microsoft excel library through add reference. but it is showing error as follows
The type or namespace name 'IEnumerator' could not be found (are you missing a using directive or an assembly reference?)
so how can i rectify this problem?Which name space i have to include to getrid from this error.Plse help me?
|
|
|
|
|
Please try to include this line and let me know if it works.
using System.Collections;
Regards,
Arun Kumar.A
|
|
|
|
|
Yes,
the code U have supplied works fine.
I have made some slight changes and finally
I have converted xl to html.
Regards,
Arun Kumar.A
|
|
|
|
|
Thank You Verymuch Mr Arun.If u dont mind could u plse give me the code which u have changed?I mean The code i have given in which u have modified.
And plse mention the changes which u have done.
|
|
|
|
|
Hi,
Here is the entire code:
using System;
using System.Collections ;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Microsoft.Office;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Excel.Application excel = null; //In my system i am unable to refer the class Excel.Application like what U have.
Excel.Workbook xls = null;
excel = new Excel.Application();
object missing = Type.Missing;
object trueObject = true;
excel.Visible = false;
excel.DisplayAlerts = false;
xls = excel.Workbooks.Open("E:\\aOfficial\\MyFiles\\Output1.xls", missing, missing, missing,
missing,missing,missing,missing,missing,missing, missing,missing,
missing,missing,missing);
object format = Excel.XlFileFormat.xlHtml;
IEnumerator wsEnumerator=excel.ActiveWorkbook.Worksheets.GetEnumerator();
int i = 1;
while (wsEnumerator.MoveNext ())
{
Excel.Worksheet wsCurrent = (Excel.Worksheet )wsEnumerator.Current;//This is the only change
String outputFile = "d:\\a" + "." + i.ToString() + ".html";
wsCurrent.SaveAs(outputFile, format, missing, missing, missing,
missing, missing, missing, missing, missing);
}
excel.Quit ();
}
}
Regards,
Arun Kumar.A
|
|
|
|
|
Thank You verymuch Mr Arun.
|
|
|
|
|
hi,
How can we pass more than one Query String in the site map
<b> this is the exmaple for one query string :</b>
<siteMapNode url="~/Members/Membersmails.aspx?otherCall=No" title="Inbox" description="Inbox"></siteMapNode>
now i want to pass 3 query strings:
<b>this is my code:</b>
<siteMapNode url="~/Members/Memberscomposemail.aspx?otherCall=No&email=k.pulpa@gmail.com&k=7 title="Inbox" description="Inbox"></siteMapNode>
but this is not working
Can any one help me out with this.
Thanx in Advance
|
|
|
|
|
I think that the & is an xml reserved character, you must use the entity form like this & amp ; (without the spaces).
Davide
|
|
|
|
|
It has really helped me,
Thanx a lot ,
I have hard coded the values as below
<siteMapNode url="~/Members/Memberscomposemail.aspx?otherCall=No&email=k.pulpa@gmail.com&k=7" title="Compose Mail" description="Compose Mail"></siteMapNode>
How to pass dynamically the values in the query String of the sitemap
with thanks and regards,
kaushik pulpa
-- modified at 0:07 Saturday 21st April, 2007
|
|
|
|
|
we are requesting an asp page and aspx pages, how the IIS knows the both the pages are different while giving the output from server
Thanks in Advance
-
|
|
|
|
|
There is different HTTP handlers for different extensions.
The request will will pass through different Http Modules and atlast it will be handled by apropriate HTTP hendler.
|
|
|
|
|
Hello Friends,
I am encrypting an string and passing it with URL,
But when it is decrypted it is creating the following error :
System.FormatException: Invalid length for a Base-64 char array. at System.Convert.FromBase64String(String s)
but its working fine on local.
I have noticed one thing that which encrypted string is having '+' in it only that encrypted string creating this error while decrypting online.
And same encryped string is decrypted on local it is working fine...
I am not able to understand why it is happening.
Regards,
rahul saini
|
|
|
|
|
|
Hello Satips,
I think it will work,
as same it is working on local fine ,
I had make changes online now hope for best.
Thanks.
Regards,
rahul saini
|
|
|
|
|
hello Satips,
When i encode an id 58 using httpUitility it returns %7f%3b%f0%a5h%c4wu
but when i pass it in query string it shows the same but when i do request.querystring["Id"] it returns ;hwu t
regards;
rahul saini
|
|
|
|
|
monuSaini wrote: but when i pass it in query string it shows the same but when i do request.querystring["Id"] it returns ;hwu t
Clearly specify your doubt.
I could not able to get your problem.
Regards,
Satips.
|
|
|
|
|
for my requirement i want to change the colour of datagrid row by two colours alternatively, how can i achieve this requirement,
also based on one column value yes or no, if no means i want to change the row colours
please help for the two scenario
Thanks in advance
-
|
|
|
|
|
Try with Code
function myColor(){ <br />
var i = this.getRowProperty("index"); <br />
return obj_data[i][9]; <br />
} <br />
<br />
obj.getColumnTemplate(0).setStyle("color", myColor); <br />
<br />
Regards,
Satips.
|
|
|
|
|
Write this code in ItemDataBound Event
-----------------------------
LinkButton lbd = (LinkButton)e.Item.FindControl("lbDLI");
if (e.Item.FindControl("lbDLI") != null)
{
if (DataBinder.Eval(e.Item.DataItem, "LIVE") != null) // Here LIVE is column name in database
{
int i = Convert.ToInt32(DataBinder.Eval(e.Item.DataItem, "LIVE"));
if (i == 0)
{
lbd.Text = "Idle";
}
else
{
lbd.Font.Bold = true;
lbd.ForeColor = Color.Green;
lbd.Text = "Live";
}
}
}
Regards,
Mayank Parmar
Senior Software Engineer
Amba Tech
Gandhinagar, India
|
|
|
|
|
Hi all,
I am a beginer in .net and i hav to implement a chat program [ web application, not standalone] and i have implemented public chat, but in private chat if a user send a mesage to another, i wanna pop up a window in the second user's computer [ like all other chat servers]. How can i invoke a remote object from server [ to pop up a window in client system from web server ]?
please advice.
Thanks to all.
Ali
|
|
|
|
|
Server send messages to client?In C/S system there maybe some solutions use socket.
But in web applications there is no way to achieve this.
For a substitute,you can use ajax to post some request periodly for check is there are new messages.If ajax request find new message,then get it and show it in a pop up window.
▒〓〓〓〓〓▒▒〓▒〓▒▒
▒〓▒▒▒▒▒〓〓〓〓〓▒
▒〓▒▒▒▒▒▒〓▒〓▒▒
▒〓▒▒▒▒▒〓〓〓〓〓▒
▒〓〓〓〓〓▒▒〓▒〓▒▒
|
|
|
|
|