cancel
Showing results for 
Search instead for 
Did you mean: 

Building a table which can grow in two directions across multiple pages

Former Member
0 Kudos

Experts

I have to develop a fairly complicated Adobe Form with a data connection. In real life this will work with a connection from a web dynpro component, but I've built a basic proof of concept using an XML file.

Essentially I need to display a matrix which can grow both to the right and downwards depending on the data. After reading the excellent article by Stefan Cameron http://forms.stefcameron.com/2006/10/28/scripting-table-columns I've built two prototypes which work as long as the data fits on one page. However, there is a real potential for the actual use data to flow over in both directions.

1) If the data flows of the bottom of the page it should carry on with all columns.

2) If the data flows to the right it will need to carry on displaying on the next page, but repeat the first column

From reading the comments in the above article I suspect I may need javascript to get the second of these requirements going, but I'm still struggling with the first which I would have thought should be possible out of the box.

I've attempted two approaches, one using a table and one using sub forms. Unfortunately neither is working as I would hope. I've tried many different permutations with the page break settings, but nothing seems to work.

I've uploaded some files to http://www.lasmit.co.uk/work/matrix.zip

There's two xdp's with the table/subform approaches and two XML files with small and larger datasets. In real life the cells won't be so massive, but it' requires less data to prove the point.

If anyone has any advice it would be really appreciated as I'm really struggling.

Thanks

Lewis

Accepted Solutions (1)

Accepted Solutions (1)

OttoGold
Active Contributor
0 Kudos

I wonder: will you use the SAP backend for your form? (you´ve mentioned the webdynpro...?).

If no, I have nothing to tell.

If yes: the typical advise of mine is: "create the right DDIC objects in your backend and use the form to display it for you, without any tricks/ scripting magic". What does that mean in your case: I understand you need to expand the table to the pages to right and down (means you expect the result for example 3 x 4 papers). But that is really crazy to implement, in fact it is a little crazy to imagine first. You´d better change the approach and change/convert the task from bidirectional to the typical way we do it. Why: IMHO you will only get a set of pages and will never be able to see them in the order you "need" before the print. And after the print, the only thing that matters is the number of the page.

I am almost there:

- create a table of pages in your backend

- for every page: fill it with data in the backend, the transformation should be easy in ABAP (much easier than in-form scripting)

- for every page: do not miss to add the page number (means do not use the form page numbering, number the pages yourself in the backend operations)

- use the form to display the data for you only, no harakiri/ black magic here!!

- because you need to expand to the right, you need to implement the columns header as a table of strings expanding from left to right

- last piece of the puzzle: you may only need scripting to show/ hide the leading column, but should be possible to accomlish this crazy toy without the scripting at all, I think

Hope this description is not too messy and can help a little.

Regards Otto

Former Member
0 Kudos

Hi Otto,

Thanks for the quick response. Should have given more detail. The data will come from a CAF and be passed through a WebDynpro.

I have control of the structure of the data that comes into web dynpro so can change the structure if required. Maybe will need to reinvent the CAF so that it only have so many rows to the right before it starts a new structure at a higher level. The document should feel as though it's just flowing downwards, but as the content can flow to the right it would need to have another page below to deal with it (so it's like it will wrap to the page below). Does that make sense?

Are you able to spot why the content doesn't flow down as expected even when it doesn't go to the right?

Thanks,

Lewis

OttoGold
Active Contributor
0 Kudos

I am afraid I don´t understand the question/ current state. In my opinion I have described the whole solution.

Feel free to contact me directly to speed this up and we can present only the final result here. Otto

Former Member
0 Kudos

Thanks for your help Otto. As discussed we've decided to simplify what's required in the pdf as much as possible. This comes down to two things:

- having hard coded columns and just hiding them if they have no data. This allows the table two flow downwards over multiple pages

- changing the structure of the data to include a page element in the hierachy. So data which is too 'wide' to fit will be added to a new 'page' in the CAF

Answers (0)