|
That could be a message from Excel. When you saved data in the new format and use the extension .xls instead of .xlsx, Excel will warn you. And similar the other way round. So just try
Response.AddHeader( "Content-disposition","attachment; filename=My Company Details.xlsx");
and make sure your Excel file is correctly named.
|
|
|
|
|
Hi,
I am beginning with asp.net and I have downloaded the following: VS Express 2012 (with asp.net 4.5 ) and sql server express from www.asp.net/downloads
I want to download some simple asp.net (c#) projects which will give me a basic understanding of the fundamentals of asp.net. e.g simple tricks and tips to do tasks in asp.net. Please advice.
Thanks !
|
|
|
|
|
|
Hi,
I need to export file in xlsx format. My code is bellow:
string Path = strFullTo + "Balancing_" + String.Format("{0:MMddyy}", DateTime.Now) + ".xlsx";
StringWriter stringWriter = new StringWriter();
HtmlTextWriter htmlWrite = new HtmlTextWriter(stringWriter);
GridView DataGrd = new GridView();
System.IO.StreamWriter vw = new System.IO.StreamWriter(Path, true,System.Text.Encoding.Default);
stringWriter.ToString().Normalize();
string style = @" .textmode { mso-number-format:\@; } ";
vw.Write(style);
vw.Write(stringWriter.ToString());
vw.Flush();
vw.Close();
But my problem is when I am trying to open the xlsx file it is saying "File format or extension is not valid".
I need to keep the data in xlsx file. Please help.
Thanks & Regards
Mishra
|
|
|
|
|
You need to export as .xls instead of .xlsx. .xlsx is more of an xml format but .xls can support html format, which is essentially what you are doing.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
I have created a treeview, which is binding categories and subcategories from database.
I want to display an icon (image) on left side of the treeview. For example, in treeview I have categories such as amana tool as a parent node and the router bits as child node of amana tool. So, in database I have icon of amana tool as well as icon of router bits. Now, I am able to show categories (amana tool) only in treeview. But, I need that left side should show the icon of the related categories and then categories name(amana tool).
Note: The icon should bind from database but it should not be static icon because I need to show more than 100 categories and the icon existing in database.
Please help me out.
Here my code works correctly , further what i have to do?
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
namespace ShopGear1.View
{
public partial class treefin : System.Web.UI.Page
{
private string scon = "";
protected void Page_Load(object sender, EventArgs e)
{
scon = " connection string";
ModuleTreeView.CollapseAll();
FillTreeView();
}
public DataTable GetModuleDetails()
{
using (SqlConnection conn = new SqlConnection(scon))
{
string sql = "sql query";
SqlDataAdapter da = new SqlDataAdapter(sql, conn);
DataTable dt = new DataTable();
da.Fill(dt);
return dt;
}
}
public void FillTreeView()
{
DataTable modules = new DataTable();
modules = GetModuleDetails();
ModuleTreeView.Nodes.Clear();
PopulateTreeNode(modules, null, 0);
}
private void PopulateTreeNode(DataTable modulelist, TreeNode parent, int parentid)
{
TreeNodeCollection baseNodes;
TreeNode node;
if (parent == null)
{
baseNodes = ModuleTreeView.Nodes;
}
else
{
baseNodes = parent.ChildNodes;
}
foreach (DataRow dtrow in modulelist.Rows)
{
if (int.Parse(dtrow["parent_orid"].ToString()) == parentid)
{
node = new TreeNode();
node.Text = dtrow["descript"].ToString();
node.Value = dtrow["code_webcategory_id"].ToString();
node.SelectAction = TreeNodeSelectAction.Select;
baseNodes.Add(node);
PopulateTreeNode(modulelist, node, int.Parse(dtrow["code_webcategory_id"].ToString()));
}
}
ModuleTreeView.CollapseAll();
}
}
}
|
|
|
|
|
I had to program the ParentNodeStyle.ImageUrl = "The Image Path"
This is a treeview I made for ckEditor, it's all code in vb, but you should get the idea. It was created on Protected Sub OnInit().
As you create more nodes, just add the new image url
tv_FileBrowser_Content_Navigation = New TreeView
With tv_FileBrowser_Content_Navigation
.ID = [ID] & "_tv_FileBrowser_Content_Navigation"
.Style.Add(HtmlTextWriterStyle.Width, "90%")
.Style.Add(HtmlTextWriterStyle.PaddingTop, "25px")
.ExpandDepth = 10
.ImageSet = TreeViewImageSet.XPFileExplorer
.NodeIndent = 10
.ShowLines = True
.ShowExpandCollapse = True
.PathSeparator = Convert.ToChar("/")
.NodeStyle.ForeColor = Drawing.Color.Black
.NodeStyle.HorizontalPadding = 6
.NodeStyle.VerticalPadding = 0
.NodeStyle.NodeSpacing = 0
.RootNodeStyle.HorizontalPadding = 6
.ParentNodeStyle.ImageUrl = cs.GetWebResourceUrl(rsType, "Admin_PM_Standard.folder_0.png")
.ParentNodeStyle.HorizontalPadding = 6
.SelectedNodeStyle.ForeColor = Drawing.Color.Black
.SelectedNodeStyle.BackColor = Drawing.Color.LightGray
.SelectedNodeStyle.Font.Underline = False
.SelectedNodeStyle.HorizontalPadding = 6
.SelectedNodeStyle.VerticalPadding = 0
.HoverNodeStyle.Font.Underline = True
.HoverNodeStyle.ForeColor = Drawing.Color.Black
.HoverNodeStyle.BackColor = Drawing.Color.LightGray
node_Editor = New TreeNode("File Browser")
node_Editor.Selected = True
node_Editor.SelectAction = TreeNodeSelectAction.Expand
node_Editor.Text = "File Browser"
node_Editor.Value = "/Product/editor"
node_Editor.ImageUrl = cs.GetWebResourceUrl(rsType, "Admin_PM_Standard.myComputer.png")
.Nodes.Add(node_Editor)
'########################################################
'
node_Files = New TreeNode("files")
node_Files.CollapseAll()
node_Files.Selected = False
node_Files.SelectAction = TreeNodeSelectAction.Expand
node_Files.Text = "files"
node_Files.Value = "files"
node_Files.ImageUrl = cs.GetWebResourceUrl(rsType, "Admin_PM_Standard.folder_0.png")
node_Editor.ChildNodes.Add(node_Files)
'########################################################
'
node_Flash = New TreeNode("flash")
node_Flash.CollapseAll()
node_Flash.Selected = False
node_Flash.SelectAction = TreeNodeSelectAction.Expand
node_Flash.Text = "flash"
node_Flash.Value = "flash"
node_Flash.ImageUrl = cs.GetWebResourceUrl(rsType, "Admin_PM_Standard.folder_0.png")
node_Editor.ChildNodes.Add(node_Flash)
'########################################################
'
node_Images = New TreeNode("images")
node_Images.CollapseAll()
node_Images.Selected = False
node_Images.SelectAction = TreeNodeSelectAction.Expand
node_Images.Text = "images"
node_Images.Value = "images"
node_Images.ImageUrl = cs.GetWebResourceUrl(rsType, "Admin_PM_Standard.folder_0.png")
node_Editor.ChildNodes.Add(node_Images)
'########################################################
'Context Menu's
'########################################################
AddHandler .SelectedNodeChanged, AddressOf tv_FileBrowser_Content_Navigation_SelectedNodeChanged
AddHandler .TreeNodeExpanded, AddressOf tv_FileBrowser_Content_Navigation_TreeNodeExpanded
AddHandler .TreeNodeCollapsed, AddressOf tv_FileBrowser_Content_Navigation_TreeNodeCollapsed
End With
panel_FileBrowser_Content_TreeView.Controls.Add(tv_FileBrowser_Content_Navigation)
As you create each addtional node, you add the image url.
I know you can use an embedded image, but not sure how to use a database blob.
[edit]
I only created the first level nodes in the initial treeview. The child nodes are populated on demand, when a parent node is expanded, so an event handler was added to detect expand node, and upon expansion, the child nodes are added according to the parent node type or name.
I had load time issues on the first couple of tries, and had to speed it up a bit.
|
|
|
|
|
I am developing a web application, which have to get the data from selected Excel file and save it in SQL Database.
I want to select Excel File in runtime using the FileUpload control. Is this possible..? Please guide me..
|
|
|
|
|
hi SravanKumar-A,
yes it's possible....
first, his first save the file when uploaded, this means stored on the Server side, here you set it to accommodate PathLocation Files uploaded the results ..
then, you read his file based PathLocation excel file it in the store ..
how to read the contents of the data from the Excel file, you can googling, a lot of his examples ..
You must read the contents of his excel how many rows,
then you loop through the contents of each row to get her,
then you input into a database row-a row ..
after that you delete the file upload it if you save the file you do not use anymore ..
yes, this is just a logical course to determine the appropriate code logic what its like ..
|
|
|
|
|
previously we worked on Google calendar Version 2 but now we want to convert it to Google calendar version 3. If any one has worked on Google calendar version 3. Kindly send me a small project over it otherwise send me some details of migrating it to version 3.
The problem that i am facing is in verison 2, we use EventFeed, EventQuery, CalendarQuery, CalendarFeed so here i am getting the problem.
|
|
|
|
|
|
ya i go through the Google calendar Migration doc, it helps but they didn't explain anything on what to do with EventFeed, EventQuery, CalendarFeed, CalendarQuery
|
|
|
|
|
I am facing below issue during the web site execution. Kindly help me how to resolve this issue.
Client found response content type of 'multipart/related; boundary=MIMEBoundaryurn_uuid_4031DA6F87A35F03091373531842143; type="text/xml"; start="<0.urn:uuid:4031DA6F87A35F03091373531842144@apache.org>"', but expected 'text/xml'. The request failed with the error message: -- --MIMEBoundaryurn_uuid_4031DA6F87A35F03091373531842143 Content-Type: text/xml; charset=utf-8 Content-Transfer-Encoding: 8bit Content-ID: <0.urn:uuid:4031DA6F87A35F03091373531842144@apache.org> 03903Business PostpaidContactfalse<title>MrMBSESEseMB SE SEMale15sfkssljfkslskjdfkAabaN/ALebanonNorth LebanonKouraN/A1231980-01-01LebaneseCitizenArabicPhonefalsefalsefalsefalsefalsefalsefalsefalsefalsefalsefalsefalsefalsefalsefalsefalsefalsefalsefalsefalsefalsefalsefalsefalsefalsefalse2002011-01-01T00:00:00.0Z9999-12-30T23:59:59.0ZfalseMB SE SEBusiness PostpaidAdministrationfalseB0000040238B0000040238D00000402380-0.05truefalseActiveManually Created2011-01-01T00:00:00.0Z2011-04-01T09:38:22.0Z2011-01-01T00:00:00.0Z00015sfkssljfkslskjdfkAabaN/ALebanonNorth LebanonKouraN/A??????????XML Format 1Customer's Invoice Addressfalsefalsetruefalse231_TestSchTesting ScheduleTaxableInvoicefalsefalsefalsetrueMedium Risk - Cash & DD4AVOC8PRC04falsefalse008320Cash at POSHome0 --MIMEBoundaryurn_uuid_4031DA6F87A35F03091373531842143-- --.
dadsadasd
|
|
|
|
|
Please do not repost the same issue; if anyone knows the answer they will respond in their own time. Please delete the duplicate, and if you have any further information, edit the above post.
Use the best guess
|
|
|
|
|
asv wrote: <Title>Mr</Title>MBSESEseMB SE SEMale15sfkssljfkslskjdfkAabaN/ALebanonNorth
Did you transmit this?, or did you receive this?
In the quote above, the 2nd XML field corrupted, probably because you did not encode the entire package before transmitting to the server. I suspect you may have international chars in the values.
The server was looking for UTF-8 encoding, but I'm not sure what the package looked like before you transmitted it, or what the response is suppose to look like as well.
You may of transmitted garbage to the server when making your web request, and received back garbage as an error. If the web service was well written, in which I don't know, then you should of got back a clean XML Text of the error.
[FYI]
Looking at the data, I remember a post several months ago from an OP that was working with airline ticket data, looks similar to yours, but the data was packaged as a delimited char array, and was not XML or WSDL. I see the same data structure in the posted code dump that I saw in that OPs post.
If your the same guy or gal, so you probably explain what your up to here, so we can get a better idea of how to help you.
[edit]
asv wrote: A1231980-01-01LebaneseCitizenArabicPhonefalsefalsefalsefalsefalsefals
This is the delimited text in the code file I saw months ago.
|
|
|
|
|
I am executing the API and throwing a below error. kindly help me on this.
API Response in Web Browser:
Calling Customer Details Fetch
API call is failed Client found response content type of 'multipart/related; boundary=MIMEBoundaryurn_uuid_F88BEACD3D34947E3A1373490867796; type="text/xml"; start="<0.urn:uuid:F88BEACD3D34947E3A1373490867797@apache.org>"', but expected 'text/xml'. The request failed with the error message: -- --MIMEBoundaryurn_uuid_F88BEACD3D34947E3A1373490867796 Content-Type: text/xml; charset=utf-8 Content-Transfer-Encoding: 8bit Content-ID: <0.urn:uuid:F88BEACD3D34947E3A1373490867797@apache.org> 03903Business PostpaidContactfalseMBSESEseMB SE SEMale15sfkssljfkslskjdfkAabaN/ALebanonNorth LebanonKouraN/A1231980-01-01LebaneseCitizenArabicPhonefalsefalsefalsefalsefalsefalsefalsefalsefalsefalsefalsefalsefalsefalsefalsefalsefalsefalsefalsefalsefalsefalsefalsefalsefalsefalse2002011-01-01T00:00:00.0Z9999-12-30T23:59:59.0ZfalseMB SE SEBusiness PostpaidAdministrationfalseB0000040238B0000040238D00000402380-0.05truefalseActiveManually Created2011-01-01T00:00:00.0Z2011-04-01T09:38:22.0Z2011-01-01T00:00:00.0Z00015sfkssljfkslskjdfkAabaN/ALebanonNorth LebanonKouraN/A??????????XML Format 1Customer's Invoice Addressfalsefalsetruefalse231_TestSchTesting ScheduleTaxableInvoicefalsefalsefalsetrueMedium Risk - Cash & DD4AVOC8PRC04falsefalse008320Cash at POSHome0 --MIMEBoundaryurn_uuid_F88BEACD3D34947E3A1373490867796-- --.
dadsadasd
|
|
|
|
|
This looks like a call to a web service using XML, but is really a server that splits out delinted text. There is a char value missing that seperates each field that is not showing above.
You simply don't understand what your working with here.
It's a fixed response. It's always let's say, 80 items, always in the same position. Kind of like a floppy disk, which is divided into 80 sectors. But I digress,
1 - 03903
2 - Business
3 - Post
4 - Paid
5 - Contact
and so forth until the end
So you figure how to just request the response, decode the response, and split the value into an array string or list or something, then you can access each value by number, so if you want value 1, you look for response(1)
Maybe somebody else can expand or help out further.
|
|
|
|
|
Info Created - packages/MSBuildTasks.1.4.0.61/tools/Install.ps1
Info Creating backup of previous version - packages/MSBuildTasks.1.4.0.61/tools\MSBuild.Community.Tasks.dll
Failure Installation Failed - ResourceFile
Info Rolling back component install - Script
Info Restored backup of previous version - Providers\DataProviders\SqlDataProvider\00.00.01.SqlDataProvider
Info Restored backup of previous version - Providers\DataProviders\SqlDataProvider\Uninstall.SqlDataProvider
Info Component rolled back successfully - Script
Info Installation Failed - task
Info Deleted temporary install folder
EndJob Installation Failed
|
|
|
|
|
I would recommend going to their support/forum to ask.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
hi, friends,
I am developing the web app for touch device.
I have the gridview inside the DIV, showing the list of data.
if I used the scrollbars for this div, it is no good to scroll by touching on touch device.
I want to scroll up/down on the gridview content like the swiping.
because, the users will try to swipe the DIV by touching rather than scrolling on the scrollbar.
how can I achieve?
|
|
|
|
|
i've got a problem about the text editor , it runs well on the computer . but when i visit the website through my cellphone's browser ,the textarea is just the original style;
how can the text editor come into effect?
|
|
|
|
|
Hi,
I have a table created in database. What i want to do is to print the data from a column in table inside <menubar>
|
|
|
|
|
You need to get the data from your database. Where are you stuck?
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
Dear all,
Need to ask you guys who have work on JasperReport with Asp.Net MVC 4.
I've done some project which required report in pdf, and we have choose jasperreport since it easy to use with mysql.
When i call the report through jasperreport web service REST, it return the stream but i cant to make it be downloaded as pdf.
So is there anyone have work on jasperreport and asp.net?
Need your guys help
|
|
|
|
|
long ago that I have been researching how to create a report with crystal report server that runs in iis 7.
I have done various forms all running on my machine, only to put on the server, the report never appears .. I wanted to know how to do through dataset. I have a stored procedure that makes my select and this takes 1 parameter to perform the search. I need to know how to create a dataset where I pass this stored procedure, and then the steps you need to take to create my report through this dataset, and then put on the server, so that everything can work perfectly ... any ideas??
|
|
|
|
|