How to design report with DesignerControl?

I use code like this. But designer will be show empty.
                Report report = new Report())
                Form form = new Form();
                DesignerControl designer = new DesignerControl();
                designer.Parent = form;
                designer.Dock = DockStyle.Fill;
                report.Designer = designer;
                report.Load(@"D:\MyReport.frx");
                report.RegisterData(MyDataTable, "MyTable");
                report.Prepare();
                report.Design();
                form.WindowState = FormWindowState.Maximized;
                form.Show();

Comments

  • edited September 2011
    Ok, I found problem.

    I need do this:
    designer.Report = report;
    
    instead of this:
    report.Designer = designer;
    

    Why it is in PreviewControl in opposite way that in Design control?
  • edited 12:20PM
    Hello,

    Try this:
                    Report report = new Report())
                    Form form = new Form();
                    DesignerControl designer = new DesignerControl();
                    designer.Parent = form;
                    designer.Dock = DockStyle.Fill;
                    report.Load(@"D:\MyReport.frx");
                    report.RegisterData(MyDataTable, "MyTable");
                    designer.Report = report;
                    form.WindowState = FormWindowState.Maximized;
                    form.Show();
    
  • edited September 2011
    to AlexTZ:
    Thank you for fast answer. Excatly hat was problem.
    Why it is different in preview control and designer control?

    Thank you.

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.