Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Trouble in fixing the layout in a bizcard format (gridlayout)

Hello Experts,

I am using the below code. to display in data in bizcard.

in format

label1: text1

label2: text2

label3: text 3

but the data is showed up as

label1:

text1

label2

text2

label:

text3

can anyone suggest me the solution to correct this.

for (int k = 0; k < fieldInfo.length; k++)

{

IWDLabel labelView = (IWDLabel) view.createElement(IWDLabel.class, "labelView" + iBizCardLocation + k);

labelView.setText(fieldInfo[k].label);

IWDGridData labelGridData = (IWDGridData) labelView.createLayoutData(IWDGridData.class);

labelGridData.setWidth("100px");

labelView.setWidth("35%");

IWDTextView textView = (IWDTextView) view.createElement(IWDTextView.class, "textView" + iBizCardLocation + k);

textView.setText(elementRecord.getAttributeValue(fieldInfo[k].fieldname).toString());

groupBizCard.addChild(labelView);

groupBizCard.addChild(textView);

}

Thanks,

James

replied
IWDGridLayout grid = (IWDGridLayout) groupBizCard.getLayout();
grid.setColCount(2);
for (...)

This assumes that you already have assigned a GridLayout to the container "groupBizCard". Otherwise use

IWDGridLayout grid = (IWDGridLayout) groupBizCard.createLayout(IWDGridLayout.class);
...

Armin

0 View this answer in context

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question