我需要找出报告中数据集中使用的DATASOURCE的NAME。是否有方法/表达式可以在报告中找到并显示它?
赞myDataset.DataSource.Name
...?
答案 0 :(得分:0)
试试这个
public class ActivityMain extends AppCompatActivity {
@State(SimCardsBundler.class)
SimCardLists simCards;
@BindView(R.id.simcard_lists)
RecyclerView simcardListItems;
@BindView(R.id.filter_by)
TextView filter_by;
@BindView(R.id.toolbar)
Toolbar toolbar;
private Context context;
private ActivityMain activity;
private Realm realm;
private Handler handler;
private List<SimCardLists> simcardLists;
private SimCardListAdapter adapter;
private ProgressDialog progressDialog;
private List<SimCardLists> simLists;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Icepick.restoreInstanceState(this, savedInstanceState);
setContentView(R.layout.activity_main);
ButterKnife.bind(this);
//@formatter:off
context = getBaseContext();
activity = ActivityMain.this;
realm = Realm.getDefaultInstance();
handler = new Handler();
simcardLists = realm.where(SimCardLists.class).findAll();
progressDialog = new ProgressDialog(this);
//@formatter:on
realm.executeTransaction(new Realm.Transaction() {
@Override
public void execute(Realm realm) {
realm.deleteAll();
}
});
SP.getInstance().setInt(SP.SharedPrefsTypes.currentRetrievePage, 0);
List<SimCardLists> initialize = new ArrayList<>();
simcardListItems.setLayoutManager(new LinearLayoutManager(context));
adapter = new SimCardListAdapter(context, initialize, simcardListItems);
simcardListItems.setAdapter(adapter);
if (realm.where(SimCardLists.class).count() <= 0) {
showProgressDialog();
startService(
new Intent(
context, WebService.class)
.putExtra("category", 0)
.putExtra("request_type", "getLatestSimCardNumbers")
);
}
if (savedInstanceState == null) {
Log.e("Its null", "");
simLists = realm.where(SimCardLists.class).findAll();
adapter.setData(simLists);
adapter.notifyDataSetChanged();
}else{
Log.e("NOT null", "");
}
}
@Override
protected void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
Icepick.saveInstanceState(this, outState);
}
}
将显示类似“/ DataSources / MyDatabase”的内容。它在预览模式下不起作用