Quantcast
Channel: Visual COBOL - Forum - Recent Threads
Viewing all articles
Browse latest Browse all 4356

COBCH1623 error when attach method

$
0
0

This line of code gives the error "COBCH1623: Anonymous method or method group cannot be cast to type DevExpress.XtraPrinting.CreateAreaEventHander.":

ATTACH METHOD link__CreateReportHeaderArea to link::CreateReportHeaderArea

This is the C# code that I'm converting to Visual COBOL:

      private void btnPrint_Click(object sender, EventArgs e)
        {
            IPrintable component = gridControl1;
            PrintableComponentLinkBase link = new PrintableComponentLinkBase()
            {
                PrintingSystemBase = new PrintingSystemBase(),
                Component = component,
            };
            link.CreateReportHeaderArea += link_CreateReportHeaderArea;

        }
        private void link_CreateReportHeaderArea(object sender,
        CreateAreaEventArgs e)
        {
            string reportHeader = "Categories Report";
            e.Graph.StringFormat = new BrickStringFormat(StringAlignment.Center);
            e.Graph.Font = new Font("Tahoma", 14, FontStyle.Bold);
            RectangleF rec = new RectangleF(0, 0, e.Graph.ClientPageSize.Width, 50);
            e.Graph.DrawString(reportHeader, Color.Black, rec, BorderSide.None);
        }

I don't get the error in C#, just COBOL, and I am not able to subscribe to the CreateReportHeaderArea event.  Any ideas on how to get this working?


Viewing all articles
Browse latest Browse all 4356

Trending Articles



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