Skip to Content
author's profile photo Former Member
Former Member

cannot see data in SAP.Web.UI.Controls.Table

Hi,I have created a portal project and dragged a sap table into the design area. then i call a webservice and bind the resulting dataset to the table. the dataset seems to bind, since i can see there are the right number of pages in the table, but i cannot see any of the data. all the rows are blank. am i treating the ascx file correctly? i deploy and browse to test it.

this is the code in the aspx:


<%@ Register TagPrefix="sap" Namespace="SAP.Web.UI.Controls" Assembly="SAP.Web, Version=, Culture=neutral, PublicKeyToken=50436dca5c7f7d23" %>

<%@ Control language="vb" Codebehind="PortalComponent1.ascx.vb" AutoEventWireup="false" Inherits="pdkdemo2.PortalComponent1" targetSchema="" %>

<! %@ PortalComponent name="PortalComponent1" % >

<LINK href="C:\Program Files\SAP\SAP Portal Development Kit for .NET 1.0\Controls\ur\ur_design.css"

type="text/css" rel="stylesheet">

<body class="prtlBody">

<sap:Table id="Table1" runat="server">

<sap:Caption Text="Table" ID="Caption2"></sap:Caption>

<sap:TableRow ID="Table1_ItemTemplate">

<sap:TableCell ID="TableCell4" Title="Column1">

<sap:TextView ID="TextView4"></sap:TextView>


<sap:TableCell ID="TableCell5" Title="Column2">

<sap:TextView ID="TextView5"></sap:TextView>


<sap:TableCell ID="TableCell6" Title="Column3">

<sap:TextView ID="TextView6"></sap:TextView>






and this is the code behind:

Imports System

Imports System.Collections

Imports System.ComponentModel

Imports System.Data

Imports System.Drawing

Imports System.Web

Imports System.Web.UI

Imports SAP.Portal.Web.UI

Imports SAP.UI

Imports SAP.Web.UI.Controls

Public class PortalComponent1

Inherits SAP.Portal.Web.UI.PortalComponent

Protected WithEvents Table1 As SAP.Web.UI.Controls.Table

Protected WithEvents Caption1 As SAP.Web.UI.Controls.Caption

Protected WithEvents Table1_ItemTemplate As SAP.Web.UI.Controls.TableRow

Protected WithEvents TableCell1 As SAP.Web.UI.Controls.TableCell

Protected WithEvents TextView1 As SAP.Web.UI.Controls.TextView

Protected WithEvents TableCell2 As SAP.Web.UI.Controls.TableCell

Protected WithEvents TextView2 As SAP.Web.UI.Controls.TextView

Protected WithEvents TableCell3 As SAP.Web.UI.Controls.TableCell

Protected WithEvents Caption2 As SAP.Web.UI.Controls.Caption

Protected WithEvents TableCell4 As SAP.Web.UI.Controls.TableCell

Protected WithEvents TextView4 As SAP.Web.UI.Controls.TextView

Protected WithEvents TableCell5 As SAP.Web.UI.Controls.TableCell

Protected WithEvents TextView5 As SAP.Web.UI.Controls.TextView

Protected WithEvents TableCell6 As SAP.Web.UI.Controls.TableCell

Protected WithEvents TextView6 As SAP.Web.UI.Controls.TextView

Protected WithEvents TextView3 As SAP.Web.UI.Controls.TextView

Private Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load

Dim proxy As New secblrnd.Service1

Dim ds As DataSet

ds = proxy.GetData("U020_EQUIP", "ALL", "NO", 0, "MOODLET1", "MOODLET1")

Table1.DataSource = ds


End Sub

#Region "Web Form Designer generated code"

Protected Overrides Sub OnInit(ByVal e As EventArgs)


' CODEGEN: This call is required by the ASP.NET Web Form Designer.




End Sub

' Required method for Designer support - do not modify

' the contents of this method with the code editor.

Private Sub InitializeComponent()

End Sub

#End Region

End class


any assistance would be highly appreciated.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Feb 27, 2005 at 09:49 AM


    The problem is that the SAP table doesn't support this kind of "dynamic binding" at the moment. The SAP table can contain any one of several controls in each cell, and these controls have several possible properties to bind to. So currently you have to "tell" the table what you want to bind to.

    You have several options:

    1. The easiest option, if you can create a typed dataset in design-time, according to what your webservice returns, then do that... and then put an instance of it on your portal component, and bind your table to that typed dataset (using the designer property grid). This should create a default ItemTemplate with all textViews in the cells, and the texts will be bound to the columns.

    2. Write code in ItemCreated Event handler of the table. This event will be raised for each row in the DS. There you can tell the cells to get the data from the content. Remember that you'd have to create the cells according to the number of columns and set the content of each cell to be what control you want (like TextView) and then fill the properties of that control.

    3. If you know the Data structure, but don't want to or can't create a typed DataSet - First define the columns using the designer (right click the table, select "edit columns"). Then in the event handler (from "2") just set the property "text" of each TextView which is in the content of each cell (use the Cell's property "TableCellContent" to get to the TextView control)

    4. Don't use databinding and create the table contents completely manually (See here -


    One last thing, here's a link to some more explanations about DataBinding in SAP controls:

    If you choose a solution and need more help, just ask. 😊



    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.