Click here to Skip to main content
16,020,315 members
Home / Discussions / C#
   

C#

 
AnswerRe: How to compare the next/previous items in List in C# using linq Pin
Richard Deeming30-Jul-14 7:11
mveRichard Deeming30-Jul-14 7:11 
AnswerRe: How to compare the next/previous items in List in C# using linq Pin
Member 109862521-Aug-14 8:26
Member 109862521-Aug-14 8:26 
QuestionExtract text from PDF in C# using Mupdf library Pin
tmiklos6730-Jul-14 1:19
tmiklos6730-Jul-14 1:19 
AnswerRe: Extract text from PDF in C# using Mupdf library Pin
Ravi Bhavnani30-Jul-14 4:31
professionalRavi Bhavnani30-Jul-14 4:31 
GeneralRe: Extract text from PDF in C# using Mupdf library Pin
tmiklos6730-Jul-14 22:32
tmiklos6730-Jul-14 22:32 
QuestionRe: Extract text from PDF in C# using Mupdf library Pin
Richard MacCutchan30-Jul-14 5:14
mveRichard MacCutchan30-Jul-14 5:14 
AnswerRe: Extract text from PDF in C# using Mupdf library Pin
tmiklos6730-Jul-14 22:25
tmiklos6730-Jul-14 22:25 
Questionwant to export to word with text color and logo image in a single doc file through c# windows application Pin
VIVEK KUMAR PAL30-Jul-14 1:14
VIVEK KUMAR PAL30-Jul-14 1:14 
SQL
My email is:- vivek.1370@gmail.com
And second iemail is:- vivekpalmailbox@gmail.com






private void ExportToWord()
{
int s1;
for(s1=0;s1<3;s1++)

{

string strForPrint = "";

//first student detail
strForPrint += " S.J.S. PUBLIC SCHOOL" + "\n";
strForPrint += "An English Medium Co-educational School Based on C.B.S.E. Curriculum" + "\n\n\n\n\n";
pic_logo_sjs.Image.Save("E:\\myimage\\myimage.jpg", System.Drawing.Imaging.ImageFormat.Jpeg);
Word.Application wordApp = new Word.Application();
wordApp.Visible = false;
Word.Document doc = wordApp.Documents.Add();
doc.InlineShapes.AddPicture("E:\\myimage\\myimage.doc");
// strForPrint += richTextBox1.Text + "\r\n";
strForPrint += " REPORT BOOK" + "\n";
strForPrint += " Session 2014-2015" + "\n\n";
strForPrint += "Student Name : " + txt_stu_name.Text + "\r\t\r\t\r\t";
strForPrint += "Roll No : " + txt_roll.Text + "\n\n";
strForPrint += "Class : " + txt_class.Text + "\t";
strForPrint += "Section : " + txt_section.Text + "\t";
strForPrint += "Scholar No : " + txt_scholar.Text + "\r\n\r\n\r\n";
strForPrint += "Date Of Birth : " + txt_dob.Text + "\r\n\r\n\r\n";
strForPrint += "Mother's Name : " + txt_mother.Text + "\r\n\r\n\r\n";
strForPrint += "Father's Name : " + txt_father.Text + "\r\n\r\n\r\n";
strForPrint += "Address : " + txt_address.Text + "\r\n\r\n\r\n\n\n\n\n";
strForPrint += "Tear here line-----------------------------------------------------------" + "\r\n";

//second student detail
strForPrint += " S.J.S. PUBLIC SCHOOL" + "\n";
strForPrint += "An English Medium Co-educational School Based on C.B.S.E. Curriculum" + "\n\n\n\n\n";
strForPrint += " REPORT BOOK" + "\n";
strForPrint += " Session 2014-2015" + "\n\n";
strForPrint += "Student Name : " + txt_name1.Text + "\t\t\t";
strForPrint += "Roll No : " + txt_roll1.Text + "\r\n\r\n";
strForPrint += "Class : " + txt_class1.Text + "\r\t";
strForPrint += "Section : " + txt_section1.Text + "\r\t";
strForPrint += "Scholar No : " + txt_scholar1.Text + "\r\n\r\n\r\n";
strForPrint += "Date Of Birth : " + txt_dob1.Text + "\r\n\r\n\r\n";
strForPrint += "Mother's Name : " + txt_mother1.Text + "\r\n\r\n\r\n";
strForPrint += "Father's Name : " + txt_father1.Text + "\r\n\r\n\r\n";
strForPrint += "Address : " + txt_address1.Text + "\r\n\n";

//First student marks

strForPrint += Exam_I_Term.Text + "\n\n";
strForPrint += "\r\t\r\t" + label1.Text + "\n\n";
strForPrint += lbl_sub.Text + "\r\t" + lbl_english.Text + "\r\t" + lbl_evs.Text + "\r\t" + lbl_hindi.Text + "\r\t" + lbl_math.Text + "\r\t" + lbl_total_marks.Text + "\r\t\n\n";
strForPrint += lbl_marks.Text + "\r\t\r" + lbl_fa_1_english.Text + "\r\t\r\t" + lbl_fa_1_evs.Text + "\r\t\r\t" + lbl_fa_1_hindi.Text + "\r\t\r\t" + lbl_fa_1_math.Text + "\r\t\r\t" + lbl_fa_1_total.Text + "\r\t\r\t\n\n";
strForPrint += lbl_grade.Text + "\r\t\r\t\r\t\r\t\r\t\r\t\r\t\r\t\r\t\r\t" + lbl_fa_1_grade.Text + "\r\n\n";
strForPrint += lbl_attendance.Text + "\r\t\r\t\r\t\r\t\r\t\r\t\r\t\r\t\r\t" + lbl_fa_1_attendance.Text + "\r\n\n\n\n";
strForPrint += lbl_dash_teacher.Text + "\r\t\r\t\r\t\r\t\r\t\r\t" + lbl_dash_principal.Text + "\r\n";
strForPrint += lbl_teacher_signature.Text + "\r\t\r\t\r\t\r\t\r\t\r\t" + lbl_principal_signature.Text + "\r\n\n\n";
strForPrint += "\r\t\r\t\r\t\r\t" + lbl_grading_norm_index.Text + "\r\n\n";
strForPrint += lbl_A_outstainding.Text + "" + lbl_B_Excellent.Text + "" + lbl_C_very_good.Text+ "\r\n\r\n";
strForPrint += lbl_D_good.Text + "\r\t\r\t\r\t" + label3.Text + "\r\n\n\n\n\n\n\n";

//second student marks
strForPrint += Exam_I_Term1.Text + "\n\n";
strForPrint += "\r\t\r\t" + label1_1.Text + "\n\n";
strForPrint += lbl_sub1.Text + "\r\t" + lbl_english1.Text + "\r\t" + lbl_evs1.Text + "\r\t" + lbl_hindi1.Text + "\r\t" + lbl_math1.Text + "\r\t" + lbl_total_marks1.Text + "\r\t\n\n";
strForPrint += lbl_marks1.Text + "\r\t\r" + lbl_fa_1_english1.Text + "\r\t\r\t" + lbl_fa_1_evs1.Text + "\r\t\r\t" + lbl_fa_1_hindi1.Text + "\r\t\r\t" + lbl_fa_1_math1.Text + "\r\t\r\t" + lbl_fa_1_total1.Text + "\r\t\r\t\n\n";
strForPrint += lbl_grade1.Text + "\r\t\r\t\r\t\r\t\r\t\r\t\r\t\r\t\r\t\r\t" + lbl_fa_1_grade1.Text + "\r\n\n";
strForPrint += lbl_attendance1.Text + "\r\t\r\t\r\t\r\t\r\t\r\t\r\t\r\t\r\t" + lbl_fa_1_attendance1.Text + "\r\n\n\n\n";
strForPrint += lbl_dash_teacher1.Text + "\r\t\r\t\r\t\r\t\r\t\r\t" + lbl_dash_principal1.Text + "\r\n";
strForPrint += lbl_teacher_signature1.Text + "\r\t\r\t\r\t\r\t\r\t\r\t" + lbl_principal_signature1.Text + "\r\n\n\n";
strForPrint += "\r\t\r\t\r\t\r\t" + lbl_grading_norm_index1.Text+ "\r\n\n";
strForPrint += lbl_A_outstainding1.Text + "\r\t" + lbl_B_Excellent1.Text + "\r\t" + lbl_C_very_good1.Text + "\r\n\r\n";
strForPrint += lbl_D_good1.Text + "\r\t\r\t\r\t" + label3.Text + "\r\n\n";

label2.Text = "hello.......";
label2.ForeColor = Color.Green;

Encoding utf16 = Encoding.GetEncoding(1254);


byte[] output = utf16.GetBytes(strForPrint);


FileStream fs = new FileStream(sfd.FileName, FileMode.Create);

BinaryWriter bw = new BinaryWriter(fs);

bw.Write(output, 0, output.Length); //write data into file

bw.Flush();

bw.Close();

fs.Close();

}
}




private void button1_Click(object sender, EventArgs e)
{
sfd.Filter = "Word Documents (*.doc)|*.doc";

if (sfd.ShowDialog() == DialogResult.OK)
{

ExportToWord();

}

}
QuestionRe: want to export to word with text color and logo image in a single doc file through c# windows application Pin
ZurdoDev30-Jul-14 2:01
professionalZurdoDev30-Jul-14 2:01 
AnswerRe: want to export to word with text color and logo image in a single doc file through c# windows application Pin
Dave Kreskowiak30-Jul-14 2:55
mveDave Kreskowiak30-Jul-14 2:55 
QuestionMouse event Handling [SOLVED] Pin
V.29-Jul-14 23:18
professionalV.29-Jul-14 23:18 
AnswerRe: Mouse event Handling Pin
OriginalGriff29-Jul-14 23:35
mveOriginalGriff29-Jul-14 23:35 
GeneralRe: Mouse event Handling Pin
V.29-Jul-14 23:39
professionalV.29-Jul-14 23:39 
AnswerRe: Mouse event Handling [SOLVED] Pin
Mycroft Holmes30-Jul-14 0:20
professionalMycroft Holmes30-Jul-14 0:20 
GeneralRe: Mouse event Handling [SOLVED] Pin
V.30-Jul-14 0:24
professionalV.30-Jul-14 0:24 
QuestionGoogle Drive files and folders listing in asp.net web application using c# and Google Apis Pin
NIYAS PK29-Jul-14 20:04
NIYAS PK29-Jul-14 20:04 
AnswerRe: Google Drive files and folders listing in asp.net web application using c# and Google Apis Pin
Pete O'Hanlon29-Jul-14 20:49
mvePete O'Hanlon29-Jul-14 20:49 
QuestionWhat options do I have for reading data from an excel spreadsheet, and what are the limitations of each? Pin
agent15429-Jul-14 15:05
agent15429-Jul-14 15:05 
AnswerRe: What options do I have for reading data from an excel spreadsheet, and what are the limitations of each? Pin
PIEBALDconsult29-Jul-14 15:14
mvePIEBALDconsult29-Jul-14 15:14 
AnswerRe: What options do I have for reading data from an excel spreadsheet, and what are the limitations of each? Pin
SledgeHammer0129-Jul-14 18:09
SledgeHammer0129-Jul-14 18:09 
GeneralRe: What options do I have for reading data from an excel spreadsheet, and what are the limitations of each? Pin
Mycroft Holmes29-Jul-14 19:18
professionalMycroft Holmes29-Jul-14 19:18 
AnswerRe: What options do I have for reading data from an excel spreadsheet, and what are the limitations of each? Pin
Bernhard Hiller29-Jul-14 20:34
Bernhard Hiller29-Jul-14 20:34 
AnswerRe: What options do I have for reading data from an excel spreadsheet, and what are the limitations of each? Pin
Richard Deeming30-Jul-14 1:33
mveRichard Deeming30-Jul-14 1:33 
AnswerRe: What options do I have for reading data from an excel spreadsheet, and what are the limitations of each? Pin
jschell31-Jul-14 9:29
jschell31-Jul-14 9:29 
Questionstack / heap assignment under the hood Pin
taking_liberties29-Jul-14 4:06
taking_liberties29-Jul-14 4: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.