Click here to Skip to main content
15,890,690 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: Generate PDF documents from a HTML page using ASP.NET Pin
Bernhard Hiller31-Jul-13 22:35
Bernhard Hiller31-Jul-13 22:35 
GeneralRe: Generate PDF documents from a HTML page using ASP.NET Pin
GopalakrishnanPS1-Aug-13 2:15
GopalakrishnanPS1-Aug-13 2:15 
GeneralRe: Generate PDF documents from a HTML page using ASP.NET Pin
Bernhard Hiller1-Aug-13 3:50
Bernhard Hiller1-Aug-13 3:50 
GeneralRe: Generate PDF documents from a HTML page using ASP.NET Pin
GopalakrishnanPS1-Aug-13 5:06
GopalakrishnanPS1-Aug-13 5:06 
QuestionManually handling ASP.NET sessions Pin
Desmond Lim31-Jul-13 15:32
Desmond Lim31-Jul-13 15:32 
Question3-layer application Pin
larsp77731-Jul-13 9:28
larsp77731-Jul-13 9:28 
SuggestionRe: 3-layer application Pin
Richard MacCutchan31-Jul-13 21:05
mveRichard MacCutchan31-Jul-13 21:05 
Questionxslt template for creating excel file with multiple worksheets Pin
kanniga31-Jul-13 2:01
kanniga31-Jul-13 2:01 
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();

}
AnswerRe: xslt template for creating excel file with multiple worksheets Pin
kanniga1-Aug-13 0:45
kanniga1-Aug-13 0:45 
QuestionPrint to serial port printer from the browser (asp.net web app:) Pin
sk_ko30-Jul-13 15:26
sk_ko30-Jul-13 15:26 
AnswerRe: Print to serial port printer from the browser (asp.net web app:) Pin
Ron Beyer30-Jul-13 15:47
professionalRon Beyer30-Jul-13 15:47 
QuestionASP.NET CMS recommendation for a small website Pin
devenv.exe30-Jul-13 4:16
professionaldevenv.exe30-Jul-13 4:16 
AnswerRe: ASP.NET CMS recommendation for a small website Pin
Rahul Rajat Singh31-Jul-13 0:25
professionalRahul Rajat Singh31-Jul-13 0:25 
AnswerRe: ASP.NET CMS recommendation for a small website Pin
Jahanzaib Rahman1-Aug-13 21:05
Jahanzaib Rahman1-Aug-13 21:05 
AnswerRe: ASP.NET CMS recommendation for a small website Pin
Dusara Maulik12-Aug-13 9:40
Dusara Maulik12-Aug-13 9:40 
GeneralMessage Removed Pin
30-Jul-13 3:55
professionaldevenv.exe30-Jul-13 3:55 
QuestionAutomate OAuth2 Pin
y_chen30-Jul-13 3:12
y_chen30-Jul-13 3:12 
Questiontreeview in asp.net Pin
RajivRanjan Yadav30-Jul-13 2:24
RajivRanjan Yadav30-Jul-13 2:24 
AnswerRe: treeview in asp.net Pin
Vani Kulkarni30-Jul-13 20:08
professionalVani Kulkarni30-Jul-13 20:08 
Questionasp.net Pin
Sumathi Sivaraj30-Jul-13 2:05
Sumathi Sivaraj30-Jul-13 2:05 
AnswerRe: asp.net Pin
Vani Kulkarni30-Jul-13 20:11
professionalVani Kulkarni30-Jul-13 20:11 
QuestionRating list Binding Pin
VishwaKL30-Jul-13 0:21
VishwaKL30-Jul-13 0:21 
AnswerRe: Rating list Binding Pin
Dholakiya Ankit10-Sep-13 1:54
Dholakiya Ankit10-Sep-13 1:54 
GeneralRe: Rating list Binding Pin
VishwaKL10-Sep-13 16:53
VishwaKL10-Sep-13 16:53 
GeneralRe: Rating list Binding Pin
Dholakiya Ankit10-Sep-13 17:06
Dholakiya Ankit10-Sep-13 17:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.