Filtering Secondary Datasource

M

Martyn Lawson

Hi,

I have read previous queries and know that this is possible if the .xsl file
is modified manually.

I have a repeating table on a secondary datasource (called
Job_Bags__Prototype_) that i would like to filter. I have created this in a
new form and looked at the .xsl file to see the format and although it
appears to work for one of my filter conditions, i cannot get the other to
work.

I have the line:
<xsl:for-each select="xdXDocument:GetDOM("Job
Bags")/dfs:myFields/dfs:dataFields/dfs:Job_Bags__Prototype_ [ (@Customer_Name
= ../my:myFields/my:customer/my:customerName and @Status = "Quote")]">

in the .xls file. I am trying to filter the rows where the Customer_Name
field in the secondary datasource matches the
my:myFields/my:customer/my:customerName field in the main datasource and also
where the Status is equal to Quote.

Adding this line to the .xsl file works fine if i am just filtering on the
Status field, but not when i try to add the customerName filter. I am
assuming that my xpath is incorrect. Can you please advise?

Cheers,
Martyn...
 
M

Martyn Lawson

Hi Franck,

I've had a look at the links but I don't think i need to do anything with
current() as i'm not actually after the current row. My problem is that i am
filtering a secondary datasource using a value in the Main datasource and i
do not know the correct format for the xpath of that field.

It's xpath is /my:myFields/my:customer/my:customerName and i'm trying to use
this in the line:
<xsl:for-each select="xdXDocument:GetDOM("Job
Bags")/dfs:myFields/dfs:dataFields/dfs:Job_Bags__Prototype_ [ (@Customer_Name
= /my:myFields/my:customer/my:customerName and @Status = "Quote") or
($filterParentHasNewRowsCTRL1 = "true" and
xdXDocument:GetNamedNodeProperty(., "filterVersion", "0") >
$filterParentVersionCTRL1) ] ">

but it is not working. If i remove this filter and just leave the @Status =
.... filter it works a treat.

Any ideas?

Cheers,
Martyn...


Franck Dauché said:
Hi Martyn,

Did you try to play with current() instant of your full path?
Look at these links:
http://www.infopathdev.com/forums/topic.asp?TOPIC_ID=1102
http://www.infopathdev.com/forums/topic.asp?TOPIC_ID=946

Hope that it helps.

Regards,

Franck Dauché


Martyn Lawson said:
Hi,

I have read previous queries and know that this is possible if the .xsl file
is modified manually.

I have a repeating table on a secondary datasource (called
Job_Bags__Prototype_) that i would like to filter. I have created this in a
new form and looked at the .xsl file to see the format and although it
appears to work for one of my filter conditions, i cannot get the other to
work.

I have the line:
<xsl:for-each select="xdXDocument:GetDOM("Job
Bags")/dfs:myFields/dfs:dataFields/dfs:Job_Bags__Prototype_ [ (@Customer_Name
= ../my:myFields/my:customer/my:customerName and @Status = "Quote")]">

in the .xls file. I am trying to filter the rows where the Customer_Name
field in the secondary datasource matches the
my:myFields/my:customer/my:customerName field in the main datasource and also
where the Status is equal to Quote.

Adding this line to the .xsl file works fine if i am just filtering on the
Status field, but not when i try to add the customerName filter. I am
assuming that my xpath is incorrect. Can you please advise?

Cheers,
Martyn...
 

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