none
Report Viewer RDLC Heder RRS feed

  • Question

  • Hello Sir we are currently doing a project and in that for reports we are using Microsoft

    Report Viewer and RDLC forms and we need to place the company logo ,Name etc in the header

    of the page and the image is been bounded from database. Currently we had done that and we

    are getting the header logo and other fields only on the first page of the report.We are

    using Visualstudio 2005 c#.net as front end and oracle 9i as backend.
    Whats the Problem?
    Is this process applicable ? ie, whether we are able to bound the image and other textboxes

    from database as logo or name on header.

    The coding we had done is as follows:

    As per the MSDN

    For image binding,
    We added a text box in the body of the report and then set the text box to the data field

    that contains the image. We had hide the text box in the body of the report to avoid showing

    the base64 encoded image. Then, we had referred the value of the hidden text box from the

    Image control in the page header or footer.

    For example, suppose you have a report that consists of product information pages. In the

    header of each page, you want to display a photograph of the product. To print a stored

    image in the report header, define a hidden text box named TXT_Photo in the body of the

    report that retrieves the image from the database and use an expression to give it a value:


    =Convert.ToBase64String(Fields!Photo.Value)
     
    In the header, added an Image control which uses the TXT_Photo text box, decoded to show the

    image:

    =Convert.FromBase64String(ReportItems!TXT_Photo.Value)

    For textbox Fields
    In the same way we had done it for company name and address we created a table and bind it

    with database and hidden it and we refer the value from that hidden table.in the body of the

    report that retrieves the name from the database and use an expression to give it a value:
     
    =Fields!CompanyName.Value

    In the header, added a textbox control which uses the TxtAddressLine2 text box:

    =First(ReportItems!TxtAddressLine2.Value)

    Thursday, March 27, 2008 5:40 AM