Printing datatable rows more page problemLINQ query on a DataTableHow to flush output of print function?How do I hide an element when printing a web page?What's the simplest way to print a Java array?How to use HTML to print header and footer on every printed page of a document?How to print objects of class using print()?Copy rows from one Datatable to another DataTable?How to print to stderr in Python?Validation failed for one or more entities. See 'EntityValidationErrors' property for more detailsUse PrintDocument to print each row in DataTable to seperate page

Is this more than a packing puzzle?

Accidentally deleted python and yum is not working in centos7

What is the superlative of ipse?

Is there a good program to play chess online in ubuntu?

Using two linked programs, output ordinal numbers up to n

Why do legislative committees exist?

In special relativity is mass just a measure of all other energy than kinetic?

What is the purpose of the mezuzah on the entrance to Sha'ar Tziyon?

Animal Shelter Management C++

When does Fisher's "go get more data" approach make sense?

What is this called? A tube flange bearing threaded for threaded pushrod

Why don't commercial aircraft adopt a slightly more seaplane-like design to allow safer ditching in case of emergency?

Sending a photo of my bank account card to the future employer

Draw a line nicely around notes

Will it hurt my career to work as a graphic designer in a startup for beauty and skin care?

Mathematica function equivalent to Matlab's residue function (partial fraction expansion)

Why should I cook the flour first when making bechamel sauce?

Can a polymorphed creature understand languages spoken under the effect of Tongues?

Re-negotiate salary once I earn my diploma

What are the arguments for California’s nonpartisan blanket primaries?

What impact would a dragon the size of Asia have on the environment?

What's the meaning of こそ in this sentence?

Is this artwork (used in a video game) real?

Why does FFmpeg choose 10+20+20 ms instead of an even 16 ms for 60 fps GIF images?



Printing datatable rows more page problem


LINQ query on a DataTableHow to flush output of print function?How do I hide an element when printing a web page?What's the simplest way to print a Java array?How to use HTML to print header and footer on every printed page of a document?How to print objects of class using print()?Copy rows from one Datatable to another DataTable?How to print to stderr in Python?Validation failed for one or more entities. See 'EntityValidationErrors' property for more detailsUse PrintDocument to print each row in DataTable to seperate page






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















I need to print my datatable rows.I use print document but i can't print to new page.For example i have 1000 rows in datatable.if it fits 25 lines on a page, 40 pages will appear.
I see single page on my screen.
My codes here.



int offsetY = 15;
int startY = 20;
int RowIndex = 0;
int RowCount;

RowCount = RAPORDT.Rows.Count;

PrintDocument pd = new PrintDocument();
pd.OriginAtMargins = true;
pd.DefaultPageSettings.Landscape = true;
Margins margins = new Margins(20, 20, 20, 20);
pd.DefaultPageSettings.Margins = margins;
pd.PrintPage += new PrintPageEventHandler(this.pdNormal_PrintPage);

PrintDialog printdlg = new PrintDialog();
PrintPreviewDialog printPrvDlg = new PrintPreviewDialog();
printPrvDlg.Document = pd;
printPrvDlg.ShowDialog();
printdlg.Document = pd;

private void pdNormal_PrintPage(object sender, PrintPageEventArgs e)

float pageWidth = e.PageSettings.PrintableArea.Width;
float pageHeight = e.PageSettings.PrintableArea.Height;
Font printFontNoBoldVerdanaSatir = new Font("Verdana", 7f);
Font printFontBoldVerdana = new Font("Verdana", 7f, FontStyle.Bold);
e.Graphics.DrawString("TARİH", printFontBoldVerdana, Brushes.Black, 10, 20, new StringFormat());
e.Graphics.DrawString("ÜRÜN", printFontBoldVerdana, Brushes.Black, 80, 20, new StringFormat());
e.Graphics.DrawString("CARİ", printFontBoldVerdana, Brushes.Black, 400, 20, new StringFormat());
float fontHeight = printFontNoBoldVerdanaSatir.GetHeight();
while (RowIndex < RowCount - 1)

e.HasMorePages = offsetY >= (pageHeight - 50);
if (e.HasMorePages == true)

offsetY = 15;
startY = 20;


e.Graphics.DrawString(Convert.ToDateTime(RAPORDT.Rows[RowIndex]["TARIH"].ToString()).ToString("dd.MM.yyyy"), printFontNoBoldVerdanaSatir, Brushes.Black, 10, startY + offsetY, new StringFormat());
e.Graphics.DrawString(RAPORDT.Rows[RowIndex]["STOKADI"].ToString(), printFontNoBoldVerdanaSatir, Brushes.Black, 80, startY + offsetY, new StringFormat());
e.Graphics.DrawString(RAPORDT.Rows[RowIndex]["CARIUNVAN"].ToString(), printFontNoBoldVerdanaSatir, Brushes.Black, 400, startY + offsetY, new StringFormat());

RowIndex++;
offsetY += (int)fontHeight;











share|improve this question




























    0















    I need to print my datatable rows.I use print document but i can't print to new page.For example i have 1000 rows in datatable.if it fits 25 lines on a page, 40 pages will appear.
    I see single page on my screen.
    My codes here.



    int offsetY = 15;
    int startY = 20;
    int RowIndex = 0;
    int RowCount;

    RowCount = RAPORDT.Rows.Count;

    PrintDocument pd = new PrintDocument();
    pd.OriginAtMargins = true;
    pd.DefaultPageSettings.Landscape = true;
    Margins margins = new Margins(20, 20, 20, 20);
    pd.DefaultPageSettings.Margins = margins;
    pd.PrintPage += new PrintPageEventHandler(this.pdNormal_PrintPage);

    PrintDialog printdlg = new PrintDialog();
    PrintPreviewDialog printPrvDlg = new PrintPreviewDialog();
    printPrvDlg.Document = pd;
    printPrvDlg.ShowDialog();
    printdlg.Document = pd;

    private void pdNormal_PrintPage(object sender, PrintPageEventArgs e)

    float pageWidth = e.PageSettings.PrintableArea.Width;
    float pageHeight = e.PageSettings.PrintableArea.Height;
    Font printFontNoBoldVerdanaSatir = new Font("Verdana", 7f);
    Font printFontBoldVerdana = new Font("Verdana", 7f, FontStyle.Bold);
    e.Graphics.DrawString("TARİH", printFontBoldVerdana, Brushes.Black, 10, 20, new StringFormat());
    e.Graphics.DrawString("ÜRÜN", printFontBoldVerdana, Brushes.Black, 80, 20, new StringFormat());
    e.Graphics.DrawString("CARİ", printFontBoldVerdana, Brushes.Black, 400, 20, new StringFormat());
    float fontHeight = printFontNoBoldVerdanaSatir.GetHeight();
    while (RowIndex < RowCount - 1)

    e.HasMorePages = offsetY >= (pageHeight - 50);
    if (e.HasMorePages == true)

    offsetY = 15;
    startY = 20;


    e.Graphics.DrawString(Convert.ToDateTime(RAPORDT.Rows[RowIndex]["TARIH"].ToString()).ToString("dd.MM.yyyy"), printFontNoBoldVerdanaSatir, Brushes.Black, 10, startY + offsetY, new StringFormat());
    e.Graphics.DrawString(RAPORDT.Rows[RowIndex]["STOKADI"].ToString(), printFontNoBoldVerdanaSatir, Brushes.Black, 80, startY + offsetY, new StringFormat());
    e.Graphics.DrawString(RAPORDT.Rows[RowIndex]["CARIUNVAN"].ToString(), printFontNoBoldVerdanaSatir, Brushes.Black, 400, startY + offsetY, new StringFormat());

    RowIndex++;
    offsetY += (int)fontHeight;











    share|improve this question
























      0












      0








      0








      I need to print my datatable rows.I use print document but i can't print to new page.For example i have 1000 rows in datatable.if it fits 25 lines on a page, 40 pages will appear.
      I see single page on my screen.
      My codes here.



      int offsetY = 15;
      int startY = 20;
      int RowIndex = 0;
      int RowCount;

      RowCount = RAPORDT.Rows.Count;

      PrintDocument pd = new PrintDocument();
      pd.OriginAtMargins = true;
      pd.DefaultPageSettings.Landscape = true;
      Margins margins = new Margins(20, 20, 20, 20);
      pd.DefaultPageSettings.Margins = margins;
      pd.PrintPage += new PrintPageEventHandler(this.pdNormal_PrintPage);

      PrintDialog printdlg = new PrintDialog();
      PrintPreviewDialog printPrvDlg = new PrintPreviewDialog();
      printPrvDlg.Document = pd;
      printPrvDlg.ShowDialog();
      printdlg.Document = pd;

      private void pdNormal_PrintPage(object sender, PrintPageEventArgs e)

      float pageWidth = e.PageSettings.PrintableArea.Width;
      float pageHeight = e.PageSettings.PrintableArea.Height;
      Font printFontNoBoldVerdanaSatir = new Font("Verdana", 7f);
      Font printFontBoldVerdana = new Font("Verdana", 7f, FontStyle.Bold);
      e.Graphics.DrawString("TARİH", printFontBoldVerdana, Brushes.Black, 10, 20, new StringFormat());
      e.Graphics.DrawString("ÜRÜN", printFontBoldVerdana, Brushes.Black, 80, 20, new StringFormat());
      e.Graphics.DrawString("CARİ", printFontBoldVerdana, Brushes.Black, 400, 20, new StringFormat());
      float fontHeight = printFontNoBoldVerdanaSatir.GetHeight();
      while (RowIndex < RowCount - 1)

      e.HasMorePages = offsetY >= (pageHeight - 50);
      if (e.HasMorePages == true)

      offsetY = 15;
      startY = 20;


      e.Graphics.DrawString(Convert.ToDateTime(RAPORDT.Rows[RowIndex]["TARIH"].ToString()).ToString("dd.MM.yyyy"), printFontNoBoldVerdanaSatir, Brushes.Black, 10, startY + offsetY, new StringFormat());
      e.Graphics.DrawString(RAPORDT.Rows[RowIndex]["STOKADI"].ToString(), printFontNoBoldVerdanaSatir, Brushes.Black, 80, startY + offsetY, new StringFormat());
      e.Graphics.DrawString(RAPORDT.Rows[RowIndex]["CARIUNVAN"].ToString(), printFontNoBoldVerdanaSatir, Brushes.Black, 400, startY + offsetY, new StringFormat());

      RowIndex++;
      offsetY += (int)fontHeight;











      share|improve this question














      I need to print my datatable rows.I use print document but i can't print to new page.For example i have 1000 rows in datatable.if it fits 25 lines on a page, 40 pages will appear.
      I see single page on my screen.
      My codes here.



      int offsetY = 15;
      int startY = 20;
      int RowIndex = 0;
      int RowCount;

      RowCount = RAPORDT.Rows.Count;

      PrintDocument pd = new PrintDocument();
      pd.OriginAtMargins = true;
      pd.DefaultPageSettings.Landscape = true;
      Margins margins = new Margins(20, 20, 20, 20);
      pd.DefaultPageSettings.Margins = margins;
      pd.PrintPage += new PrintPageEventHandler(this.pdNormal_PrintPage);

      PrintDialog printdlg = new PrintDialog();
      PrintPreviewDialog printPrvDlg = new PrintPreviewDialog();
      printPrvDlg.Document = pd;
      printPrvDlg.ShowDialog();
      printdlg.Document = pd;

      private void pdNormal_PrintPage(object sender, PrintPageEventArgs e)

      float pageWidth = e.PageSettings.PrintableArea.Width;
      float pageHeight = e.PageSettings.PrintableArea.Height;
      Font printFontNoBoldVerdanaSatir = new Font("Verdana", 7f);
      Font printFontBoldVerdana = new Font("Verdana", 7f, FontStyle.Bold);
      e.Graphics.DrawString("TARİH", printFontBoldVerdana, Brushes.Black, 10, 20, new StringFormat());
      e.Graphics.DrawString("ÜRÜN", printFontBoldVerdana, Brushes.Black, 80, 20, new StringFormat());
      e.Graphics.DrawString("CARİ", printFontBoldVerdana, Brushes.Black, 400, 20, new StringFormat());
      float fontHeight = printFontNoBoldVerdanaSatir.GetHeight();
      while (RowIndex < RowCount - 1)

      e.HasMorePages = offsetY >= (pageHeight - 50);
      if (e.HasMorePages == true)

      offsetY = 15;
      startY = 20;


      e.Graphics.DrawString(Convert.ToDateTime(RAPORDT.Rows[RowIndex]["TARIH"].ToString()).ToString("dd.MM.yyyy"), printFontNoBoldVerdanaSatir, Brushes.Black, 10, startY + offsetY, new StringFormat());
      e.Graphics.DrawString(RAPORDT.Rows[RowIndex]["STOKADI"].ToString(), printFontNoBoldVerdanaSatir, Brushes.Black, 80, startY + offsetY, new StringFormat());
      e.Graphics.DrawString(RAPORDT.Rows[RowIndex]["CARIUNVAN"].ToString(), printFontNoBoldVerdanaSatir, Brushes.Black, 400, startY + offsetY, new StringFormat());

      RowIndex++;
      offsetY += (int)fontHeight;








      c# printing datatable printdocument printdialog






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 26 at 7:24









      Developer007Developer007

      297 bronze badges




      297 bronze badges






















          0






          active

          oldest

          votes










          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55351741%2fprinting-datatable-rows-more-page-problem%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes




          Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.







          Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.



















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55351741%2fprinting-datatable-rows-more-page-problem%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

          Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

          Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript