cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Choose Language Hide Translation Bar
Yass
Level II

Automatically Resize Column Widths in a results display

Hello,

I have an issue with my results display: every time I change sizes or there is a long name, the display gets deformed. Therefore, I would like to know if there is a method to automatically resize column widths.

Thank you.

//Variables pour la mise en page
	// l : left, r : right, t : top, b : bottom, s : sides, w : width, sf : size font
	l = 20;
	r = 20;
	t = 30;
	b = 30;
	s = 25;
	w = 150;
	sf = 25;
	pad_baie = -30;
	pad_nok = -30;
	pad_code = 170;
	pad_ref = 30;
	pad_prod = 500;

	//Création de la fenetre du top 5
	window = new Window ("TOP5",
		V List Box(
			pb = Picture Box( Open( "D:\Project JMP\Images\ldl-logo.png", png ) ),
			Border Box( Top(50),
				V List Box(
					tb1 = Text Box("Production results report of "||Format( date2, "yyyy-mm-dd" )),
					tb1 << Set Base Font( "Title" ),
					tb1 << Set Font Scale (3),
					tb1 << Justify Text("Center"),
					tb1 << Set Width(2770),
					tb1 << Background Color(RGB Color(225, 225, 225)),
					
					tb2 = Text Box ("SVI, PY"),
					tb2 << Justify Text("Center") << Set Font Size(25),
					tb2 << Set Width(2770),
					tb2 << Background Color(RGB Color(240, 240, 240)),
				)
			),
			V List Box (
				Border Box (Top (100), Bottom(100), Left (25),
					// TOP 5 ICT
					V List Box(
						tb3 = Text Box( "Top 5 NOK results for ICT"),
						tb3 << Set Base Font( "Title" ),
						tb3 << Set Font Scale (2),
						H List Box(
							//Colonne Baie
							V List Box (
								b1 = Border Box( Left( l ), Right( r ), Top( t ), Bottom( b ), Sides( s ), t1 = Text Box ("Bay")),
								b1 << Set Background Color(RGB Color(93, 173, 226)),
								t1 << Set Width (w+pad_baie) << Set Font Size (sf) << Set Font Style ("Bold"),
								b2 = Border Box( Left( l ), Right( r ), Top( t ), Bottom( b ), Sides( s ), t2 = Text Box (filtered_top5_ict_baie[1])),
								b2 << Set Background Color(RGB Color(93, 173, 226)),
								t2 << Set Width (w+pad_baie) << Set Font Size (sf),
								b3 = Border Box( Left( l ), Right( r ), Top( t ), Bottom( b ), Sides( s ), t3 = Text Box (filtered_top5_ict_baie[2])),
								b3 << Set Background Color(RGB Color(93, 173, 226)),
								t3 << Set Width (w+pad_baie) << Set Font Size (sf),
								b4 = Border Box( Left( l ), Right( r ), Top( t ), Bottom( b ), Sides( s ), t4 = Text Box (filtered_top5_ict_baie[3])),
								b4 << Set Background Color(RGB Color(93, 173, 226)),
								t4 << Set Width (w+pad_baie) << Set Font Size (sf),
								b5 = Border Box( Left( l ), Right( r ), Top( t ), Bottom( b ), Sides( s ), t5 = Text Box (filtered_top5_ict_baie[4])),
								b5 << Set Background Color(RGB Color(93, 173, 226)),
								t5 << Set Width (w+pad_baie) << Set Font Size (sf),
								b6 = Border Box( Left( l ), Right( r ), Top( t ), Bottom( b ), Sides( s ), t6 = Text Box (filtered_top5_ict_baie[5])),
								b6 << Set Background Color(RGB Color(93, 173, 226)),
								t6 << Set Width (w+pad_baie) << Set Font Size (sf)
							),
							//Colonne Ref. Produit
							V List Box(
								b7 = Border Box( Left( l ), Right( r ), Top( t ), Bottom( b ), Sides( s ), t7 = Text Box ("Product. Ref")),
								b7 << Set Background Color(RGB Color(133, 193, 233)),
								t7 << Set Width (w+pad_ref) << Set Font Size (sf)<< Set Font Style ("Bold"),
								b8 = Border Box( Left( l ), Right( r ), Top( t ), Bottom( b ), Sides( s ), t8 = Text Box (filtered_top5_ict_ref_pdt[1])),
								b8 << Set Background Color(RGB Color(133, 193, 233)),
								t8 << Set Width (w+pad_ref) << Set Font Size (sf),
								b9 = Border Box( Left( l ), Right( r ), Top( t ), Bottom( b ), Sides( s ), t9 = Text Box (filtered_top5_ict_ref_pdt[2])),
								b9 << Set Background Color(RGB Color(133, 193, 233)),
								t9 << Set Width (w+pad_ref) << Set Font Size (sf),
								b10 = Border Box( Left( l ), Right( r ), Top( t ), Bottom( b ), Sides( s ), t10 = Text Box (filtered_top5_ict_ref_pdt[3])),
								b10 << Set Background Color(RGB Color(133, 193, 233)),
								t10 << Set Width (w+pad_ref) << Set Font Size (sf),
								b11 = Border Box( Left( l ), Right( r ), Top( t ), Bottom( b ), Sides( s ), t11 = Text Box (filtered_top5_ict_ref_pdt[4])),
								b11 << Set Background Color(RGB Color(133, 193, 233)), 
								t11 << Set Width (w+pad_ref) << Set Font Size (sf),
								b12 = Border Box( Left( l ), Right( r ), Top( t ), Bottom( b ), Sides( s ), t12 = Text Box (filtered_top5_ict_ref_pdt[5])),
								b12 << Set Background Color(RGB Color(133, 193, 233)),
								t12 << Set Width (w+pad_ref) << Set Font Size (sf),
							),
							//Colonne Nb. de tests
							V List Box(
								b13 = Border Box( Left( l ), Right( r ), Top( t ), Bottom( b ), Sides( s ), t13 = Text Box ("Tests. Nb")),
								b13 << Set Background Color(RGB Color(174, 214, 241)),
								t13 << Set Width (w) << Set Font Size (sf)<< Set Font Style ("Bold"),
								b14 = Border Box( Left( l ), Right( r ), Top( t ), Bottom( b ), Sides( s ), t14 = Text Box (filtered_total_ict[1])),
								b14 << Set Background Color(RGB Color(174, 214, 241)),
								t14 << Set Width (w) << Set Font Size (sf),
								b15 = Border Box( Left( l ), Right( r ), Top( t ), Bottom( b ), Sides( s ), t15 = Text Box (filtered_total_ict[2])),
								b15 << Set Background Color(RGB Color(174, 214, 241)),
								t15 << Set Width (w) << Set Font Size (sf),
								b16 = Border Box( Left( l ), Right( r ), Top( t ), Bottom( b ), Sides( s ), t16 = Text Box (filtered_total_ict[3])),
								b16 << Set Background Color(RGB Color(174, 214, 241)),
								t16 << Set Width (w) << Set Font Size (sf),
								b17 = Border Box( Left( l ), Right( r ), Top( t ), Bottom( b ), Sides( s ), t17 = Text Box (filtered_total_ict[4])),
								b17 << Set Background Color(RGB Color(174, 214, 241)),
								t17 << Set Width (w) << Set Font Size (sf),
								b18 = Border Box( Left( l ), Right( r ), Top( t ), Bottom( b ), Sides( s ), t18 = Text Box (filtered_total_ict[5])),
								b18 << Set Background Color(RGB Color(174, 214, 241)),
								t18 << Set Width (w) << Set Font Size (sf),
							),
							//Colonne %NOK
							V List Box (
								b19 = Border Box( Left( l ), Right( r ), Top( t ), Bottom( b ), Sides( s ), t19 = Text Box ("%NOK")),
								b19 << Set Background Color(RGB Color(214, 234, 248)),
								t19 << Set Width (w+pad_nok) << Set Font Size (sf)<< Set Font Style ("Bold"),
								b20 = Border Box( Left( l ), Right( r ), Top( t ), Bottom( b ), Sides( s ), t20 = Text Box (Substr(Char(filtered_top5_ict_nb[1]), 1, 4))),
								b20 << Set Background Color(RGB Color(214, 234, 248)),
								t20 << Set Width (w+pad_nok) << Set Font Size (sf),
								b21 = Border Box( Left( l ), Right( r ), Top( t ), Bottom( b ), Sides( s ), t21 = Text Box (Substr(Char(filtered_top5_ict_nb[2]), 1, 4))),	
								b21 << Set Background Color(RGB Color(214, 234, 248)),
								t21 << Set Width (w+pad_nok) << Set Font Size (sf),
								b22 = Border Box( Left( l ), Right( r ), Top( t ), Bottom( b ), Sides( s ), t22 = Text Box (Substr(Char(filtered_top5_ict_nb[3]), 1, 4))),
								b22 << Set Background Color(RGB Color(214, 234, 248)),
								t22 << Set Width (w+pad_nok) << Set Font Size (sf),
								b23 = Border Box( Left( l ), Right( r ), Top( t ), Bottom( b ), Sides( s ), t23 = Text Box (Substr(Char(filtered_top5_ict_nb[4]), 1, 4))),
								b23 << Set Background Color(RGB Color(214, 234, 248)),
								t23 << Set Width (w+pad_nok) << Set Font Size (sf),
								b24 = Border Box( Left( l ), Right( r ), Top( t ), Bottom( b ), Sides( s ), t24 = Text Box (Substr(Char(filtered_top5_ict_nb[5]), 1, 4))),
								b24 << Set Background Color(RGB Color(214, 234, 248)),
								t24 << Set Width (w+pad_nok) << Set Font Size (sf),
							),
							//Colonne Code Erreur (nb. NOK)
							V List Box (
								b25 = Border Box( Left( l ), Right( r ), Top( t ), Bottom( b ), Sides( s ), t25 = Text Box ("Error Code (NOK. nb)")),
								b25 << Set Background Color(RGB Color(235, 245, 251)),
								t25 << Set Width (w+pad_code) << Set Font Size (sf)<< Set Font Style ("Bold"),
								b26 = Border Box( Left( l ), Right( r ), Top( t ), Bottom( b ), Sides( s ), t26 = Text Box (filtered_top5_code_ict[1])),
								b26 << Set Background Color(RGB Color(235, 245, 251)),
								t26 << Set Width (w+pad_code) << Set Font Size (sf),
								b27 = Border Box( Left( l ), Right( r ), Top( t ), Bottom( b ), Sides( s ), t27 = Text Box (filtered_top5_code_ict[2])),	
								b27 << Set Background Color(RGB Color(235, 245, 251)),
								t27 << Set Width (w+pad_code) << Set Font Size (sf),
								b28 = Border Box( Left( l ), Right( r ), Top( t ), Bottom( b ), Sides( s ), t28 = Text Box (filtered_top5_code_ict[3])),
								b28 << Set Background Color(RGB Color(235, 245, 251)),
								t28 << Set Width (w+pad_code) << Set Font Size (sf),
								b29 = Border Box( Left( l ), Right( r ), Top( t ), Bottom( b ), Sides( s ), t29 = Text Box (filtered_top5_code_ict[4])),
								b29 << Set Background Color(RGB Color(235, 245, 251)),
								t29 << Set Width (w+pad_code) << Set Font Size (sf),
								b30 = Border Box( Left( l ), Right( r ), Top( t ), Bottom( b ), Sides( s ), t30 = Text Box (filtered_top5_code_ict[5])),
								b30 << Set Background Color(RGB Color(235, 245, 251)),
								t30 << Set Width (w+pad_code) << Set Font Size (sf),
							),
							//Colonne Product Name (Prod. Name)
							V List Box (
								bpnt = Border Box( Left( l ), Right( r ), Top( t ), Bottom( b ), Sides( s ), tbpnt = Text Box ("Prod. Name")),
								bpnt << Set Background Color(RGB Color(235, 245, 251)),
								tbpnt << Set Width (w+pad_prod) << Set Font Size (sf)<< Set Font Style ("Bold"),
								bpnt1 = Border Box( Left( l ), Right( r ), Top( t ), Bottom( b ), Sides( s ), tbpnt1 = Text Box (filtered_top5_ict_prd_name[1])),
								bpnt1 << Set Background Color(RGB Color(235, 245, 251)),
								tbpnt1 << Set Width (w+pad_prod) << Set Font Size (sf),
								bpnt2 = Border Box( Left( l ), Right( r ), Top( t ), Bottom( b ), Sides( s ), tbpnt2 = Text Box (filtered_top5_ict_prd_name[2])),	
								bpnt2 << Set Background Color(RGB Color(235, 245, 251)),
								tbpnt2 << Set Width (w+pad_prod) << Set Font Size (sf),
								bpnt3 = Border Box( Left( l ), Right( r ), Top( t ), Bottom( b ), Sides( s ), tbpnt3 = Text Box (filtered_top5_ict_prd_name[3])),
								bpnt3 << Set Background Color(RGB Color(235, 245, 251)),
								tbpnt3 << Set Width (w+pad_prod) << Set Font Size (sf),
								bpnt4 = Border Box( Left( l ), Right( r ), Top( t ), Bottom( b ), Sides( s ), tbpnt4 = Text Box (filtered_top5_ict_prd_name[4])),
								bpnt4 << Set Background Color(RGB Color(235, 245, 251)),
								tbpnt4 << Set Width (w+pad_prod) << Set Font Size (sf),
								bpnt5 = Border Box( Left( l ), Right( r ), Top( t ), Bottom( b ), Sides( s ), tbpnt5 = Text Box (filtered_top5_ict_prd_name[5])),
								bpnt5 << Set Background Color(RGB Color(235, 245, 251)),
								tbpnt5 << Set Width (w+pad_prod) << Set Font Size (sf),
							)
						)
					)
				),

				

				Border Box(Left(25), Top(50), Bottom(200),
					//TOP 5 FCT
					V List Box(
						tb4 = Text Box( "Top 5 NOK results for FCT"),
						tb4 << Set Base Font( "Title" ),
						tb4 << Set Font Scale (2),
						H List Box(
							//Colonne Baie
							V List Box (
								b25b = Border Box( Left( l ), Right( r ), Top( t ), Bottom( b ), Sides( s ), t25b = Text Box ("Bay")),
								b25b << Set Background Color(RGB Color(245, 176, 65)),
								t25b << Set Width (w+pad_baie) << Set Font Size (sf)<< Set Font Style ("Bold"),
								b26b = Border Box( Left( l ), Right( r ), Top( t ), Bottom( b ), Sides( s ), t26b = Text Box (filtered_top5_fct_baie[1])),
								b26b << Set Background Color(RGB Color(245, 176, 65)),
								t26b << Set Width (w+pad_baie) << Set Font Size (sf),
								b27b = Border Box( Left( l ), Right( r ), Top( t ), Bottom( b ), Sides( s ), t27b = Text Box (filtered_top5_fct_baie[2])),
								b27b<< Set Background Color(RGB Color(245, 176, 65)),
								t27b << Set Width (w+pad_baie) << Set Font Size (sf),
								b28b = Border Box( Left( l ), Right( r ), Top( t ), Bottom( b ), Sides( s ), t28b = Text Box (filtered_top5_fct_baie[3])),
								b28b << Set Background Color(RGB Color(245, 176, 65)),
								t28b << Set Width (w+pad_baie) << Set Font Size (sf),
								b29b = Border Box( Left( l ), Right( r ), Top( t ), Bottom( b ), Sides( s ), t29b = Text Box (filtered_top5_fct_baie[4])),
								b29b << Set Background Color(RGB Color(245, 176, 65)),
								t29b << Set Width (w+pad_baie) << Set Font Size (sf),
								b30b = Border Box( Left( l ), Right( r ), Top( t ), Bottom( b ), Sides( s ), t30b = Text Box (filtered_top5_fct_baie[5])),
								b30b << Set Background Color(RGB Color(245, 176, 65)),
								t30b << Set Width (w+pad_baie) << Set Font Size (sf)
							),
							//Colonne Ref. Produit
							V List Box(
								b31 = Border Box( Left( l ), Right( r ), Top( t ), Bottom( b ), Sides( s ), t31 = Text Box ("Product. Ref")),
								b31 << Set Background Color(RGB Color(248, 196, 113)),
								t31 << Set Width (w+pad_ref) << Set Font Size (sf)<< Set Font Style ("Bold"),
								b32 = Border Box( Left( l ), Right( r ), Top( t ), Bottom( b ), Sides( s ), t32 = Text Box (filtered_top5_fct_ref_pdt[1])),
								b32 << Set Background Color(RGB Color(248, 196, 113)),
								t32 << Set Width (w+pad_ref) << Set Font Size (sf),
								b33 = Border Box( Left( l ), Right( r ), Top( t ), Bottom( b ), Sides( s ), t33 = Text Box (filtered_top5_fct_ref_pdt[2])),
								b33 << Set Background Color(RGB Color(248, 196, 113)),
								t33 << Set Width (w+pad_ref) << Set Font Size (sf),
								b34 = Border Box( Left( l ), Right( r ), Top( t ), Bottom( b ), Sides( s ), t34 = Text Box (filtered_top5_fct_ref_pdt[3])),
								b34 << Set Background Color(RGB Color(248, 196, 113)),
								t34 << Set Width (w+pad_ref) << Set Font Size (sf),
								b35 = Border Box( Left( l ), Right( r ), Top( t ), Bottom( b ), Sides( s ), t35 = Text Box (filtered_top5_fct_ref_pdt[4])),
								b35 << Set Background Color(RGB Color(248, 196, 113)), 
								t35 << Set Width (w+pad_ref) << Set Font Size (sf),
								b36 = Border Box( Left( l ), Right( r ), Top( t ), Bottom( b ), Sides( s ), t36 = Text Box (filtered_top5_fct_ref_pdt[5])),
								b36 << Set Background Color(RGB Color(248, 196, 113)),
								t36 << Set Width (w+pad_ref) << Set Font Size (sf),
							),
							//Colonne Nb. de tests
							V List Box(
								b37 = Border Box( Left( l ), Right( r ), Top( t ), Bottom( b ), Sides( s ), t37 = Text Box ("Tests. Nb")),
								b37 << Set Background Color(RGB Color(250, 215, 160)),
								t37 << Set Width (w) << Set Font Size (sf)<< Set Font Style ("Bold"),
								b38 = Border Box( Left( l ), Right( r ), Top( t ), Bottom( b ), Sides( s ), t38 = Text Box (filtered_total_fct[1])),
								b38 << Set Background Color(RGB Color(250, 215, 160)),
								t38 << Set Width (w) << Set Font Size (sf),
								b39 = Border Box( Left( l ), Right( r ), Top( t ), Bottom( b ), Sides( s ), t39 = Text Box (filtered_total_fct[2])),
								b39 << Set Background Color(RGB Color(250, 215, 160)),
								t39 << Set Width (w) << Set Font Size (sf),
								b40 = Border Box( Left( l ), Right( r ), Top( t ), Bottom( b ), Sides( s ), t40 = Text Box (filtered_total_fct[3])),
								b40 << Set Background Color(RGB Color(250, 215, 160)),
								t40 << Set Width (w) << Set Font Size (sf),
								b41 = Border Box( Left( l ), Right( r ), Top( t ), Bottom( b ), Sides( s ), t41 = Text Box (filtered_total_fct[4])),
								b41 << Set Background Color(RGB Color(250, 215, 160)),
								t41 << Set Width (w) << Set Font Size (sf),
								b42 = Border Box( Left( l ), Right( r ), Top( t ), Bottom( b ), Sides( s ), t42 = Text Box (filtered_total_fct[5])),
								b42 << Set Background Color(RGB Color(250, 215, 160)),
								t42 << Set Width (w) << Set Font Size (sf),
							),
							//Colonne %NOK
							V List Box (
								b43 = Border Box( Left( l ), Right( r ), Top( t ), Bottom( b ), Sides( s ), t43 = Text Box ("%NOK")),
								b43 << Set Background Color(RGB Color(253, 235, 208)),
								t43 << Set Width (w+pad_nok) << Set Font Size (sf)<< Set Font Style ("Bold"),
								b44 = Border Box( Left( l ), Right( r ), Top( t ), Bottom( b ), Sides( s ), t44 = Text Box (Substr(Char(filtered_top5_fct_nb[1]), 1, 4))),
								b44 << Set Background Color(RGB Color(253, 235, 208)),
								t44 << Set Width (w+pad_nok) << Set Font Size (sf),
								b45 = Border Box( Left( l ), Right( r ), Top( t ), Bottom( b ), Sides( s ), t45 = Text Box (Substr(Char(filtered_top5_fct_nb[2]), 1, 4))),	
								b45 << Set Background Color(RGB Color(253, 235, 208)),
								t45 << Set Width (w+pad_nok) << Set Font Size (sf),
								b46 = Border Box( Left( l ), Right( r ), Top( t ), Bottom( b ), Sides( s ), t46 = Text Box (Substr(Char(filtered_top5_fct_nb[3]), 1, 4))),
								b46 << Set Background Color(RGB Color(253, 235, 208)),
								t46 << Set Width (w+pad_nok) << Set Font Size (sf),
								b47 = Border Box( Left( l ), Right( r ), Top( t ), Bottom( b ), Sides( s ), t47 = Text Box (Substr(Char(filtered_top5_fct_nb[4]), 1, 4))),
								b47 << Set Background Color(RGB Color(253, 235, 208)),
								t47 << Set Width (w+pad_nok) << Set Font Size (sf),
								b48 = Border Box( Left( l ), Right( r ), Top( t ), Bottom( b ), Sides( s ), t48 = Text Box (Substr(Char(filtered_top5_fct_nb[5]), 1, 4))),
								b48 << Set Background Color(RGB Color(253, 235, 208)),
								t48 << Set Width (w+pad_nok) << Set Font Size (sf),
							),
							//Colonne Code Erreur (nb. NOK)
							V List Box(
								b49 = Border Box( Left( l ), Right( r ), Top( t ), Bottom( b ), Sides( s ), t49 = Text Box ("Error Code (NOK. nb)")),
								b49 << Set Background Color(RGB Color(254, 245, 231)),
								t49 << Set Width (w+pad_code) << Set Font Size (sf)<< Set Font Style ("Bold"),
								b50 = Border Box( Left( l ), Right( r ), Top( t ), Bottom( b ), Sides( s ), t50 = Text Box (filtered_top5_code_fct[1])),
								b50 << Set Background Color(RGB Color(254, 245, 231)),
								t50 << Set Width (w+pad_code) << Set Font Size (sf),
								b51 = Border Box( Left( l ), Right( r ), Top( t ), Bottom( b ), Sides( s ), t51 = Text Box (filtered_top5_code_fct[2])),
								b51 << Set Background Color(RGB Color(254, 245, 231)),
								t51 << Set Width (w+pad_code) << Set Font Size (sf),
								b52 = Border Box( Left( l ), Right( r ), Top( t ), Bottom( b ), Sides( s ), t52 = Text Box (filtered_top5_code_fct[3])),
								b52 << Set Background Color(RGB Color(254, 245, 231)),
								t52 << Set Width (w+pad_code) << Set Font Size (sf),
								b53 = Border Box( Left( l ), Right( r ), Top( t ), Bottom( b ), Sides( s ), t53 = Text Box (filtered_top5_code_fct[4])),
								b53 << Set Background Color(RGB Color(254, 245, 231)),
								t53 << Set Width (w+pad_code) << Set Font Size (sf),
								b54 = Border Box( Left( l ), Right( r ), Top( t ), Bottom( b ), Sides( s ), t54 = Text Box (filtered_top5_code_fct[5])),
								b54 << Set Background Color(RGB Color(254, 245, 231)),
								t54 << Set Width (w+pad_code) << Set Font Size (sf),
							),
							V List Box (
								bpnt6 = Border Box( Left( l ), Right( r ), Top( t ), Bottom( b ), Sides( s ), tbpnt6 = Text Box ("Prod. Name")),
								bpnt6 << Set Background Color(RGB Color(254, 245, 231)),
								tbpnt6 << Set Width (w+pad_prod) << Set Font Size (sf)<< Set Font Style ("Bold"),
								bpnt7 = Border Box( Left( l ), Right( r ), Top( t ), Bottom( b ), Sides( s ), tbpnt7 = Text Box (filtered_top5_fct_prd_name[1])),
								bpnt7 << Set Background Color(RGB Color(254, 245, 231)),
								tbpnt7 << Set Width (w+pad_prod) << Set Font Size (sf),
								bpnt8 = Border Box( Left( l ), Right( r ), Top( t ), Bottom( b ), Sides( s ), tbpnt8 = Text Box (filtered_top5_fct_prd_name[2])),	
								bpnt8 << Set Background Color(RGB Color(254, 245, 231)),
								tbpnt8 << Set Width (w+pad_prod) << Set Font Size (sf),
								bpnt9 = Border Box( Left( l ), Right( r ), Top( t ), Bottom( b ), Sides( s ), tbpnt9 = Text Box (filtered_top5_fct_prd_name[3])),
								bpnt9 << Set Background Color(RGB Color(254, 245, 231)),
								tbpnt9 << Set Width (w+pad_prod) << Set Font Size (sf),
								bpnt10 = Border Box( Left( l ), Right( r ), Top( t ), Bottom( b ), Sides( s ), tbpnt10 = Text Box (filtered_top5_fct_prd_name[4])),
								bpnt10 << Set Background Color(RGB Color(254, 245, 231)),
								tbpnt10 << Set Width (w+pad_prod) << Set Font Size (sf),
								bpnt11 = Border Box( Left( l ), Right( r ), Top( t ), Bottom( b ), Sides( s ), tbpnt11 = Text Box (filtered_top5_fct_prd_name[5])),
								bpnt11 << Set Background Color(RGB Color(254, 245, 231)),
								tbpnt11 << Set Width (w+pad_prod) << Set Font Size (sf),
							)
						)
					)
				)
			)
		)
	);
4 REPLIES 4
jthi
Super User

Re: Automatically Resize Column Widths in a results display

I would suggest you check out Lineup Box() as it can make stuff like this much easier.

-Jarmo
Yass
Level II

Re: Automatically Resize Column Widths in a results display

Thank you for your response. I am currently trying to understand how to apply these function in my situation.

jthi
Super User

Re: Automatically Resize Column Widths in a results display

Other option could be to utilize Table Box() with Col Box(). Then inside Col Box() you can use Text Boxes (I would suggest using String Col Box() but it most likely isn't flexible enough for your use).

 

Below are few very quickly created examples

Names Default To Here(1);

nw = New Window("A",
	V List Box(
		Text Box("Title1", << Set Font Style("Italic")),
		tb = Table Box(
			cb1 = Col Box("Bay", {}),
			cb2 = Col Box("Product. Ref", {}),
			cb3 = Col Box("Tests", {}),
		),
		Spacer Box(Size(0, 100)),
		Text Box("Title2", << Set Font Style("Italic")),
		lub = Lineup Box(N Col(3), 
			Text Box("Bay"),
			Text Box("Product. Ref"),
			Text Box("Tests")
		)
	)
);


cb1 << Background Color("Red");
cb1 << Append(Text Box("21025"));
cb1 << Append(Text Box("21025"));
cb1 << Append(Text Box("21025"));

cb2 << Background Color("Green");
cb2 << Append(Text Box("AAA"));
cb2 << Append(Text Box("BBB"));
cb2 << Append(Text Box("CCC"));

cb3 << Background Color("Blue");
cb3 << Append(Text Box("AAAAAAAAAAAAAAAAAAA"));
cb3 << Append(Text Box("BBBBBBBBBBBBBBBBBBB"));
cb3 << Append(Text Box("CCCCCCCCCCCCCCCCCCC"));


lub << Append(Text Box("21025"));
lub << Append(Text Box("AAA"));
lub << Append(Text Box("AAAAAAAAAAAAAAAAAAA"));
lub << Append(Text Box("21025"));
lub << Append(Text Box("BBB"));
lub << Append(Text Box("BBBBBBBBBBBBBBBBBBB"));
lub << Append(Text Box("21025"));
lub << Append(Text Box("CCC"));
lub << Append(Text Box("CCCCCCCCCCCCCCCCCCC"));

tbs = lub << XPath("//TextBox");

tbs[1::N ITems(tbs)::3] << Background Color("Red");
tbs[2::N ITems(tbs)::3] << Background Color("Green");
tbs[3::N ITems(tbs)::3] << Background Color("Blue");

jthi_0-1721305843160.png

 

-Jarmo
jthi
Super User

Re: Automatically Resize Column Widths in a results display

And then there are spacer boxes which you can use to force widths/heights/spacing. and many more options but it depends in the end what type of report you wish to have. To your existing code, implementing Spacer Boxes might be the easiest solution.

-Jarmo