Hi,
I have a Data View that is linked to a table in an MS Access database.
How can I determine the number of rows that are in the data view?
Thanks,
Chris
Solved! Go to Solution.
Views
Replies
Total Likes
Ok I see the issue.....starting at version 8 of Acrobat the sourceset Dom has been locked down so that if you try and modify it you will get security errors.
There is a good explantion of this in Stefan Cameron's blog located here:
http://forms.stefcameron.com/2006/12/07/better-form-design-with-xfa-25/
Towards the bottom is a solution for sunning with current versions.
The other option is to target your form for an earlier version where this restrict did not exist. In Form Properties vhoose a target version of 7.0.5 and your code will work just fine (no errors).
Paul
Views
Replies
Total Likes
You can get a count of the repeating Row instances in the table from the instanceManger. The syntax would be somthing like this:
var noOfRows = Table.Row.instanceManager.count
Paul
Views
Replies
Total Likes
Thanks for the reponse but I'm after the number of rows in the DATA VIEW, not a table in the pdf.
Any clues,
Chris
Views
Replies
Total Likes
Are you talking about the dataview in Flex? If so I think you are posting to the wronf forum.
Paul
Views
Replies
Total Likes
No, I'm talking about a data view in Life Cycle Designer. In the attached image I need to find out the number of rows in the remote table 'NRSP_Q4b'.
Any clues?
Thanks,
Chris
Views
Replies
Total Likes
Ok Now I understand. There is no distinct javascript command that will give you the count of records in the table. There is a Beginning of File (isBOF) and End of File (isEOF) that will return true/false if you are at the beginning or end. Another option would be to execute a SQL statement that will return the count of records.
Paul
Views
Replies
Total Likes
That is what I feared. I've tried isEOF in a loop but it just kept on going.
I then found that you needed to ...setAttribute("stayBOF", "bofAction") and ..setAttribute("stayEOF", "eofAction"). I added this but the code bombed on these lines and failed to set the bofAction and eofAction. That is the subject of another current discussion but unfortunately I haven't received any responses to that.
So I've now put together a small pdf (attached) that shows what I'm trying to achieve (I hope) and the problems that I'm having.
I'm trying to populate a pdf table with records from an external table (on varying number of rows. To run you will need to create an ODBC Data Source to the enclosed Access mdb. Mine was called NRSP.
Hopefully you will have the same problems that I'm having. If not then the errors could be with my computer or setup. Unfortunately I don't have access to another computer with LifeCycle Designer (I'm using 8.0) to test it on.
PLEASE have a look at the pdf and let me know where I'm going wrong. I'm tearing my hair out trying to get this to work.
Thanks,
Chris
Views
Replies
Total Likes
My message got through but the attachment didn't so I'll try again.
Views
Replies
Total Likes
Nope no go. I'm trying to attach a zip gile with a pdf and an MS Access mdb file but it looks as though you don't accept a zip file. Here is the pdf but this is useless without the data. How can I send you the .mdb file?
Unfortunately I'm on the other side of the world so to try and get more than one response a day is very difficult.
Chris
Views
Replies
Total Likes
Change the extensions to txt and let us know what to change the filename to.
Paul
Views
Replies
Total Likes
If that does not work send the zip file to livecycle8@gmail.com and I will have a look.
Paul
Views
Replies
Total Likes
Okay, here is the 'txt' file. Rename it back to '.zip'.
Cheers,
Chris
Views
Replies
Total Likes
Ok I see the issue.....starting at version 8 of Acrobat the sourceset Dom has been locked down so that if you try and modify it you will get security errors.
There is a good explantion of this in Stefan Cameron's blog located here:
http://forms.stefcameron.com/2006/12/07/better-form-design-with-xfa-25/
Towards the bottom is a solution for sunning with current versions.
The other option is to target your form for an earlier version where this restrict did not exist. In Form Properties vhoose a target version of 7.0.5 and your code will work just fine (no errors).
Paul
Views
Replies
Total Likes
Brilliant - Stefan solutions worked.
For those others who may view the this thread for LifeCycle Designer 8 you need top use..
var oDB = xfa.sourceSet.nodes.item(nIndex).clone(1);
so that you can set the 'bofAction' & 'eofAction' attributes.
I must say though that I haven't seen any mention of this anywhere.
Thanks for your help.
Chris
Views
Replies
Total Likes
Well not quite there.
In the first table, 16b, in the attached file (rename .txt to .zip) column 1 is showing 'Empty' for all rows, even tough the correct value is being returned from the data table.
The data for columns two and three of the pdf table are being retrieved correctly and populated correctly in the table, but column one is not, even though I appear to have everything correct.
Do you have any clues as to why the data ifor column one is not being displayed correctly?
Cheers,
Chris
Views
Replies
Total Likes
The file is not getting through the filters ...can you send it to livecycle8@gmail.com ....make sure to reference this post.
Paul
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies