Click here to Skip to main content
15,909,652 members
Home / Discussions / C#
   

C#

 
GeneralRe: How do I get a datagrid to only show certain columns from a dataset? Pin
darkelv22-Jun-10 1:42
darkelv22-Jun-10 1:42 
AnswerRe: How do I get a datagrid to only show certain columns from a dataset? Pin
darkelv22-Jun-10 1:33
darkelv22-Jun-10 1:33 
GeneralRe: How do I get a datagrid to only show certain columns from a dataset? Pin
Terence van Schalkwyk22-Jun-10 1:42
Terence van Schalkwyk22-Jun-10 1:42 
AnswerRe: How do I get a datagrid to only show certain columns from a dataset? Pin
Bigdeak22-Jun-10 1:47
Bigdeak22-Jun-10 1:47 
QuestionXmlDocument.Save() throws expection when file name is containing colon ":". Pin
Piyush Vaishnav21-Jun-10 23:33
Piyush Vaishnav21-Jun-10 23:33 
AnswerRe: XmlDocument.Save() throws expection when file name is containing colon ":". Pin
Pete O'Hanlon21-Jun-10 23:42
mvePete O'Hanlon21-Jun-10 23:42 
AnswerRe: XmlDocument.Save() throws expection when file name is containing colon ":". Pin
freakyit22-Jun-10 0:40
freakyit22-Jun-10 0:40 
QuestionModfying Print Document Pin
Emmet_Brown21-Jun-10 23:13
Emmet_Brown21-Jun-10 23:13 
Hi everyone;

I want to add some information on my print document.
To be precise

I'm printing my DataGridView like this:


private void button5_Click(object sender, EventArgs e)//YAZDIR
        {
            if (SetupThePrinting())
                MyPrintDocument.Print();
        }


private bool SetupThePrinting()
        {
            PrintDialog MyPrintDialog = new PrintDialog();
            MyPrintDialog.AllowCurrentPage = false;
            MyPrintDialog.AllowPrintToFile = false;
            MyPrintDialog.AllowSelection = false;
            MyPrintDialog.AllowSomePages = false;
            MyPrintDialog.PrintToFile = false;
            MyPrintDialog.ShowHelp = false;
            MyPrintDialog.ShowNetwork = false;

            if (MyPrintDialog.ShowDialog() != DialogResult.OK)
                return false;

            MyPrintDocument.DocumentName = "Customers Report";
            MyPrintDocument.PrinterSettings = MyPrintDialog.PrinterSettings;
            MyPrintDocument.DefaultPageSettings = MyPrintDialog.PrinterSettings.DefaultPageSettings;
            MyPrintDocument.DefaultPageSettings.Margins = new Margins(40, 40, 40, 40);

            if (MessageBox.Show("Verilerin sayfaya ortalanmasını istiyor musunuz?", "Baskı Özellikleri - Sayfa Ortalama", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                MyDataGridViewPrinter = new DataGridViewPrinter(dbGridView, MyPrintDocument, true, true, "KASA DÖKÜMÜ\n\nbakiye:"+label17.Text+" gelir:"+label19.Text+" gider:"+label18.Text+"", new Font("Tahoma", 10, FontStyle.Bold, GraphicsUnit.Point), Color.Black, true);
            else
                MyDataGridViewPrinter = new DataGridViewPrinter(dbGridView, MyPrintDocument, false, true, "KASA DÖKÜMÜ\n\nbakiye:"+label17.Text+" gelir:"+label19.Text+" gider:"+label18.Text+"", new Font("Tahoma", 10, FontStyle.Bold, GraphicsUnit.Point), Color.Black, true);

            return true;
        }


So, I need to make two changes:

1. I need to add a line to the end of the document to put the information on my label#'s, how to put this line properly ( if possible such as: "The information is" +label7.text+ " format)

2. Because of the number of columns, my document prints 6 pages for a 3-paged information. also uses first 3 pages for first 4 columns, and the last 3 pages for the rest of the columns. Reducing the character size in the print document could be a solution, but I don't know how to do that either.


Can anybody PLEASE help Frown | :( ?
AnswerMessage Closed Pin
21-Jun-10 23:27
stancrm21-Jun-10 23:27 
GeneralRe: Modfying Print Document Pin
Emmet_Brown22-Jun-10 0:03
Emmet_Brown22-Jun-10 0:03 
AnswerRe: Modfying Print Document Pin
Emmet_Brown22-Jun-10 1:12
Emmet_Brown22-Jun-10 1:12 
QuestionRun a script on a linux box from Windows OS using windows-form written in C# Pin
ksaw12321-Jun-10 20:57
ksaw12321-Jun-10 20:57 
AnswerRe: Run a script on a linux box from Windows OS using windows-form written in C# Pin
Łukasz Nowakowski21-Jun-10 21:29
Łukasz Nowakowski21-Jun-10 21:29 
AnswerRe: Run a script on a linux box from Windows OS using windows-form written in C# Pin
Bernhard Hiller22-Jun-10 2:27
Bernhard Hiller22-Jun-10 2:27 
GeneralRe: Run a script on a linux box from Windows OS using windows-form written in C# Pin
Dave Kreskowiak22-Jun-10 3:54
mveDave Kreskowiak22-Jun-10 3:54 
QuestionExcel Exception from HRESULT: 0x800AC472 Pin
KaurGurpreet21-Jun-10 20:45
KaurGurpreet21-Jun-10 20:45 
AnswerMessage Closed Pin
21-Jun-10 22:29
stancrm21-Jun-10 22:29 
GeneralRe: Excel Exception from HRESULT: 0x800AC472 Pin
KaurGurpreet24-Jun-10 20:02
KaurGurpreet24-Jun-10 20:02 
Questionhow do i turn my usb into an U3 smart drive Pin
edward remo21-Jun-10 18:38
edward remo21-Jun-10 18:38 
AnswerRe: how do i turn my usb into an U3 smart drive Pin
DaveyM6921-Jun-10 21:17
professionalDaveyM6921-Jun-10 21:17 
Questionneed help...(urgent) Pin
Ice_Freez0521-Jun-10 16:17
Ice_Freez0521-Jun-10 16:17 
AnswerRe: need help...(urgent) Pin
Mycroft Holmes21-Jun-10 17:48
professionalMycroft Holmes21-Jun-10 17:48 
AnswerRe: need help...(urgent) Pin
Roger Wright21-Jun-10 17:52
professionalRoger Wright21-Jun-10 17:52 
AnswerRe: need help...(urgent) Pin
Abhinav S21-Jun-10 18:30
Abhinav S21-Jun-10 18:30 
AnswerRe: need help...(urgent) Pin
yu-jian27-Jun-10 9:58
yu-jian27-Jun-10 9:58 

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.