How to set page numbers in XSLT having multiple simple-page-master?.This is for dynamically inserting pagenumbers in PDF - xslt

I have an XSLT file having multiple simple-page-master. The multiple simple-page-master is used for setting different height and width.
Here I am facing an issue that the pagenumbers corresponding to each simple-page-master starts with 1.
I used < fo:page-number/> for dynamically generating Page numbers.
I also want to get the total number of pages since I have to write Page numbers as
Page 1 of 20
I need pagenumbers in a sequence.
How can I solve this?

Mmmh without more samples, it's hard to try an answer...
I gamble one but quite blindly :
You should have some somewhere. Add a pagenumber param in it. And in your add .
You should be able to output the page number via the param. To get the total number of simple-page-master, add another param or use the XPath count(//simple-page-master) (better to count once and use params).

Related

Turning an Xpath into a list variable and use For loop

I'm very new to robot framework. This question is about creating a list variable using Xpath.
I'm trying to write a FOR LOOP in robot in order to print all items that appear on a search result page. Here is what I've done so far:
I tried to declare a list variable using Xpath:
#{product} //div[contains(#class,'ProductCard__TitleMaxLines')]
This Xpath has the number of repetitions the same as the number of items on the page, e.g. 20, so I assume that this list will contain 20 members. --> Is this how it works?
I created a For loop:
${index} Set variable 1
For ${product} in #{related_product}
Exit for loop if ${index} > 20
Log to console ${product}
${index} Evaluate ${index}+1
End
For this, I assume that it will take the first product found on the Xpath to be index=1, and the next index=2, and so on.
That's all I've done so far. Please advise if this works correctly or if there is another way that is better and more typical.
I think your question is, you have similar kind of xpath around 20 times in the webpage. If my understanding is correct, you should use the Get Webelements keyword from Selenium Library.
#{product} Get Webelements //div[contains(#class,'ProductCard__TitleMaxLines')]
The above line will create the list of webelements which having the same xpath

is it possible to determine the max length of a field in a csv file using regex?

This has been discussed in stackoverflow before but I couldn't find a case/answer that might apply to my situation:
From time to time I have raw data in text to be imported into SQL, for almost every case I must try out several times as SSIS wizard doesn't know what's the max size of each field and the default is 50 characters. Only after it fails I can know from the error message which (first) field was truncated and I then increase the field's size.
There might be more than one field that needs getting its size increased, and the SSIS wizard only gives one error each time it encounters a truncate, as you can see this is very tedious, I want to find a way to have a quick inspect to the data first to determine the max size of each field.
I came across an old post on stackoverflow: Here is the post
Unfortunately it might not work on my case: my raw data could have as many rows as 10 Million (yes, in one single text file which is over GB).
I am kind of do not think there would be a way to get that, but just still want to post my question here hoping to get some clue.
Thank you very much.

Vtiger. Change query limit

In vtiger wiki written:
Query always limits its output to 100 records, client application can use limit operator to get different records.
This query does not work:
doQuery("select * from Leads limit='200';")
How to specify the operator in a query?
The "limit" clause only works if the number given is lower than 100. You can't get more records than 100 using "limit" with 1 request.
To get more than 100 records from vTiger services you need to make various request using the "offset" in the "limit" clause.
If you really read the Wiki documentation, you'd see that you need to use:
select *
from Leads
limit 200;
Stop using unnecessary single quotes ('200') - the limit expects a numerical value, there's absolutely no point in converting that to a string (by using single quotes) .....
and drop the equal sign, too - it's not shown in the docs anywhere .....

Horizontal stretching in ListRenderer

I have a list that should display 7 items that each look like this:
Date Weekday Distance Time
Long text that may span many lines
two column text Distance Time
two column text Distance Time
two column text Distance Time
The last lines repeat in a number depending on the data, i e there may be different amounts of such lines for each list item.
I have tried implementing this with a ListCellRenderer that creates a table according to the requirements above, but I have a few problems with it:
The long text that may span many lines is implemented in a SpanLabel. But this text will not display more than one line anyway
Each item in the list will get space for the same number of lines below the first two..
So it seems that items in a list must be of the same size.
Later I also want to be able to detect selection on the entire list item, not just individual fields of it.
Is there a better way to do this?
How do I ensure that the SpanLabel actually gets as much space as it needs?
How do I ensure that the unknown number of lines gets the space they need, depending on how many they are?
Don't use a list: https://www.codenameone.com/blog/deeper-in-the-renderer.html
Lists in Codename One assume every entry is exactly the same height and provide no flexibility here.
I suggest doing something like the property cross demo: https://www.udemy.com/learn-mobile-programming-by-example-with-codename-one/
Where we use a Container with components within to provide a list like behavior with the full flexibility that arbitrary components allow.

How to report a list in Behaviorspace NetLogo?

I am running a NetLogo model in BehaviorSpace each time varying number of runs. I have turtle-breed pigs, and they accumulate a table with patch-types as keys and number of visits to each patch-type as values.
In the end I calculate a list of mean number of visits from all pigs. The list has the same length as long as the original table has the same number of keys (number of patch-types). I would like to export this mean number of visits to each patch-type with BehaviorSpace.
Perhaps I could write a separate csv file (tried - creates many files, so lots of work later on putting them together). But I would rather have everything in the same file output after a run.
I could make a global variable for each patch-type but this seems crude and wrong. Especially if I upload a different patch configuration.
I tried just exporting the list, but then in Excel I see it with brackets e.g. [49 0 31.5 76 7 0].
So my question Q1: is there a proper way to export a list of values so that in BehaviorSpace table output csv there is a column for each value?
Q2: Or perhaps there is an example of how to output a single csv that looks exactly as I want it from BehaviorSpace?
PS: In my case the patch types are costs. And I might change those in the future and rerun everything. Ideally I would like to have as output: a graph of costs vs frequency of visits.
Thanks
If the lists are a fixed length that doesn't vary from run to run, you can get the items into separate columns by using one metric for each item. So in your BehaviorSpace experiment definition, instead of putting mylist, put item 0 mylist and item 1 mylist and so on.
If the lists aren't always the same length, you're out of luck. BehaviorSpace isn't flexible that way. You would have to write a separate program (in the programming language of your choice, perhaps NetLogo itself, perhaps an Excel macro, perhaps something else) to postprocess the BehaviorSpace output and make it look how you want.