Dynamic page number or Reset page number & counter | Community
Skip to main content
June 1, 2009
Question

Dynamic page number or Reset page number & counter

  • June 1, 2009
  • 18 replies
  • 13445 views

Hi,

I am trying to reset the page number

dynamic page number
I am trying to print multiple documents in one report, the requirement is to reset page numbers for every document(to start counting from 1)
I don't have control over the size of the document because it is a flow table
I am using page conditional break to finish the document and start a new one but I couldn't change the page number or create a counter to use it as page number.

I am using ALD 8.1

all the design is in the body page the master page is empty.


Is there a way to create a counter and then assign it as page number?

OR

Is there a way to reset the page number back to 1 or 0 ?

OR

Is there a way to create a counter and reset it when using the conditional break ?

I found many solutions but none of them fit to solve this issue, because the dolutions I found were based on fixed number of pages and in my case I can't figgure out the number of pages because it is a flow table.

Sami

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

18 replies

October 1, 2009

Its Ok I used the generate sample data in Preview .....

I found that the designer is only a single record interface. You are using features that are intended to be used with LiveCycle Output Server. Designer has no concept of the repeating record. There is no means to indicate in a design where the repeating record node is. There are parameters in teh Output server calls that allow me to indicate where the repeating record starts so it knows how to create the multi output.

Are you using this with Output server?

Paul

October 1, 2009

I don't even know what Output Server is.  We are using Synergy/Change which runs a report  in XML containing one or more records.  The end result is the PDF like the example containing one or more subforms corresponding to the one or more XML data records.

Peace and Blessings,

Nikki

October 1, 2009

I have reread your last post several times and think I may have misunderstood what you were saying (working loads of OT on the same problem will wear you out!!!).  Where is the Output server and how do you use it, please?  I really appreciate your help!

Peace and Blessings,

Nikki

October 5, 2009

The ability to deal with multiple record data sets is posible with the current Designer but you are only allowed to view one record at a time. The ouput Server is built to deal with batch mode operations where you are trying to deal with multiple record datasets and create multiple print documents (which is what I am assuming you are doing).

Paul

October 5, 2009

Ok.  I am going to have to look up what an Output Server is but, in the meantime, I was able to tranfer over my schema and XML data file.  Please see attached.  Thanks!

Peace and Blessings,

Nikki

October 5, 2009

Ok, I will have to look up what an Output Server is but, in the meantime, I have attached my schema and XML data file.   Thanks!

Peace and Blessings,

Nikki

October 5, 2009

I forgot to correct the XML datda file so here it is again (see attached).  Also, I was not allowed to attach the schema file so here it is:

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">

<xsd:annotation>
  <xsd:documentation xml:lang="en">
   Adobe LiveCycle Designer Purchase Order Schema Sample
  </xsd:documentation>
</xsd:annotation>

<xsd:element name="changesynergy_report" type="SCRType"/>

<xsd:complexType name="SCRType">
  <xsd:sequence>
<xsd:element name="changesynergy_report_header" type="xsd:string"/>
<xsd:element name="changesynergy_column_report_attribute_labels"  type="reportLabel"/>
<xsd:element name="changesynergy_report_attributes"  type="reportAttr"/>
<xsd:element name="changesynergy_report_footer" type="xsd:string"/>
  </xsd:sequence>
</xsd:complexType>

<xsd:complexType name="reportAttr">
  <xsd:sequence>
   <xsd:element name="changesynergy_report_item" type="reportItem"/>
  </xsd:sequence>
</xsd:complexType>

<xsd:complexType name="reportLabel">
  <xsd:sequence>
   <xsd:element name="label" type="xsd:string"/>
  </xsd:sequence>
</xsd:complexType>

<xsd:complexType name="reportItem">
  <xsd:sequence>
   <xsd:element name="attribute_item" type="attrItem"/>
   <xsd:element name="changesynergy_relation_report" type="relReport"/>
  </xsd:sequence>
</xsd:complexType>

<xsd:complexType name="attrItem">
  <xsd:sequence>
   <xsd:element name="name" type="xsd:string"/>
   <xsd:element name="value" type="xsd:string"/>
   <xsd:element name="type" type="xsd:string"/>
  </xsd:sequence>
</xsd:complexType>

<xsd:complexType name="relReport">
  <xsd:sequence>
   <xsd:element name="name" type="xsd:string"/>
<xsd:element name="query_string" type="xsd:string"/>
<xsd:element name="relation" type="xsd:string"/>
   <xsd:element name="sub_report" type="subReport"/>
  </xsd:sequence>
</xsd:complexType>

<xsd:complexType name="subReport">
  <xsd:sequence>
   <xsd:element name="I" type="xsd:string"/>
   <xsd:element name="changesynergy_report_header" type="xsd:string"/>
<xsd:element name="changesynergy_column_report_attribute_labels" type="subReportLabel"/>

<xsd:element name="changesynergy_report_attributes">

<xsd:complexType>
  <xsd:sequence>
     <xsd:element name="changesynergy_report_item">
<xsd:complexType>
  <xsd:sequence>
   <xsd:element name="attribute_item">
<xsd:complexType>
  <xsd:sequence>
   <xsd:element name="name" type="xsd:string"/>
   <xsd:element name="value" type="xsd:string"/>
   <xsd:element name="type" type="xsd:string"/>
  </xsd:sequence>
</xsd:complexType>

</xsd:element>

  </xsd:sequence>
</xsd:complexType>

</xsd:element>

  </xsd:sequence>
</xsd:complexType>


</xsd:element>

<xsd:element name="changesynergy_report_footer" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>


<xsd:complexType name="subReportLabel">
  <xsd:sequence>
   <xsd:element name="label" type="xsd:string"/>
  </xsd:sequence>
</xsd:complexType>


</xsd:schema>

Thanks for your help!

Peace and Blessings,

Nikki

October 15, 2009

Hi!  I got a solution from another guy I have been talking to and thought I should post it.  This solution (below) doesn't require Output ES (also see attached). An example of the out put would be: "S1/P1, S1/P2, S1/P3, [blank page], S2/P1, S2/P2, [blank page], ..."

Thanks so much for your help, Paul!  It was greatly appreciated!

---changesynergy_report.#subform[0].DocChgProposal.Multi-Subform.Header.Pages::ready:layout - (JavaScript, client)

// The trick is to notice that every time the Header subform is rendered, it is parented to an instance of the 'Multi-Subform'

// subform and, since it's used as an overlow leader, it will be rendered on every new page generated as a result of the data.

// When rendered as an overflow leader, it will be parented to the subform which broke across pages and has 'Header' as its

// overflow leader (which means that the position, within the Form DOM hierarchy, of the 'Header.Pages' field will either be

// one or two levels removed from the 'Multi-Subform' subform).

// Since the 'Multi-Subform' subform is instantiated for each report, its index number is the section indicator and each time

// the 'Header' subform is rendered, it indicates a page. We just have to check within which instance of the 'Multi-Subform'

// subform it gets placed in order to know what section it falls into.

// Finally, a dynamically-generated integer form variable is associated with each instance of the 'Multi-Subform' subform in

// order to keep track of the current page count (i.e. the number of times the 'Header' subform has been instantiated and

// rendered within it).

// Note that using the Initialize event would not have the same result since that event occurs more than once for each

// instance due to the way the data merge algorithm works. The Layout:Ready event occurs only once the subforms have been

// rendered, which means only once per instance.

var

multiSF = null;

var

parentSF = this.parent;

while

(parentSF != xfa.form)

{

   if (parentSF.name == "Multi-Subform")

   {

      multiSF

=parentSF;

      break;

   }

   parentSF

= parentSF.parent;

}

if

(multiSF)

{

   // section number is multi-sf index + 1

   var sectionNum = multiSF.index + 1;

   // page number within section depends on existence of variable and variable's value

   var pageNum = 1;

   if (multiSF.resolveNode("pageCountVar"))

   {

      multiSF.pageCountVar.value

+= 1;

      pageNum

= multiSF.pageCountVar.value;

   }

   else

   {

      // associate pageCountVar variable to current parent instance of multi-sf subform

      var pageCountVar = xfa.form.createNode("integer", "pageCountVar");

      pageCountVar.value

= 1;

      // when we create the variable, the page count is always 1

      multiSF.variables.nodes.append(pageCountVar);

   }

   this.rawValue

= "S" + sectionNum + "/P" + pageNum;

}