cancel
Showing results for 
Search instead for 
Did you mean: 

smarform - multiple itabs with separate header n footer

Former Member
0 Kudos

Hi,

I have a custom report program which sends out 3 internal tables, to be printed by a z-smartform.

I have created a page(page1) with header1, mainwindow(itab1) and footer1. The report program ran successfuly printing the preview as page1 with itab1 data alone.

I need to similarly print itab2 and itab3 with their own headers and footers, so to have running page#. I tried to create a new page(page2) but cannot create a second main window.

Have anybody worked on scenario like this. would appreciate help on same.

Thanks,

Ram.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Copy the main window to your second (and third) pages and insert the new tables. Now after the first table insert a Command Node to call page 2. Similarly, insert a Command Node after the second table to call page 3.

Former Member
0 Kudos

When i copy the mainwindow to second page. It still caries itab1 and its data.

If i change it to itab2, that affects the data on page1 as well.

Also, the order of print should be as follows:

header1,itab1,footer1,header2,itab2,footer2,heade3,itab3,footer3.

Former Member
0 Kudos

Hi,

Thats true . You cannot different code for text elements in different mainwindows.

I guess this can be done by two methods.

1)if you have custom driver program then

open form

loop at header 1

at new header start form

endloop.

loopa t itab.

writeform

endloop.

endform.

closeform.

I guess iam clear.

It print a new form for evry newheader i.e 3 for forms in your case.

THANKS

VENKI

form.

Former Member
0 Kudos

Don't try to change the main window. The main window for all three pages will be the same. When the program finishes table 1 it will call a new page (because you inserted the Command Node to call page 2). On page two it will continue with the main window (this will be your second table). It will then hit the Command Node to call page 3. On page three it will go through your third table.

So put all three tables in Main, seperated by Command Nodes. Copy Main to pages 2 and 3.

On pages 2 and 3 you can create your new header and footer windows.

Former Member
0 Kudos

Matt,

I copied the mainwindow onto page2 and page3.

so in page1 i have a header1main windowfooter1. this footer1 carries a command node calling page2.

page2 i have a header2main windowfooter2. this footer2 carries a command node calling page3.

page3 i have a header3main windowfooter3.

the form is activated w/o err. when i test it i get a error "Message : Page break is allowed only in the main window".

So i moved footer1 as first window of page2, followed by headr2+mainwindow. I move the command node to main window in page1, i cannot alter it for calling page3 in page2.

any suggestions ?

Former Member
0 Kudos

I think in your main window (which will be identical in all three pages) you should have like this:

Table1

Command Node (call page 2)

Table2

Command Node (call page 3)

Table3

On each page have the Header for that page, followed by Main window, followed by Footer window.

This should work for you. If not, let me know.

Former Member
0 Kudos

Hey Matt,

That worked. Thanks for the help dude.

I still have 1 issue here. I have a text paragraph in a text node. This needs to be displayed at the end of itab1 alone.

Currently i had this inside the footer1 along with page#. so when my itab1 runs more than 1 page the paragraph also appears in all pages. how can i control this, still having the page# show up in al pages ?

-Ram

Former Member
0 Kudos

I'm not really sure about that one.

I would try splitting the page number and the text into two text nodes (one for page number and one for the text paragraph).

For the text node with the page number, select 'only at page break' in the conditions.

For the text node with the paragraph of text, select 'only at the paragraph end' (this is the part that I'm not sure about).

Give it a try and let me know how it comes out.

Former Member
0 Kudos

Matt,

I have them both in separate text nodes inside the footer1. But the conditions that you mentioned are disabled in our systems.

Well appreciate your help thus far.

-Ram.

Former Member
0 Kudos

I think that you have these two text nodes in a seperate window. Try putting them in the footer event for table1. In table 1 click on the Events tab and select Footer. Be sure to give a height.

Then put your two text nodes under Footer in the Graphical tree. Select the conditions as I outlined above.

This may not work, but its worth a try.

Or you may be able to add a Program Lines Node after Table1 and before Command to go to page 2.

In the Program Lines set a flag.

In the text node for the text paragraph give the condition to print only if the flag is set.

Message was edited by: Matt Nagel

Former Member
0 Kudos

Matt,

I created checked the Footer in ITAB1-Event. some progress.

The text paragraph follows the itab1 grid and appears in a new line in the first column of the table as the last record. whereas we do want it appears as he last line but outside the tabular grid. the footer event doesnt allow me to crate templates either for the paragraph.

i created a new line type with only one column(full size of table) in itab1. and used it to define the footer. This is working much better just that the text apears in a table grid.

Former Member
0 Kudos

What system are you on?

Can you adjust the grid so that it doesn't cover your new line type?

Maybe it wasn't a great idea to put the two text nodes in the table footer (I didn't think about the grid).

Try putting the page number back into your Footer Window.

Now move the text node with the paragraph text just after the table1 node (between the table and the command nodes).

This should cause your paragraph text to print after your table1 is done printing.

And the page number is back to another window (where it was working initially).

Former Member
0 Kudos

Thanks Matt,

I moved the textnode between the itab1 and command node. Its working good.

Appreciate all your help dude!

-ram

Former Member
0 Kudos

You are welcome Ram.

Please go ahead and mark the thread so that others will know that a solution was found.