Change XSD / XML dataset during runtime and display texts in field explorer
Hi there,
I am changing the datasource of a report during runtime. Afterwards, I would like to change the texts of the fields appearing in the field explorer.
I tried:
CrystalDecisions.ReportAppServer.DataDefModel.XMLDataSetClass xmlDS =
new CrystalDecisions.ReportAppServer.DataDefModel.XMLDataSetClass();
byte[] xmlContent = reportContent.getXmlContent();
byte[] xsdContent = reportContent.getXsdContent();
CrystalDecisions.ReportAppServer.CommonObjectModel.ByteArray xmlData =
new CrystalDecisions.ReportAppServer.CommonObjectModel.ByteArray();
CrystalDecisions.ReportAppServer.CommonObjectModel.ByteArray xsdData =
new CrystalDecisions.ReportAppServer.CommonObjectModel.ByteArray();
xmlData.ByteArray = xmlContent;
xmlDS.XMLData = xmlData;
xsdData.ByteArray = xsdContent;
xmlDS.XMLSchema = xsdData;
rasDoc.DatabaseController.SetDataSource(xmlDS, "", "");
rasDoc.Database.Tables[0].Description = "POMMES";
for (int i = 0; i < rasDoc.DatabaseController.Database.Tables[0].DataFields.Count; i++)
{
rasDoc.Database.Tables[0].DataFields.Name = "TEST";
MessageBox.Show(rasDoc.Database.Tables[0].DataFields.Name);
rasDoc.Database.Tables[0].DataFields.HeadingText = "HOORAY";
rasDoc.Database.Tables[0].DataFields.Description = "NOPE";
MessageBox.Show(rasDoc.Database.Tables[0].DataFields.Description);
MessageBox.Show(rasDoc.Database.Tables[0].DataFields.HeadingText);
}
When running this, the message boxes include the right strings I set before but when this is done, the filed explorer still shows no changes. What am I doing wrong?
Also, I would like to change the field texts that are displayed in the field explorer. How can this be done?
Thanks,
Pascal