accessing ms access report controls in C#.net
I have creted report in MS Access. I want to check width of label exists
in report. But m not getting access to controls of report. Following is my
code which I have tried.
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;
}
No comments:
Post a Comment