LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Table pagination

Sup guys,

 

I am trying to do a multi-page table in a pdf report. My table consists of a 2d array of strings but when it gets to be over 30 rows I need to put the excess on another page. I thought it would work to add a dimenson to the array for each page that way I could feed the paged table to a for loop in which I'd pdf the table and newpage for each page of 30 rows except for the last page that would have the remainder. The problem is that adding the 3rd dim to the array automatically fills the last page remainder with default data so that i get 30 rows even though the remainder is less than that. How can I fix this empty row problem? Is there a better approach?

 

 

Table Page Data Generator.jpg

 

Table Pages for loop.jpg

0 Kudos
Message 1 of 4
(2,463 Views)

You can't.  Because you are converting the 2-D array to a 3-D array, each page of the 3-D array has to be the same size.

 

Depending on how you need to use the 3-D array later on, you might be able to have a 1-D array of clusters.  Where the cluster contains a single item that is a 2-D string array.  That way each 2-D array can be a page, and the array of clusters would allow you to have different sizes of 2-D arrays in each cluster.

Message 2 of 4
(2,446 Views)

dd

------------------------------------------------------------------------------------------------------
"Everything should be made as simple as possible but no simpler"
0 Kudos
Message 3 of 4
(2,438 Views)

Hi Viper,

 

You should do what Ravens has suggested. Build an array of clusters, each cluster containing a 2d array that can be displayed on a page. I have attached an example, simplifying some or your original code:

 

Table Pagination.png

 

The last for loop is meant to simulate your pdf for loop. You just need to unbundle the array and then feed it into your pdf vi. You can adjust the amount of rows on a page by using the 'Rows per Page' Control.

 

Hope this helps,

 

Regards,

 

Lucither

------------------------------------------------------------------------------------------------------
"Everything should be made as simple as possible but no simpler"
0 Kudos
Message 4 of 4
(2,432 Views)