Code Monkey home page Code Monkey logo

Comments (7)

fediachov avatar fediachov commented on May 18, 2024 1

Hi,

You can check the count of available rows and make the page brake from a code: table.PageBreak();
For example:

      int rowIndex = 0;
      while (rowData.HasMoreRows)
      {
        // print the table body  
        Table1.PrintRow(1);
        Table1.PrintColumns();        
        // check for table footer for last page
        if (rowData.RowCount - rowIndex < 3)
        {
          Table1.PageBreak();
          rowIndex = 0;
        }
        else
          rowIndex++;
        // go next data source row
        rowData.Next();        
      }

from fastreport.

Detrav avatar Detrav commented on May 18, 2024

Hi, in your report the data cell is Cell4, not Cell6, so you should use [Sum(Cell4)].

from fastreport.

githubfanster avatar githubfanster commented on May 18, 2024

Thank you. That Worked.
How do I get the Table Header to get printed repeatedly for each new page?

In the designer, Table1 PrintOn property has RepeatedBand checked, in my SCriptCode,
i added:
// printing the table header

  Cell1.PrintOn = PrintOn.RepeatedBand; //added
  Cell2.PrintOn = PrintOn.RepeatedBand; //added
  Table1.PrintRow(0);
  Table1.PrintColumns();

Couldn't get it to work.

Thanks for helping!
HowToGetTableColumnHeadersToPrintRepeatedlyOnEachPage.zip
HowToGetTableColumnHeadersToPrintRepeatedlyOnEachPage.zip

from fastreport.

githubfanster avatar githubfanster commented on May 18, 2024

sorry didnt mean to close this issue yet.
i guess i dont understand what this means:

https://www.fast-report.com/en/forum/index.php?showtopic=11079

Tablecell have printon property. This may work.

TableCell tc
tc.PrintOn = PrintOn.RepeatedBand;

also band must have repeat on every page checked.

in my template, Table1.RepeatHeaders is set to true

from fastreport.

Detrav avatar Detrav commented on May 18, 2024

The tc.PrintOn (Gets or sets a value that determines where to print the object.) property is not related to the repetition of the table header.

Use the following code:

table.RepeatHeaders = true;
table.FixedRows = 1; // for repeat only first row on every page

from fastreport.

githubfanster avatar githubfanster commented on May 18, 2024

thanks. that worked. now i may have a different problem.

in the last page, i get only the table header and table footer printed with no data in between because there's no more data.

so it looks like this:

Name Price
Total: 2345678.90

Can I do better than this? Just wondering :-)

Any conditional capabilities I could explore?

Thank you so much for helping a newbie!

from fastreport.

githubfanster avatar githubfanster commented on May 18, 2024

thank you for the tip!

from fastreport.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.