Headers issues RRS feed

  • Question

  • I'm using Visual Basic 2005 + ReportViewer control.

    I want to use headers from a database table.

    The table has one record/row only.

    So I need to show just the first field for each column.

    (The report uses two tables, one with lots of data, the other for the headers only.)


    What is the proper way to do this?
    I'm using TextBoxes placed in the Body of the Report, then refer to those TextBoxes from the Header.

    The Body TextBoxes are Hidden.


    It works fine, except for:

    1) The TextBoxes need to be placed on top of (or under) the table with data, or to the left or right of the table.

    If they are placed below (where there's a lot of empty space), I get empty headers!

    (not on all pages, but on some)

    It seems the reason for this is that the table overlaps the TextBoxes, and they are not rendered.

    By the way, when I place the textboxes on top/below of the table, I get warnings from Visual Basic 2005 mentioning Overlapping problems, although the TextBoxes are Hidden... Smile

    Also, for it to work, the RepeatWith property of the TextBoxes in the Body needs to be set to Table1 (which is the table with lots of data).


    2) Export to Excel, when there are two pages or more, produces empty headers. PDF export is fine.

    One page Excel export is also fine.


    Maybe I need to create an extra, hidden row in the data table, then use that row to enter the header data? Is this a viable option?


    Edit: Tried to add a second Table control, tie it to the second Data Table, then use the textboxes in it... This didn't work (some pages showed blank headers). Is there a way to set RepeatWith of Table2 to Table1?? I get an error when I try this...


    NOTE: So, my Header TextBoxes are set (for example) to =ReportItems!tboxOrder.Value

    and the Body TextBoxes are set to ="Order: "&First(Fields!colOrder.Value, "dataTableDataSet_tblParams")

    Monday, September 17, 2007 12:26 PM