Upgrade to v4 - Report Issue

In my dispatch work order I have a field that contains the code: dir=ltr " ">

using DevExpress.XtraPrinting;
using DevExpress.XtraReports.UI;
using DevExpress.XtraReports.Native;
// …

string lastID = “”;
int pageNumber = 0;

private void OnPrintOnPage(object sender, DevExpress.XtraReports.UI.PrintOnPageEventArgs e) {

string curID = ((XRLabel)sender).Tag.ToString();
int pageCount = 0;

foreach (Page page in xtraReport1.PrintingSystem.document.Pages) {
BrickEnumerator brickEnum = page.GetEnumerator();

while (brickEnum.MoveNext()) {
XRBrick brick = brickEnum.Current as XRBrick;
if (brick != null && brick.Data.Control == (XRLabel)sender) {
if (brick.Data.Tag.ToString() == curID)

if (curID == lastID)
pageNumber = 1;

lastID = curID;
((XRLabel)sender).Text = "Issue: " + pageNumber.ToString() + " of " +


This worked perfectly in version 3. In version 4 I get the error:

xrlabel16.OnPrintPage, Line 15: error CS0246: The type or namespace name ‘XRBrick’ could not be found (Are you missing a using directive or an assembly reference?)

Can you please provide some input as to what the problem might be? Thanks kindly.


If posting a question about report design, do always provide an attachment of your customreport template, or if you know the same issue occurs with an existing sample report template, to identify that report template by the link to its topic posting so that I can obtain that report template and be able to have it to fully look at so that I can help troubleshoot.

By providing an actual example, than I have something concreate to work with to see what is exactly happening. As my ESP does not work that well, I won’t be able to help troubleshoot unless I have an actual report template to refer to.

In this instance, I did a search for xrBrick and came up with the topic http://forum.ayanova.com/Topic3555-103-1.aspx

Please see the new posting for this topic regarding Pages per WO script to use with AyaNova 4

  • Joyce

The solution that you posted in the linked topic did resolve the initial two errors but now the following errors comes up on your modified script:

xrlabel16.OnPrintPage, Line 15: error CS0117: 'DevExpress.XtraPrinting.PrintingSystem’does not contain a definition for ‘document’.

I mistyped the one bit … It should read line 11


I get no error when I print out that sample AyaNova 4 with Pages per WO report template.

Perhaps you have mis-edited the script in your custom report template. As you did not attach your report template, I won;t be able to provide specific help without it.

  • Joyce