473,394 Members | 2,063 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Can anybody help me to print the repeater data with background colors of the cells

4
Hi all,
Can anybody help me to print the repeater data from asp.net page? I am binding two columns of the repeater table. It is including the background color, which is fetching from the database. I am really stucked in this. Some javascript functions not printing the color or the table.
My repeater control is below.
Expand|Select|Wrap|Line Numbers
  1. <asp:Repeater ID="repeaterTT" runat="server">
  2. <HeaderTemplate>
  3. <Table border="1px" id="tblTT" cellpadding="0" cellspacing="0" style="border-color:Black;" 
  4. width="100%">
  5. <tr>
  6. <th>
  7. Location</th>
  8. <th>
  9. Times</th>
  10. <th>
  11. Sunday</th>
  12. </tr>
  13. <tr>
  14. </HeaderTemplate>
  15.  
  16. <ItemTemplate>
  17. <tr>
  18. <td align="center">
  19. <%# DataBinder.Eval(Container.DataItem, "facility_name")%> 
  20. </td>
  21. <td align="center">
  22. <%# DataBinder.Eval(Container.DataItem, "TT_TIME")%> 
  23. </td>
  24. <td align="center" 
  25. style='background-color:<%# DataBinder.Eval(Container.DataItem, "session_color")%>'>
  26. <%# DataBinder.Eval(Container.DataItem, "session_sun")%> 
  27. </td>
  28.  
  29. </tr>
  30. </ItemTemplate>
  31.  
  32. <FooterTemplate>
  33. </table>
  34. </FooterTemplate> 
  35. </asp:Repeater>
Oct 16 '08 #1
1 2091
Frinavale
9,735 Expert Mod 8TB
What id the problem?
Everything looks like it should work...except the single quotes you are using when setting the style (line 25).

It should be:
Expand|Select|Wrap|Line Numbers
  1. style="background-color:<%# DataBinder.Eval(Container.DataItem, "session_color")%>">
Please remember to use code tags in the future.

-Frinny
Oct 16 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Scott | last post by:
There is a setting in IE for "Print background colors and images." I've noticed that without checking this option, a web page will print CSS lines between table rows, but a background color of...
3
by: Felix Natter | last post by:
hi, is there a way (html/css/javascript) to force IE to print background-colors exactly as specified in html/stylesheets? I tried to use @media print { ... } to override IE's "print background...
3
by: Bob - Andover, MA | last post by:
I know how to define a background color for the entire page, and for a table, and even using style sheets and 'P CLASS=...' for changing paragraph background colors. However, I'd like to be able...
5
by: Lee K. Seitz | last post by:
I have a set of pages with a special stylesheet used to override some styles for printing. One of the things I've tried to do is reverse the colors of my navigation. On the screen, I have a black...
16
by: J. B. Moreno | last post by:
I read the faq, and it mentions that IE 4 on windows requires setting a printing option to allow background colors to be printed. Things change, life goes on, other browsers come into...
4
by: Franklin | last post by:
WITHOUT KNOWING ANYTHING ABOUT THE CURRENT COLORS, I want to swap the foreground/background colors of a link when someone hovers over it. Is this possible with HTML, CSS, DOM, & JavaScript? If...
10
by: Bob Bedford | last post by:
I've a table in wich I've this CSS: ..oddrow{background-color:#FFFFFF} ..evenrow{background-color:#CCCCCC} The oddrows are white and the even are grey. BUT ! when I do print the table,...
2
by: gnosys | last post by:
In ASP.Net 1.1 using C#, I'm trying to dynamically change the background colors of certain listbox items based on some criteria. For example:
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.