LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Detect page break in report

Hello everybody

 

I'm creating an application that is able to create reports out of test results (Word). This reports often contain a result table which exceeds the length of a single page. Now it would be nice to add the table header at the beginning of every new page which would ease the reading of the result table.

My table is not actually a table but in fact a multiline string which contains the row borders as particular characters at the correct positions("|"). It's concatenated inside the LabVIEW program. It's possible to add the table rows one by one or as a multiline string using the "Append Report Text" VI. Is there any possibility either...

... to detect when the report generates a page break ...

... or ...

... to detect when the final line of a page is reached so I can insert a page break programmatically.

 

I use LabVIEW 2013
Any ideas? Many thanks for your help!

 

Greetings

Thomas

0 Kudos
Message 1 of 9
(3,479 Views)

Hi BrotherTom,

I suppose you do not have the Report Generation Toolkit? Because we can handle page breaks more easily in the Word Specific Palette.

Assuming you do not pocess it, wouldn't it be possible for you to count the number of lines per word page and then to insert your header line every X lines inside your VI?

 

Tamara Moullet
----------------------
National Instruments
0 Kudos
Message 2 of 9
(3,448 Views)

Hi

Yes I actually do use the Report Generation Toolkit. Above all I use the VI "Append Report Text" by referring a Word template with bookmarks.

Maybe I'm too few familiar with the toolkit? Is there a possility to detect page breaks?

The other possibility would be in fact count the lines as you proposed... But I'd prefer a more comfortable solution if possible. Smiley Wink

0 Kudos
Message 3 of 9
(3,430 Views)

Ok, would you be ok to show me your VI so that I can think of the best way to adapt your code? Thanks!

And, as far as I know, there is no easy way to detect page breaks (except counting).

Tamara Moullet
----------------------
National Instruments
0 Kudos
Message 4 of 9
(3,411 Views)

One solution could be the following:

1) Create a true table in a word document for your data

2) Create a word macro performing these tasks:

a) Select the header row

b) Goes to Table Properties

c) On the row tab, check the option "Repeat as header row at the top of each page"

3) Use the "Word Run Macro" vi with corresponding macro once your document is finished

Normally this should work fine.

 

 

 

 

 

 

Tamara Moullet
----------------------
National Instruments
0 Kudos
Message 5 of 9
(3,406 Views)

Attached you'll find an example VI which illustrates the principle.

I tried also to post the Word template which contains 2 bookmarks "title" and "table", but the website didn't want to accept it... So you may have to create one yourself.

Thanks a lot for your help!

0 Kudos
Message 6 of 9
(3,402 Views)

Concerning your suggestions... Yes, this might be a suitable manner but unfortunately is not possible to be implemented because of internal guidelines.

In that case I'd prefer your first suggestion (counting lines) if there's no other way to detect page breaks.

 

0 Kudos
Message 7 of 9
(3,379 Views)

Ok... I would have another alternative to counting but it would only be suitable for document that do not have too many pages.

You could create bookmarks at the top of each page and save this template then add headers as shown in the attached VI.

Of course this is not really nice but works for "small" reports.

Tamara Moullet
----------------------
National Instruments
Message 8 of 9
(3,370 Views)

Hi Tamara

Many thanks for your help. I think I have an overview about possible solutions now and am able to find a way through this.

Again, thank you for your effort!

Greetings

0 Kudos
Message 9 of 9
(3,353 Views)