Filtering and Paging through Data

R

randyb

I am cutting and pasting from a sample form to get my idea to work. What I
want to do is to have some icons that will advance the data forward and
backward. I am having trouble getting the filter to work. Here is the
layout from the sample application

Page(secondary)
NumberOfRows
StartingRows
ShowFullLastPage Here are the filters
position() >= xdXDocument:GetDOM("Page")/Page/StartingRow and
position() < xdXDocument:GetDOM("Page")/Page/StartingRow +
xdXDocument:GetDOM("Page")/Page/NumberOfRows

Here is my layout.

Main(primary)
TOTALS
NumberOfRows
StartingRows
CashApp
Field1
Field2 etc

My question is how do I modify the above filter to work on my layout? In
the sample he was filtering the master record on a secondary source. In mine
I want to filter the detail as indicated by Cashapp and the fields below
it.Mine is on the primary Datasource and I have no secondary.

A secondary question I have is my data loads rather slowly. Will setting it
up with a filter and the ability to page through my data improve speed?



Thanks in Advance Randy
 
G

Gavin McKay

Hi Randy,

I'm not sure what version of InfoPath you're using (looks like 2003?) but I
would think it would be something like:

position() >= xdXDocument:GetDOM("Main")/Main/TOTALS/StartingRow and
position() < xdXDocument:GetDOM("Main")/Main/TOTALS/StartingRow +
xdXDocument:GetDOM("Main")/Main/TOTALS/NumberOfRows

i.e. replace Page with Main, and add the TOTALS node as well.

HTH

Gavin.
 
R

randyb

That was what I tried prior to posting. I received the following error.

Infopath cannot create a new blank form
The form template is not valid
When I click on show details I get

InfoPath cannot open the following view: Working
The XSL transform for the View XSL failed.

InfoPath
A call to XDocument.GetDOM failed. The DataObject "Main" does not exist.

Error occurred during a call to property or method 'GetDOM'.
 
G

Gavin McKay

Where are you putting this code? Is it in a code-behind file? And what
version of InfoPath are you using?

Gavin.
 
R

randyb

I am putting the code in the repeating table properties >> Display >> Filter
Data. I noticed if I added a secindary datasource and added the same code it
did not error out. Could it be because it is a primary datasourse. In the
sammple I copied this from it was on a secondary datasource.

Thanks,

Randy
 
R

randyb

I forgot, I am using 2003.

Randy

Gavin McKay said:
Where are you putting this code? Is it in a code-behind file? And what
version of InfoPath are you using?

Gavin.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top