我正在尝试通过使用 Vlookup 填充列来计算从图纸计划到图纸结果的组件数量,具有:
Count_col: 是工作表中的总列 PlanLast_col: 是工作表中的总列Result(在添加列需求之前)工作表结果
| 材料 | 成分 | 需求W1 | 需求 W2 |
|---|---|---|---|
| ABCD1000 | NC200 | #姓名? | #姓名? |
图纸计划
| 材料 | 需求W1 | 需求 W2 |
|---|---|---|
| ABCD1000 | 1000 | 200 |
For i = 1 To count_col
Cells(1, i + last_col).Value = "=Plan!RC[-2]"
Cells(1, i + last_col).Offset(1, 0).Select
ActiveCell.FormulaR1C1 = "=VLOOKUP(RC1,Plan!C1:C15,i+1,0)"
Next i
Run Code Online (Sandbox Code Playgroud)
但结果是名称错误,我检查了函数的拼写是否正确,不知道如何修复。为什么我的公式中有“@”?
错误详情
=VLOOKUP($A2,Plan!$A:$O,@i+1,0)
Run Code Online (Sandbox Code Playgroud) 我希望以这样的方式修改我的代码,使列扩展以容纳数据.
下面是一个断行的示例
+========+=========+===============+=============+=============+
| Record | Cluster | Current Build | Current Use | Environment |
+--------+---------+---------------+-------------+-------------+
| 3 | 1 | v44 | v44 Live (currently - new company cluster)| PROD |
+--------+---------+---------------+-------------+-------------+
Run Code Online (Sandbox Code Playgroud)
这是我正在使用的(kludgy)代码
sub printData {
if (@_) {
# print the data grid top border
printf ("%10s%10s%15s%14s%14s",'+'.('=' x 8).'+',('=' x 9).'+',('=' x 15).'+',('=' x 13).'+',('=' x 13).'+');
print "\n";
# print the data grid column titles
printf ("%-9s%-10s%-16s%-14s%-15s",'| Record ','| Cluster ','| Current Build ','| Current Use …Run Code Online (Sandbox Code Playgroud) 我有一个带有生成的动态列的数据表。我有一个要显示的日期列,但格式特殊
在没有动态列生成的数据表中...我通过这种方式使日期以特定格式显示
<p:dataTable .....>
<p:column headerText="Date" id="dateID"
sortBy="#{iterator.updatedDate}"
filterBy="#{iterator.updatedDate}">
<h:outputText value="#{iterator.updatedDate}">
<f:convertDateTime pattern="MM-dd-yyyy" />
</h:outputText>
</p:column>
</p:dataTable>
Run Code Online (Sandbox Code Playgroud)
我该怎么做才能在动态表的数据表中获得相同的结果...
能帮我解决这个问题吗?
我正在尝试动态地生成dataTable带有列的 a ,因此List<List>
当Lista 的内部List是我的列的内容时,我有一个 a ,但是当我尝试显示它时,我无法显示太多。
所以,这是我的 Bean 的代码:
@ManagedBean
@javax.faces.bean.ViewScoped
public class Controlador {
private List<List> estadistico;
@PostConstruct
public void inicializar(){
this.estadistico = new ArrayList<List>();
this.estadistico.add( Arrays.asList( new Integer[]{0,1,24}));
this.estadistico.add( Arrays.asList( new Integer[]{5,1,34}));
this.estadistico.add( Arrays.asList( new Integer[]{12,1,4}));
}
//getter's and setter's
}
Run Code Online (Sandbox Code Playgroud)
这就是视图:
<h:form>
<!-- estadistico is List<List> -->
<p:dataTable value="#{controlador.estadistico}" var="lista">
<!-- lista is List of numbers
and I suppose that value is each number
-->
<p:columns value="#{lista}" var="value" > …Run Code Online (Sandbox Code Playgroud) 我目前正在使用引导网格系统,但遇到以下问题:
>平板电脑时,我将组件堆叠成4列。并在2列时<平板电脑。有些组件带有链接,有些没有。
<div class="col-xs-6 col-md-3">
<p><img src="http://www.photoshopbuzz.com/wp-content/uploads/2011/11/red-stitch-icon-122-bebo.png" alt="" title="" class="easy-icon" /></p>
<div class="iconname">Test1</div>
<div class="text align-left icondescription">Sit amet, consetetur adipscing elitr, sed diam non umy eirmod tempor invidunt.</div>
<div class="align-left"><a href="product.html" class="product-button"><span class="arrow">></span> ABCDE TEST1 PRODUCTS</a></div>
</div>
Run Code Online (Sandbox Code Playgroud)
这可以正常工作,但宽度在440px和485px之间,带有以下链接:> ABCDE TEST1 PRODUCTS会出现中断行,因为不再有空间。它会一直持续到带有> ABCDE TES PRODUCTS的第二个链接(该标签的字符较少)中断。
现在,我尝试设置“空白:nowrap;”。在链接上,但<400px看起来效果不好,因为它们相互重叠。
有人可以帮助我吗?
是否可以在DataTables.net中呈现自定义列?我已经阅读了很多教程和文档,但无法使其正常工作.我想用链接创建第三列,我使用第一列的信息.我的代码看起来像这样:
$(document).ready(function () {
$('#categories').DataTable({
"ajax": '@Url.Action("Table", "Categories")',
"columns": [
{ "data": "Name" },
{ "data": "Parent" },
null
],
"columnsDefs": [
{
"render": function(data){
return "<a href='~/Admin/Categories/Edit' + data.Name + '>EDIT</a>";
},
"targets": 0
}
]
});
});
Run Code Online (Sandbox Code Playgroud)
在json中,我只获取Name和Parent列信息.有什么想法在里面创建名字的第三列吗?谢谢!
我试图将具有多个行和列的表格取消.需要将每行扩展为具有特定列的2行,并且需要重命名列名称,并且需要根据所选列添加新列!
我包括样本数据之前和之后以及设置数据的脚本.
CREATE TABLE #tmpProducts (
ProductId INT,
ProductName nVARCHAR(100),
B2B_GrossRevenue DECIMAL(10,2),
B2B_DirectCost DECIMAL(10,2),
B2B_NetRevenue DECIMAL(10,2),
B2C_GrossRevenue DECIMAL(10,2),
B2C_DirectCost DECIMAL(10,2),
B2C_NetRevenue DECIMAL(10,2)
)
INSERT INTO #tmpProducts SELECT 1, 'Product1',1545.00,406.25,1138.75,195.00,35.10,159.90
INSERT INTO #tmpProducts SELECT 2, 'Product2',902.00,189.00,713.00,3280.00,590.40,2689.60
INSERT INTO #tmpProducts SELECT 3, 'Product3',15665.00,3988.39,11676.61,6247.00,1124.46,5122.54
INSERT INTO #tmpProducts SELECT 4, 'Product4',736.00,196.16,539.84,2395.00,431.10,1963.90
SELECT * FROM #tmpProducts
DROP TABLE #tmpProducts
CREATE TABLE #tmpProducts2 (
ProductId INT,
ProductName nVARCHAR(100),
[Type] nVARCHAR(3),
GrossRevenue DECIMAL(10,2),
DirectCost DECIMAL(10,2),
NetRevenue DECIMAL(10,2)
)
INSERT INTO #tmpProducts2 SELECT 1, 'Product1','B2B',1545.00,406.25,1138.75
INSERT INTO #tmpProducts2 …Run Code Online (Sandbox Code Playgroud) 我的问题是如何在JTable中设置动态行数和列数?我的意思是,如果用户要创建一个2行2列的表,则只需键入数字即可。我该怎么做,我尝试使用DefaultModel失败。
我将不胜感激。
谢谢
我正在使用primefaces 4.0,JSF Mojarra 2.2.2,这是我的数据代码:
<p:dataTable id="tabexam"
paginatorPosition="bottom"
var="exam"
value="#{dyna.examViewDataModel}"
widgetVar="examTable"
emptyMessage="aucun résultat trouvé pour votre recherche"
paginator="true"
rows="40"
selection="#{dyna.selectedExamen}"
filteredValue="#{dyna.filteredexams}"
selectionMode="single"
resizableColumns="true"
draggableColumns="true"
paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
rowsPerPageTemplate="40,80,120">
<p:columns value="#{datatableBean.table}"
var="column"
headerText="#{column.userListname}"
rendered="#{column.visible}"
resizable="#{column.resizable}"
width="#{column.width}"
columnIndexVar="colIndex">
<h:panelGroup>
<p:outputLabel value="#{column.dbname}" styleClass="fonty"/>
</h:panelGroup>
</p:columns>
</p:dataTable>
Run Code Online (Sandbox Code Playgroud)
这是我到目前为止所尝试的,但是我在控制台中得到空的字符串getHeaderText并且空宽度,我想知道我错过了什么
UIViewRoot view = FacesContext.getCurrentInstance().getViewRoot();
DataTable tabler = (DataTable) view.findComponent(":form1:tabexam");
List<UIColumn> coler = tabler.getColumns();
for (int i = 0; i < coler.size(); i++) {
System.out.println("/////////////////");
System.out.println(coler.get(i).getValueExpression("headerText").getValue(FacesContext.getCurrentInstance().getELContext()));
System.out.println(coler.get(i).getHeaderText());
System.out.println(coler.get(i).isRendered());
System.out.println(coler.get(i).isResizable());
System.out.println(coler.get(i).getWidth());
System.out.println("/////////////////");
}
System.out.println(coler.size());
Run Code Online (Sandbox Code Playgroud)
请注意,它 …
我开始使用Bootstrap 4进行开发,现在发现了这个问题:当使用Bootstrap 3列系统时,由于它使用浮点数,我们可以在一行中插入多列,然后根据指定的“ col-size”填充空间,例如这个 :
http://codepen.io/seltix/pen/QpXvRJ
------- ------- -------
| COL 1 | | COL 2 | | COL 3 |
| | ------- -------
| | | COL 4 | | COL 5 |
------- ------- -------
<div class="container-fluid">
<div class="row">
<div class="col-sm-6 panel height-1">
<div class="bg-danger">this box is a slider with fixed col-6 width and fixes 2 blue boxes height</div>
</div>
<div class="col-sm-3 panel height-2">
<div class="bg-info">blue boxes count may change depending on the content.<br>if there are only …Run Code Online (Sandbox Code Playgroud) 我已经在Stack上看到了很多解决方案,但似乎没有一个对我有用,所以我试着根据我看到别人做的事来写它.
我能够计算列并开始新行,但问题是,因为我在foreach中执行此操作(从DB获取数据),现在它将从DB中放置每个条目4次 - >关闭该行; 开始一个新的行 - >并显示DB的第二个条目4次 - >关闭该行; 开始一个新的行 - >并显示DB的第三个条目4次,依此类推...... (我的代码在这篇文章的底部)
所以,现在这段代码显示如下项目:
col-md3(item1) | col-md3(item1) | col-md3(item1) | col-md3(item1)
col-md3(item2) | col-md3(item2) | col-md3(item2) | col-md3(item2)
....
....
Run Code Online (Sandbox Code Playgroud)
但是,我希望它显示如下:
col-md3(item1) | col-md3(item2) | col-md3(item3) | col-md3(item4)
col-md3(item5) | col-md3(item6) | col-md3(item7) | col-md3(item8)
.... | ... | .... | ....
....
Run Code Online (Sandbox Code Playgroud)
我的代码现在:
foreach($data as $row) {
echo '<div class="row">';
for ($i=0; $i<4;$i++){
if ($i%4 == 0 && $i != 0){
echo '</div><div class="row">';
}
echo '<div class="col-md-3">';
?> …Run Code Online (Sandbox Code Playgroud) dynamic-columns ×11
datatable ×2
jsf-2 ×2
primefaces ×2
arrays ×1
bootstrap-4 ×1
css ×1
css-float ×1
datatables ×1
date-format ×1
dynamic ×1
excel ×1
foreach ×1
grid ×1
java ×1
jquery ×1
jsf ×1
jtable ×1
line-breaks ×1
perl ×1
php ×1
printf ×1
rows ×1
sql ×1
swing ×1
unpivot ×1
vba ×1
vlookup ×1