Solved

Help with seeing vertical and horizontal lines of a table and setting background and text colors of eve and odd rows

Posted on 2012-04-02
8
361 Views
Last Modified: 2012-04-03
Hello,

How do  I see the  vertical and horizontal lines of a table and How do I set background and text colors of even and odd rows in my report?

Thanks,

victor
0
Comment
Question by:vcharles
  • 4
  • 3
8 Comments
 
LVL 37

Accepted Solution

by:
ValentinoV earned 500 total points
ID: 37799483
"How do  I see the  vertical and horizontal lines of a table "

Do you mean when the report is rendered?  You can use the Border properties to set the cell borders.

"How do I set background and text colors of even and odd rows in my report?"

For alternating coloring you can use the RowNumber function in an expression.  The following would be an example of a possible expression on the BackgroundColor property of a textbox (table cell):

=IIf(RowNumber("YourDataSet") Mod 2 = 0, "Blue", "Transparent")

More info: http://msdn.microsoft.com/en-us/library/ms159225(v=sql.100).aspx
0
 

Author Comment

by:vcharles
ID: 37799513
Yes, I mean when they see the report, I need to be able to see how the colums are separated.
I am fairly new at this, will look for the borders property and set it as you suggested.
 where do I enter =IIf(RowNumber("YourDataSet") Mod 2 = 0, "Blue", "Transparent")

Thanks,
0
 
LVL 37

Expert Comment

by:ValentinoV
ID: 37799550
The expression goes into the BackgroundColor property which you'll find as one of the properties of a textbox (i.e. cell in a tablix).

BTW: are you using the SSRS designer or .NET code (I noticed you've got the ASP.NET topic in your question as well as SSRS).
0
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 

Author Comment

by:vcharles
ID: 37799753
I am using using SSRS, but thought they also use the same type of report (RDLC) with SQL.
I have another question, perhaps you can help me answer it on the same post or I can open another post.

Previously my data was in a table format with multiple records displayed, now I need to display one record per page, how do I modify my code.

For example:

Table Format:

Country   Address Zip   Item
BEL            xyz        112  Car
CAN           xyz        112  Car
DEU           xyz        112  Car
FRA           xyz         112  Car

Now I need

Record 1 of 4

Country    BEL
Address    xyz
Zip            112
Item         Car

Record 2 of 4

Country    CAN
Address    xyz
Zip            112
Item         Car



Record 3 of 4

Country    DEU
Address    xyz
Zip            112
Item         Car



Record 4 of 4

Country    FRA
Address    xyz
Zip            112
Item         Car


Below is the code I am currently using to display the data using a datatable:


 Dim FilteredDT As DataTable
 Dim DV As New DataView(dt, SearchCriteria, Nothing, DataViewRowState.CurrentRows)
        FilteredDT = DV.ToTable
 Dim reportDataSource As New Microsoft.Reporting.WinForms.ReportDataSource()
        reportDataSource.Name = "MyDataSet_Links"
        reportDataSource.Value = FilteredDT
        ReportViewer2.LocalReport.DataSources.Clear()
        ReportViewer2.LocalReport.DataSources.Add(reportDataSource)
        ReportViewer2.LocalReport.Refresh()
        ReportViewer2.RefreshReport()

Thanks,

Victor
0
 
LVL 7

Expert Comment

by:dhawalseth
ID: 37800018
0
 

Author Comment

by:vcharles
ID: 37800139
Thanks!
0
 
LVL 37

Expert Comment

by:ValentinoV
ID: 37800148
If you have other questions (such as the one in comment 37799753) it's better to open other questions instead of putting them in an already open one...  That's more in line with the Problem/Solution philosophy.

You'll also attract more experts looking at the problem in question because they can then focus on just that one particular issue.
0
 

Author Comment

by:vcharles
ID: 37800166
Got it. Thanks.
0

Featured Post

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

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

A recent questions about how to add SSRS named instances, couldn't find any that talks about SQL server 2008, anyway I decided to help by creating some screen shots. The installation is straightforward, you just pop the SQL server 2008 installati…
SQL Server engine let you use a Windows account or a SQL Server account to connect to a SQL Server instance. This can be configured immediatly during the SQL Server installation or after in the Server Authentication section in the Server properties …
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

785 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