locked
Adding multiple textboxes to PageHeader RRS feed

  • Question

  • I am creating matrix reports programmatically and have come up against a problem where I can only add a single textbox into the pageheader.  Writing the report using the report designer software I can add multiple textboxes to the pageheader, however trying to add many of them using the ReportItem object I keep getting a syste.object[] cannot be used in this context. error.

    for (int i = 0; i < Items.Count; i++)
                {
                    reportItems.Items = new object[] { CreateTextBox(ItemsIdea.ItemName, ItemsIdea.ItemMessage, ItemsIdea.ItemStyle) };
                }

    This is the line of code that I am hitting the problem.  This works fine, however only inserts the last textbox in the Items Array.

    If I change the code to

    for (int i = 0; i < Items.Count; i++)
                {
                    reportItems.ItemsIdea = new object[] { CreateTextBox(ItemsIdea.ItemName, ItemsIdea.ItemMessage, ItemsIdea.ItemStyle) };
                }

    It executes, but fails when trying to render it into XML.

    Has anyone managed to get multiple textboxes programatically into the pageheader?
    Tuesday, November 28, 2006 12:56 PM

All replies

  • Sorry about that, solved it

    reportItems.Items = new object[Items.Count];

    for (int i = 0; i < Items.Count; i++)
                {
                    reportItems.ItemsIdea = CreateTextBox(ItemsIdea.ItemName, ItemsIdea.ItemMessage, ItemsIdea.ItemStyle);
                }

    Simple really when you use the cardboard developer to bounce ideas off. :)
    Tuesday, November 28, 2006 1:01 PM