Quantcast
Channel: Our ComponentOne » All Posts
Viewing all articles
Browse latest Browse all 14170

Reply To: Page Layout Control – Variable Width Based on Expression

$
0
0

Hello,

The value of Size and Location of a control in case of page based layouts cannot be set to expressions.
such as "=Code.FunctionName()". It has to be set to valid values such with valid units.

In case you wish to custom set these values, you can do so in code if the parameters of your function 'x’.'y’ and 'z’ are static values independent of other control values.
You can access the Table control in code which is a part of ReportItems collection of report Body.

GrapeCity.ActiveReports.PageReport pgrpt= new GrapeCity.ActiveReports.PageReport();
GrapeCity.ActiveReports.PageReportModel.Table table = (GrapeCity.ActiveReports.PageReportModel.Table) pgrpt.Report.Body.ReportItems["Table1"];

The method CalculateWidth should return a string with 'in’ or 'cm’ appended.
table.Size.X =CalculateWidth();

Following blog may help you in accessing PageReport controls from code:

http://our.componentone.com/2014/01/17/creating-activereports-on-the-fly-part-ii/

In case you wish to adjust control size using methods which take arguments from other control properties/values you may try SectionReports wherein one gets full access of control growing, expanding, events.

Hope that helps
Best Regards,
Tuhina


Viewing all articles
Browse latest Browse all 14170

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>