Repeat row with only four columns in html table using angular 4 - angular4-forms

For Ex. I have an arraylike this cids:Array=[{Id:1},{Id:2},{Id:3},{Id:4},{Id:5},{Id:6},{Id:7}---------etc..]
I want output as :
1 2 3 4
5 6 7 8
9
Using *ngFor in angular 4

One way is to convert your arrray[] in array[][4]. And then you will be able to use an imbricated ngFor (ngFor in another ngFor)
Pseudo code :
ngFor* {
ngFor* {
print value;
insert a space;
}
Insert a return line;
}

<span *ngFor="let cid of cids">
{{cid.Id}}
<br *ngIf="(cid.Id)%4==0" />
</span>

Related

FreeMarker sum group

I'm trying to do the following in Freemarker via NetSuite:
I have the following data on a transaction record i.e. imagine a payment record with a number of lines
Doc No. Amount
1 100
1 100
2 50
3 200
4 50
4 25
5 1000
and I want to be able to output:
Doc No. Total
1 200
2 50
3 200
4 75
5 1000
I think you need to use #list and #assign but not sure??
Here is a snippet that should help out with this question (I hope). This is pulled from one of my PDF templates, where I'm adding up the locationTotal variable.
<#list record.item as item>
<#assign currentLocation=item.custcol_location>
<#if currentLocation=="">
<#assign currentLocation=record.entity>
</#if>
<#if item.itemtype!="Discount" && locationsProcessed?seq_index_of(currentLocation)==-1>
<#assign locationTotal=0>
<#list record.item as item2>
<#assign compareLocation=item2.custcol_location>
<#if compareLocation=="">
<#assign compareLocation=record.entity>
</#if>
<#if compareLocation==currentLocation>
<#assign locationTotal=locationTotal+item2.amount>
</#if>
</#list>
<#assign newList=newList+[{"location":currentLocation,"total":locationTotal}] >
<#assign locationsProcessed=locationsProcessed+[currentLocation] >
</#if>
</#list>

An issue with argument "sortv" of function seqIplot()

I'm trying to plot individual sequences by means of function seqIplot() in TraMineR. These individual sequences represent work trajectories, completed by former school's graduates via a WEB questionnaire.
Using argument "sortv", I'd like to sort my sequences according to the order of the levels of one covariate, the year of graduation, named "PROMO".
"PROMO" is a factor variable contained in a data frame named "covariates.seq", gathering covariates together:
str(covariates.seq)
'data.frame': 733 obs. of 6 variables:
$ ID_SQ : Factor w/ 733 levels "1","2","3","5",..: 1 2 3 4 5 6
7 8 9 10 ...
$ SEXE : Factor w/ 2 levels "Féminin","Masculin": 1 1 1 1 2 1
1 2 2 1 ...
$ PROMO : Factor w/ 6 levels "1997","1998",..: 1 2 2 4 4 3 2 2
2 2 ...
$ DEPARTEMENT : Factor w/ 10 levels "BC","GCU","GE",..: 1 4 7 8 7 9
9 7 7 4 ...
$ NIVEAU_ADMISSION: Factor w/ 2 levels "En Premier Cycle",..: NA 1 1 1 1
1 NA 1 1 1 ...
$ FILIERE_SECTION : Factor w/ 4 levels "Cursus Classique",..: NA 4 2 NA
1 1 NA NA 4 3 ..
I'm also using "SEXE", the graduates' gender, as a grouping variable. To plot the individual sequences so, my command is as follows:
seqIplot(sequences, group = covariates.seq$SEXE,
sortv = covariates.seq$PROMO,
cex.axis = 0.7, cex.legend = 0.7)
I expected that, by using a process time axis (with the year of graduation as sequence-dependent origin), sorting the sequences according to the order of the levels of "PROMO" would give a plot with groups of sequences from the longest (for the older graduates) to the shortest (for the younger graduates).
But I've got an issue: in the output plot, the sequences don't appear to be correctly sorted according to the levels of "PROMO". Indeed, by using "sortv = covariates.seq$PROMO" as in the command above, the plot doesn't show groups of sequences from the longest to the shortest, as expected. It looks like the plot obtained without using the argument "sortv" (see Figures below).
Without using argument "sortv"
Using "sortv = covariates.seq$PROMO"
Note that I have 733 individual sequences in my object "sequences", created as follows:
labs <- c("En poste","Au chômage (d'au moins 6 mois)", "Autre situation
(d'au moins 6 mois)","En poursuite d'études (thèse ou hors
thèse)", "En reprise d'études / formation (d'au moins 6 mois)")
codes <- c("En poste", "Au chômage", "Autre situation", "En poursuite
d'études", "En reprise d'études / formation")
sequences <- seqdef(situations, alphabet = labs, states = codes, left =
NA, right = "DEL", missing = NA,
cnames = as.character(seq(0,7400/365,1/365)),
xtstep = 365)
The values of the covariates are sorted in the same order as the individual sequences. The covariate "PROMO" doesn't contain any missing value.
Something's going wrong, but what?
Thank you in advance for your help,
Best,
Arnaud.
Using a factor as sortv argument in seqIplot works fine as illustrated by the example below:
sdc <- c("aabbccdd","bbbccc","aaaddd","abcabcab")
sd <- seqdecomp(sdc, sep="")
seq <- seqdef(sd)
fac <- factor(c("2000","2001","2001","2000"))
par(mfrow=c(1,3))
seqIplot(seq, with.legend=FALSE)
seqIplot(seq, sortv=fac, with.legend=FALSE)
seqlegend(seq)

ionic 2 ion-grid / ion-row / ion-col not working when used as a attribute to div

<ion-grid no-padding>
<ion-row>
<ion-col>col 1</ion-col>
<ion-col>col 2</ion-col>
<ion-col>col 3</ion-col>
</ion-row>
</ion-grid>
Above code works good, its respective styles are applied, but, below one doesn't work.
<div ion-grid>
<div ion-row>
<div ion-col>col 1 div</div>
<div ion-col>col 2 div</div>
</div>
</div>
When I tried to put it as attributes, styles are not applied for grid, I get something similar to
col 1 div
col 2 div
expected result: col 1 div col 2 div
What am I doing wrong?
ref: http://ionicframework.com/docs/v2/api/components/grid/Grid/#grid-size

Can't remove whitespace in rythm engine

I am using the rythmengine.
The output I want is: x=prefix:value without any whitespaces.
#def test(String param){
#{param="prefix:"+param} #param
}
1
2 x=#test("value")
3
output is: 2 x= prefix:value
#def test(String param){
#{param="prefix:"+param}#param
}
1
2 x=#test("value")
3
output is: 2 x=param
This seems like a bug. Does anyone know a solution or workaround?
Try the following code on http://fiddle.rythmengine.org/#/editor:
#def test(String param){
#{param="prefix:"+param}##param
}
1
2 x=#test("value")
3

Display Superscript in SSRS reports

I m working on SSRS 2008.
i want to display date as 1st January 2011..
but "st" should be in superscipt ..
not like "1st".
is there any way to display "st", "nd","rd" and "th" in superscipt without installing any custom font type(other Font Type).
just copy and paste from the following list:
ABC⁰ ¹ ² ³ ⁴ ⁵ ⁶ ⁷ ⁸ ⁹ ⁺ ⁻ ⁼ ⁽ ⁾
ABC₀ ₁ ₂ ₃ ₄ ₅ ₆ ₇ ₈ ₉ ₊ ₋ ₌ ₍ ₎
ABCᵃ ᵇ ᶜ ᵈ ᵉ ᶠ ᵍ ʰ ⁱ ʲ ᵏ ˡ ᵐ ⁿ ᵒ ᵖ ʳ ˢ ᵗ ᵘ ᵛ ʷ ˣ ʸ ᶻ
ABCᴬ ᴮ ᴰ ᴱ ᴳ ᴴ ᴵ ᴶ ᴷ ᴸ ᴹ ᴺ ᴼ ᴾ ᴿ ᵀ ᵁ ᵂ
ABCₐ ₑ ᵢ ₒ ᵣ ᵤ ᵥ ₓ
ABC½ ¼ ¾ ⅓ ⅔ ⅕ ⅖ ⅗ ⅘ ⅙ ⅚ ⅛ ⅜ ⅝ ⅞ № ℠ ™ © ®
ABC^ ± ¶
Maybe...
You are limited to what can be done with String.Format. Font size and spacing also refer to the whole text box. So it isn't "native"
However, superscript is unicode so you may be able to to do it with some fancy expression that concatenate characters. I'd suggest custom code.
I haven't tried this, but these articles mention it
http://beyondrelational.com/blogs/jason/archive/2010/12/06/subscripts-and-superscripts-in-ssrs-reports.aspx
http://www.codeproject.com/KB/reporting-services/SSRSSuperscript.aspx
I am not looking for credit here as above solution has answered it for you but for beginners sake, I use a code function within my report.
So in my SQL say I have Number field, then I add a new field OrdinalNumber:
SELECT ..., Number,
CASE WHEN (Number % 100) BETWEEN 10 AND 20 THEN 4
WHEN (Number % 10) = 1 THEN 1
WHEN (Number % 10) = 2 THEN 2
WHEN (Number % 10) = 3 THEN 3
ELSE 4 END AS OrdinalNumber,
...
Then my code function:
Function OrdinalText(ByVal OrdinalNumber As Integer) As String
Dim result As String
Select Case OrdinalNumber
Case 1
result = "ˢᵗ"
Case 2
result = "ⁿᵈ"
Case 3
result = "ʳᵈ"
Case Else
result = "ᵗʰ"
End Select
Return result
End Function
Then in the report textbox I use the expression:
=CStr(Fields!Number.Value) & Code.OrdinalText(Fields!OrdinalNumber.Value)