I have report created in MS Access 2013, which contains controls like labels, textboxes.
I want to access this controls in C# .net to check the width ,color properties of those controls.
I managed to find the report but I cannot find controls in that report.
How can I do that?
The code commented is the one which I have tried but does not got the result.
public bool CheckReport(AccessEntity acEntity, ACCESS.Application app)
{
try
{
ACCESS.AllReports report =(ACCESS.AllReports)app.CurrentProject.AllReports;
ACCESS.Controls objcntrls=null;
ACCESS.Section DetailSec; string strval;
//ACCESS.Report r = (ACCESS.Report)app.CurrentProject.AllReports[acEntity.Data];
//string strCap = (string)((dynamic)app.Reports[0]).Controls[acEntity.Rows].Caption;
//ACCESS.Report r = (ACCESS.Report)app.CurrentProject.AllReports[0];
//DetailSec = (ACCESS.Section)app.Reports[acEntity.Data].Section[0];
//objcntrls = (ACCESS.Controls)app.Reports[acEntity.Data].Controls;
string strwidth = objcntrls[acEntity.Field].Width.ToString();
strval = RemoveSpace(acEntity.PropertyValue);
if (strwidth == strval)
{
return true;
}
}
catch (System.Exception ex)
{ }
return false;
}