|
I have used the follwing code:
The first sheet has the dataset value.But the second shhet doesnt have any value.I dont knw where the second data will be added to the XML writer cod part.
protected void btnExport_Click(object sender, EventArgs e)
{
string procInfo = "type='text/xsl' href='" + "\\transform.xslt" + "'";//Processing info for XSLT
string curdate = DateTime.Now.ToString().Replace(":", "").Replace("/", "").Replace(" ", "");
//string FileName = curdate + "_" + "Details_test.xls";
string TempPath = Server.MapPath("../Uploads");
string XMLPath=TempPath+ "\\Details.xml"; //temp path to store the XML file
string XLSPath = TempPath + "\\Details.xls";//temp path to store the XLS file
//Write the dataset as XML file with some XSLT processing information
using (XmlTextWriter tw = new XmlTextWriter(XMLPath ,
null))
{
tw.Formatting = Formatting.Indented;
tw.Indentation = 10;
tw.WriteStartDocument();
DataSet ds = GetDetails1();
ds.Tables[0].TableName = "Detail1";
DataSet ds1 = GetDetails2();
ds1.Tables[0].TableName = "Detail2";
tw.WriteProcessingInstruction("xml-stylesheet", procInfo);
ds.WriteXml(tw);
//ds1.WriteXml(tw);
}
XmlDataDocument xmldoc = new XmlDataDocument();
xmldoc.Load(XMLPath);
XslCompiledTransform xsl = new XslCompiledTransform();
xsl.Load(Server.MapPath(".")+"\\transform.xslt");
using (XmlTextWriter tw = new XmlTextWriter(XLSPath, System.Text.Encoding.UTF8))
{
tw.Formatting = Formatting.Indented;
tw.Indentation = 3;
tw.WriteStartDocument();
xsl.Transform(xmldoc, null, tw);//Performa XSLT transformation.
}
//Streams the generated XLS file to the user
byte[] Buffer = null;
using (FileStream MyFileStream = new FileStream(XLSPath, FileMode.Open))
{
// Total bytes to read:
long size;
size = MyFileStream.Length;
Buffer = new byte[size];
MyFileStream.Read(Buffer, 0, int.Parse(MyFileStream.Length.ToString()));
}
Response.ContentType = "application/xls";
string header = "attachment; filename=" +"Details.xls";
Response.AddHeader("content-disposition", header);
Response.BinaryWrite(Buffer);
Response.Flush();
Response.End();
}
|
|
|
|
|
I have used the below code.and the corresponding workbooks are added with the data values.
DataSet ds = new DataSet();
Datatable dt1;
dt1 = Details1();
Datatable dt2;
dt1 = Details2();
Datatable dt3;
dt1 = Details3();
ds.Tables.Add(dt1.Copy());
ds.Tables.Add(dt2.Copy());
ds.Tables.Add(dt3.Copy());
using (XmlTextWriter tw = new XmlTextWriter(XMLPath ,
null))
{
tw.Formatting = Formatting.Indented;
tw.Indentation = 10;
tw.WriteStartDocument();
tw.WriteProcessingInstruction("xml-stylesheet", procInfo);
ds.WriteXml(tw);
}
|
|
|
|
|
Hi, friends,
please answer to me.
I want to print to serial printer from asp.net web application,
is it possible?
the printer is using serial port, and small one for printing queue ticket, or billing receipts.
is it possible to print on such kind of printer from the browser?
please suggest me on this.
best regards
|
|
|
|
|
I think instead of printing from the web app that you insert the data into a database then use a desktop app to watch for new records and print them out. That way you can disconnect the web app from the desktop side.
|
|
|
|
|
If i want to develop a 'small' website based on ASP.NET but using a free content management system, what would you strongly recommend.
What is your take on kentico[^] or http://umbraco.com/[^]
|
|
|
|
|
Definitely Umbraco.
Twenty years from now you will be more disappointed by the things that you didn't do than by the ones you did do. So throw off the bowlines. Sail away from the safe harbor. Catch the trade winds in your sails. Explore, Dream. Discover.
|
|
|
|
|
Yes go with Umbraco. It's a good one
|
|
|
|
|
|
|
Good morning,
I'm working on a project where I've to connet to a provider server. This server uses OAuth2 techmology for authentication. You can find the sandbox example here http://sandbox.ihealthlabs.com/contentfiles/files/SandboxAPISample.zip and you can use the credentials sandboxuser@ihealthlabs.com with password 111111 .
OK, this example allows you to access and view the informations with an user but I want to make a log-like page where I will make access and extract the datas of many users and update an our database.
But I don't know where to start.
I found some libraries and examples but always for Facebook, Twitter etc...
The only documentatios that I have is the pdf inside this zip file http://developer.ihealthlabs.com/contentfiles/files/Open%20API%20Protocol.zip
Please, can you help me?
Thank you
|
|
|
|
|
hello sir,
how to bind local Computer drivers in treeview as well Directories using asp.net c#?.
please sir give me source code on Email:- rrajiv91@gmail.com
thanks sir.
|
|
|
|
|
|
i need the solution for configuring IIS for securing web application. Please help me Sir/Madam...
yours truly
S. Sumathi
|
|
|
|
|
|
Hi guys,
i have a data base table which has comments, users, and rating, i have to bind that rating information in the form stars according to individual user, like 1st user rated 1 so 1 star, 2nd user rated 3 so 3 star, what is the best way to achieve this.
|
|
|
|
|
|
I was asked for average rating like 3 people rated the item average may come like 1.2, 3.5 that rating i have to bind from code/jquery or any technology.
I also googled and got the links which you have given anyhow thanks for the reply.
If you come to know the average binding of rating control please reply back
Thanks
Vishwa
|
|
|
|
|
its very simple bro
enter this rating in to datbase
people have enter 2,3,4
then find average of that one select avg((2+3+4)/3)
|
|
|
|
|
calculation part is done bind that "Double" value to the control is not so simple as you saying, i tried to bind 3.5 it covering 4 *'s in the control.
|
|
|
|
|
|
Hey,
I am new with visual studio and having a problem that entries in database are not updated on crystal report plz let me knew the procedure to get connection of database with crystal report.
Regards,
Durgesh Jadhav
|
|
|
|
|
|
please let me knew how to generate crystal report for visual studio 2008
Regards,
durgesh
|
|
|
|
|
|
Plz send me the any online quiz module with code
Regards,
Durgesh
|
|
|
|