Solved

I am attempting to use a repeater to obtain multiple columns of data by year within an existing repeater by topic

Posted on 2014-09-30
7
235 Views
Last Modified: 2014-11-04
I am attempting to use a repeater to obtain multiple columns of data by year within an existing repeater by topic.

The number of years is variable so cannot be done as a static row.

This is a sample of the existing report and I would like to add a repeater to duplicate the Average column for each year in the list of years available.

•  This Preceptorship enabled me to
      Average
Obtain and record a thorough and reliable history.      
Obtain and record a thorough and reliable physical exam.      
Develop a problem list.      
Develop a list of possible etiologies (differential diagnosis.)      
Order appropriate studies.      
Recommend rational therapy.      
Communicate with health team.      
Increase proficiency in technical procedures.      
Increase knowledge of patient problems in primary care.      
Average of Above Ratings      

I’ve been experimenting and just can’t get the syntax right to generate the multiple columns.

This is the first few rows of code before adding a repeater.

                  <div class="indent" ">
                  <li class="label" style="margin-top:20px;">This Preceptorship enabled me to:</li>

<asp:Table ID="Table2" GridLines="Both" runat="server" >
         <asp:TableHeaderRow ID="TableHeaderRow1"  runat="server" >
                  <asp:TableHeaderCell ID="TableHeaderCell1" ColumnSpan="30"   HorizontalAlign="Left"  runat="server" TabIndex="0"
                 Text="" Wrap="True" />
                  <asp:TableHeaderCell ID="TableHeaderCell2" ColumnSpan="10"   HorizontalAlign="Right"  runat="server" TabIndex="1"
                 Text="Average" Wrap="True" />
                         
         </asp:TableHeaderRow >

         <asp:TableRow ID="TableRow41"  runat="server" >
                 <asp:TableCell ID="TableCell3" colspan="30"   HorizontalAlign="Left"  runat="server"  
                 Text="Obtain and record a thorough and reliable physical history." Wrap="False" />
                  <asp:TableCell ID="TableCell4"  width="4"    HorizontalAlign="Right"  runat="server"  aria-readonly="true" >
                 <input type = "text" value='<%#DataBinder.Eval(Container.DataItem, "objHistory")%>'" Wrap="False" >
                          </asp:TableCell>
         </asp:TableRow >

         <asp:TableRow ID="TableRow42"  runat="server" >
                 <asp:TableCell ID="TableCell5" colspan="30"   HorizontalAlign="Left"  runat="server"  
                 Text="Obtain and record a thorough and reliable physical exam." Wrap="False" />
                  <asp:TableCell ID="TableCell6"  width="4"    HorizontalAlign="Right"  runat="server"  aria-readonly="true" >
                 <input type = "text" value='<%#DataBinder.Eval(Container.DataItem, "objExam")%>'" Wrap="False" >
                          </asp:TableCell>
         </asp:TableRow >

         <asp:TableRow ID="TableRow3"  runat="server" >
                 <asp:TableCell ID="TableCell15" colspan="30"   HorizontalAlign="Left"  runat="server"  
                  Text="Develop a problem list." Wrap="False" />
                  <asp:TableCell ID="TableCell16"  width="4"    HorizontalAlign="Right"  runat="server"  aria-readonly="true" >
                 <input type = "text" value='<%#DataBinder.Eval(Container.DataItem, "objList")%>'" Wrap="False" >
                          </asp:TableCell>
         </asp:TableRow >

 
         <asp:TableRow ID="TableRow4"  runat="server" >
                 <asp:TableCell ID="TableCell22" colspan="30"   HorizontalAlign="Left"  runat="server"  
                 Text="Develop a list of possible etiologies (differential diagnosis.)" Wrap="False" />
                  <asp:TableCell ID="TableCell23"  width="4"    HorizontalAlign="Right"  runat="server"  aria-readonly="true" >
                 <input type = "text" value='<%#DataBinder.Eval(Container.DataItem, "objEtiologies")%>'" Wrap="False" >
                          </asp:TableCell>
         </asp:TableRow >
0
Comment
Question by:jrwalker1048
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
7 Comments
 
LVL 96

Expert Comment

by:Bob Learned
ID: 40363598
I don't see a Repeater, I see a <table> element.  If you have a table layout, did you try binding to a GridView?
0
 

Author Comment

by:jrwalker1048
ID: 40364233
I don’t have a repeater in the example because none of my attempts worked so I just included the base code for information on how to add the repeater for multiple columns.

If there is another way to add a variable number of columns that would be fine but every page may have a different number of columns so I thought a repeater would work.

thanks
0
 

Author Comment

by:jrwalker1048
ID: 40364252
Do you have sample code I can try?

Thank you for your expertise. Truly appreciated!
0
Space-Age Communications Transitions to DevOps

ViaSat, a global provider of satellite and wireless communications, securely connects businesses, governments, and organizations to the Internet. Learn how ViaSat’s Network Solutions Engineer, drove the transition from a traditional network support to a DevOps-centric model.

 
LVL 96

Accepted Solution

by:
Bob Learned earned 500 total points
ID: 40364788
With ASP.NET and the GridView, the binding depends on the type of data.

Here are some examples:

ASP.NET Quickstart Tutorials
http://quickstarts.asp.net/QuickStartv20/aspnet/doc/ctrlref/data/gridview.aspx

GridView + SqlDataSource Example:

  <asp:GridView ID="GridView1" DataSourceID="SqlDataSource1" AutoGenerateColumns="False"
      runat="server">
      <Columns>
        <asp:BoundField HeaderText="ID" DataField="au_id" ReadOnly="true" />
        <asp:BoundField HeaderText="Last Name" DataField="au_lname" />
        <asp:BoundField HeaderText="First Name" DataField="au_fname" />
        <asp:BoundField HeaderText="Phone" DataField="phone" />
        <asp:BoundField HeaderText="Address" DataField="address" />
        <asp:BoundField HeaderText="City" DataField="city" />
        <asp:BoundField HeaderText="State" DataField="state" />
        <asp:BoundField HeaderText="Zip Code" DataField="zip" />
        <asp:CheckBoxField HeaderText="Contract" DataField="contract" />
      </Columns>
    </asp:GridView>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
      SelectCommand="SELECT [au_id], [au_lname], [au_fname], [phone], [address], [city], [state], [zip], [contract] FROM [authors]"
      ConnectionString="<%$ ConnectionStrings:Pubs %>" />

Open in new window

0
 
LVL 33

Expert Comment

by:Big Monty
ID: 40422391
I've requested that this question be closed as follows:

Accepted answer: 500 points for Bob Learned (TheLearnedOne)'s comment #a40364788

for the following reason:

This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0
 

Author Closing Comment

by:jrwalker1048
ID: 40422392
Thank you for your assistance
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Developer tools in browsers have been around for a while, yet they are still heavily underused by developers. Developers still fix html or CSS then refresh page to see effect, or they put alert or debugger in JavaScript and then try again and again …
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
This video teaches users how to migrate an existing Wordpress website to a new domain.
Learn how to set-up PayPal payment integration in your Wufoo form. Allow your users to remit payment through PayPal upon completion of your online form. This is helpful for collecting membership payments, customer payments, donations, and more.

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question