473,770 Members | 2,144 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

4 New Member
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 2118
Frinavale
9,735 Recognized Expert Moderator Expert
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
8684
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 say the header won't. The below style will display the borders in print preview, but won't display the background color. Does anyone know if it's possible to force background CSS or HTML colors to print without having the user change the default...
3
37218
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 colors + images" option, but it doesn't work. Any other idea? I'd like to avoid relying on the user for setting this option.
3
6582
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 to change background colors on a word-by-word basis, or at least sentence-by-sentence basis. Using a paragraph divider splits up the words or sentences, which is not desired. I want the word to still appear inline with its neighboring words.
5
4635
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 background and the navigation is red on yellow. For print, I (obviously) have a white background and wanted the navigation to be reversed (yellow on red) for better clarity. I've done print preview in IE 6, Opera 7.5, and Netscape 7.1 (all...
16
3939
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 existence.... So, is there a way in CSS to say "Yeah, print these background colors", without the user having to turn on an option that will then apply to all pages printed? Thanks,
4
4098
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 so, how? See my HTML below (or go to my test page at http://fmbbowen.com:39353/misc/Misc.html). I also tried treating ..color as a number and subtracting the current color from 0xFFFFFF but that did not work either. The numerous examples I...
10
7732
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, there is nothing !!! How to print such lines colors ? the main purpose of this table is to be
2
11120
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
9618
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9454
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10101
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9906
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7456
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5482
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4007
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3609
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2850
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.