Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7945687
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T00:56:37+00:00 2026-06-04T00:56:37+00:00

I have a one-to-many like array. Structure example: [ [ InvoiceID, [ InvoiceEntry1_label, InvoiceEntry2_label

  • 0

I have a one-to-many like array.

Structure example:

 [
   [
    InvoiceID,
    [
      InvoiceEntry1_label,
      InvoiceEntry2_label
    ],
    [
      InvoiceEntry1_value,
      InvoiceEntry2_value
    ],
    Total
   ],
   [
    InvoiceID,
    [
      InvoiceEntry1_label,
      InvoiceEntry2_label
    ],
    [
      InvoiceEntry1_value,
      InvoiceEntry2_value
    ],
    Total
   ],
   and so on
 ]

How can I group rows using PHPExcel, such that after sorting in Excel, rows which belong to an Invoice will stick together?

Do not confuse with Excel outlining and grouping functionality, for which rows won’t stick together after sort.

I already know how to use PHPExcel. A simple example or a documentation reference will do as an answer. I couldn’t find one myself.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T00:56:38+00:00Added an answer on June 4, 2026 at 12:56 am

    In Excel this can only be done using Pivot Tables like this:

    • worksheet with source data, with all rows expanded to the “many” part (for example InvoiceID would be copied for each row);
    • pivot table
      • in the pivot fields list, all columns are placed in the “Row Labels” section, with no columns in the other 3 sections (Report Filter, Values, Column Labels); optionally, only fields from the “many” part (of the one-to-many relation) can be moved to the Values section;
      • right clicked each field, field settings, set “Subtotals” to “none”
      • right clicked each field, field settings, set “Layout” to “Show item labels in tabular form”
      • moved all fields from the “many” part to be last in order;

    The above enabled sticking of rows after sorting and also filtering, with a really nice looking one-to-many representation (where the many part is splitting the current rows into child rows).

    PHPExcel does not yet support Pivot Tables at all (“Codeplex: Implement pivot tables”), so the above Excel Pivot Table cannot be created, edited or read using PHPExcel.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Suppose I have a simple multidimensional structure, like this one: somestr<-array(sample.int(2, 120, replace=TRUE), dim=c(4,5,6))
I've got a class with many string arrays. I'd like to have one generic
I have a simple one-to-many relationship. I would like to select rows from the
I have an XML file which has many section like the one below: <Operations>
I have this dilemma many times - and I would like one time and
I have a file with many lines in it. One of them look like
I have a favorite table containing some fields like login_id,driver_id(One login_id may have many
I have two Doctrine entities that have a one-to-many relationship, like this: License class
my issue lokks similar to this one: (link) but i have one-to-many association: <set
I have one package contains many Stored Procedure for populating diffrent tables. This package

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.