Leave feedback
  • Question

    Story Teller Question - Using Page Groups

Enter a new topic
  • Roberto Avalos Roberto Avalos StreamServe Employee
    0 likes 2682 views

    HI

    We are using SS V5.0 release 1238 on Windows 2008 Server.

    I am working right now an invoice. This invoice is quite different from the rest that I had done. It is a consolidated bill that displays the information in different ways than in others.

    It is hard to explain but I will try.

    I am using XML as input. The XML contains a block with Client Premises. Each premise contains information about charges and within it, it contains other blocks with information about services and meters.

    In former bills, I used to display all charges for each premise continuously(Portrait) and then meters and services for all premises(Landscape). So I had two type of pages,

    1. First Page (portrait) will display all charges for all premises using a Repeater that looped through each premise and then through all charges for the premises.

    2. Second(landscape) will display all meter and services information per premise with a page break at the end of each premise.

    The output file would contain all the Portrait Pages first and then all the Landscape pages.

    This new Industrial Consolidated Bill requires that I display:

    0. Front Page -No issues here

    1. First Page (portrait) charges for premise 1

    2. Second Page (landscape) meter and services for premise 1

    3. First Page (portrait) charges for premise 2

    4. Second Page (landscape) meter and services for premise 2

    Etc.

    So I tried to make a Premise Page Group for First Page and Second Page(with occurrence set to N=Number of Premises). I removed the Repeater for Premise and instead used an XPath with something like this: block_premise[position()=$PremiseNumber].block_charges….

    With that, I am trying to manipulate in what premise I am when the Page Group pages are triggered. My assumption is that because the occurrence is set to occur N number of times as number of premises, this would replace the repeater I used originally in my other bills. I am still facing the issue how to control the occurrence of the Page Group as it does not accept modifications. It is now hardcoded to 4 because the xml has 4 premises.

    So, I am able to generate a PDF that displays the First Premise Pages(Portrait and Landscape) , but after that I only get Blank Pages.

    So I am wondering if some one has bumped into this kind of requirements or has any ideas.

    Thanks,

    Roberto

     

    Monday 10 October, 2011
  • Best Answer
    David Bares David Bares OpenText Employee Administrator StreamServe Employee
    1 likes

    I think what you would really need would be a repeater on the page group. But that is not (yet) supported in StoryTeller.

    The workaround that was successfully tested so far was putting the two pages into a page group. First page=Exact 1, Second page=Optional. Group=repeatable.

    Both pages then exploit the same story. Story has a top level repeater block_premise.

    Content for both pages starts with Location = In next story frame.

    Or both parts can be followed by Area break.

    If your pages do not overflow, you are done.

    But since life is not easy, overflow happens. Now comes the workaround:

    The page group will repeat series of first/second, first/second, ... So what you need to do is to skip() the first page if you are in overflow mode of the second page.

    You would control this with variables. Something like: $isCharges. Initiate it in the script before repeater. Set the value after each page section in the repeater.

    If you have no suitable object to put it on, create a separate paragraph with only Invisible line on it. Put the script on a line. Paragraph with only line on it (horizontal!) has 0 height. And if the line is invisible there will be nothing rendered in the output.
    If the line would be Hidden, then it would not be formatted in the paragraph and the paragraph height would become the font height.

    This way line becomes a script holder on an exact position on a story.

    Some people use empty substitution for a script holder. That may be better for the "inline" scenarios, but it still has font height.

    Good luck

    Tuesday 11 October, 2011
  • Vyv Lomax Vyv Lomax Administrator
    0 likes

    Hi there, here are some ideas to get you thinking....

    • On the document begin context use the StMsgSaveToFile() function to generate a copy of the XML arriving into the ST process. This should give you a heads up to what the ST process actually receives. From this you should be able to assertain if the ST process receives the data necessary to even generate the required output. Then you should be able to see if you event is correct.
    • Try to remove the logic to tie the number of pages to the data - if you map it up correctly then the output should give you the required pages. Areas breaks may be employed in order to get the spacing / pagination right.
    • A work-a-round could be to loop the input so that you generate an internal file that contains the exact information that you require with all contexts and internal counters. This requires more overhead yet gives you more control over the logical data structures. This is a trick employed when working with the less powerful PageOUT tool and so I mention this mainly out of old habit.
    • Keep the page grouping - it seems totally correct.

    Good luck and let us know....

    Tuesday 11 October, 2011
  • David Bares David Bares OpenText Employee Administrator StreamServe Employee
    1 likes

    I think what you would really need would be a repeater on the page group. But that is not (yet) supported in StoryTeller.

    The workaround that was successfully tested so far was putting the two pages into a page group. First page=Exact 1, Second page=Optional. Group=repeatable.

    Both pages then exploit the same story. Story has a top level repeater block_premise.

    Content for both pages starts with Location = In next story frame.

    Or both parts can be followed by Area break.

    If your pages do not overflow, you are done.

    But since life is not easy, overflow happens. Now comes the workaround:

    The page group will repeat series of first/second, first/second, ... So what you need to do is to skip() the first page if you are in overflow mode of the second page.

    You would control this with variables. Something like: $isCharges. Initiate it in the script before repeater. Set the value after each page section in the repeater.

    If you have no suitable object to put it on, create a separate paragraph with only Invisible line on it. Put the script on a line. Paragraph with only line on it (horizontal!) has 0 height. And if the line is invisible there will be nothing rendered in the output.
    If the line would be Hidden, then it would not be formatted in the paragraph and the paragraph height would become the font height.

    This way line becomes a script holder on an exact position on a story.

    Some people use empty substitution for a script holder. That may be better for the "inline" scenarios, but it still has font height.

    Good luck

    Tuesday 11 October, 2011
  • Roberto Avalos Roberto Avalos StreamServe Employee
    0 likes

    Thank you very much David. I implemented your suggestions successfully.

    Friday 21 October, 2011
  • Roberto Avalos Roberto Avalos StreamServe Employee
    0 likes

    Thanks Vyv, your suggestions were also helpful for alternatives in case we could not get story teller to generate the alternation. Fortunately it did!

    Friday 21 October, 2011

 

Latest from the blogs

Read more