Click here to Skip to main content
15,920,576 members
Home / Discussions / C#
   

C#

 
GeneralRe: go to next Pin
Colin Angus Mackay12-Jan-09 11:29
Colin Angus Mackay12-Jan-09 11:29 
GeneralRe: go to next Pin
EliottA12-Jan-09 11:23
EliottA12-Jan-09 11:23 
AnswerRe: go to next Pin
Wendelius12-Jan-09 11:31
mentorWendelius12-Jan-09 11:31 
GeneralRe: go to next Pin
abu rakan12-Jan-09 11:50
abu rakan12-Jan-09 11:50 
GeneralRe: go to next Pin
Wendelius12-Jan-09 12:05
mentorWendelius12-Jan-09 12:05 
QuestionC# application to parse a sharepoint list Pin
pippyn12-Jan-09 8:14
pippyn12-Jan-09 8:14 
AnswerRe: C# application to parse a sharepoint list Pin
Not Active12-Jan-09 8:37
mentorNot Active12-Jan-09 8:37 
QuestionInsert a Page Break In word Using C# Pin
vikram_asv12-Jan-09 7:57
vikram_asv12-Jan-09 7:57 
Hello I am looking for how to insert a page break in msword using C#. what I need is i have a textfile i want to read the textfile line by line and send it to one table i am able to do that one and then i want to fetch the data from that table and export to word up to this i can achieve it but what i need when ever i found certain text (ex:- programme ) and i need a page break and start on new document . I am not getting any idea i am searching in google but no luck could any one give us some example greatly appreciated. i am putting my code how i am exporting to ms word . I made a dll for word this is my code on button click

public void Exporttoword_Click(object sender, EventArgs e)
{

WORDDLL.WORDDLL wordApp = new WORDDLL.WORDDLL();
//Microsoft.Office.Interop.Word.Application Word = new Microsoft.Office.Interop.Word.Application();
//Microsoft.Office.Interop.Word. Word = new Microsoft.Office.Interop.Word._Document();
DataSet ds = SelectScAppRepository();
string sbContent = "";
sbContent = wordApp.Exporttoword(ds);

Response.Clear();
Response.AddHeader("contentdisposition", "attachment;filename=FileName.doc");
Response.Charset = "";
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.ContentType = "application/vnd.word";
Response.Write(sbContent.ToString());
Response.End();


}



THIS IS MY DLL CODE:-

using System.Configuration;
using System.Web;
using System.Data.OleDb;
using System.IO;
using System.Data.OracleClient;
using System.Text;

namespace WORDDLL
{
public class WORDDLL
{
public String Exporttoword(DataSet ds)
{

System.IO.StringWriter excelDoc;

// if (File.Exists(fileName)) File.Delete(fileName);

excelDoc = new System.IO.StringWriter();

StringBuilder sbContent = new StringBuilder();

for (int x = 0; x < ds.Tables[0].Columns.Count; x++)
{

sbContent.Append(" " + ds.Tables[0].Columns[x].ColumnName + " ");
}
sbContent.Append(" \r\n");

//Insert the page break.....when it read CUSTOMER SERVICE WORKSHEET




for (int i = 0; i <= ds.Tables[0].Rows.Count - 1; i++)
{
for (int j = 0; j <= ds.Tables[0].Columns.Count - 1; j++)
{

sbContent.Append(" " + ds.Tables[0].Rows[i][j].ToString() + " ");
}
sbContent.Append("\r\n");



}
return sbContent.ToString();

}
}
}
AnswerRe: Insert a Page Break In word Using C# Pin
Jimmanuel12-Jan-09 9:38
Jimmanuel12-Jan-09 9:38 
QuestionGeneric event, or raise event based on generic type. Pin
DaveyM6912-Jan-09 7:23
professionalDaveyM6912-Jan-09 7:23 
AnswerRe: Generic event, or raise event based on generic type. Pin
Gideon Engelberth12-Jan-09 8:46
Gideon Engelberth12-Jan-09 8:46 
GeneralRe: Generic event, or raise event based on generic type. Pin
DaveyM6912-Jan-09 8:52
professionalDaveyM6912-Jan-09 8:52 
GeneralRe: Generic event, or raise event based on generic type. Pin
Gideon Engelberth12-Jan-09 11:58
Gideon Engelberth12-Jan-09 11:58 
AnswerRe: Generic event, or raise event based on generic type. Pin
S. Senthil Kumar12-Jan-09 9:55
S. Senthil Kumar12-Jan-09 9:55 
GeneralRe: Generic event, or raise event based on generic type. Pin
DaveyM6912-Jan-09 10:07
professionalDaveyM6912-Jan-09 10:07 
GeneralRe: Generic event, or raise event based on generic type. Pin
Mark Churchill12-Jan-09 16:45
Mark Churchill12-Jan-09 16:45 
GeneralRe: Generic event, or raise event based on generic type. Pin
S. Senthil Kumar12-Jan-09 18:40
S. Senthil Kumar12-Jan-09 18:40 
GeneralRe: Generic event, or raise event based on generic type. Pin
Mark Churchill12-Jan-09 19:01
Mark Churchill12-Jan-09 19:01 
QuestionRe: Generic event, or raise event based on generic type. Pin
Wendelius12-Jan-09 11:16
mentorWendelius12-Jan-09 11:16 
AnswerRe: Generic event, or raise event based on generic type. [modified] Pin
DaveyM6912-Jan-09 22:58
professionalDaveyM6912-Jan-09 22:58 
GeneralRe: Generic event, or raise event based on generic type. Pin
Wendelius13-Jan-09 9:47
mentorWendelius13-Jan-09 9:47 
GeneralRe: Generic event, or raise event based on generic type. Pin
DaveyM6914-Jan-09 0:23
professionalDaveyM6914-Jan-09 0:23 
GeneralRe: Generic event, or raise event based on generic type. Pin
Wendelius14-Jan-09 2:30
mentorWendelius14-Jan-09 2:30 
GeneralRe: Generic event, or raise event based on generic type. Pin
DaveyM6914-Jan-09 3:25
professionalDaveyM6914-Jan-09 3:25 
GeneralRe: Generic event, or raise event based on generic type. Pin
Wendelius14-Jan-09 3:42
mentorWendelius14-Jan-09 3:42 

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.