Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Brain Freeze
Message
De
21/05/2014 10:01:27
 
 
À
21/05/2014 02:58:15
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Titre:
Versions des environnements
Environment:
VB 9.0
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01600361
Message ID:
01600395
Vues:
51
>>>>I want to organize rows in a datatable into 3 columns without scanning the table using a counter.
>>>>My brain just won't work on this one.
>>>>
>>>>Assuming that I know rownumber r, is there a mathematical function using r that will return the proper column (1,2 or 3) for each row?
>>>
>>>I am not sure I understand the question.
>>>
>>>myDataTable.Rows[rowNumber].Columns[0]
will return value for the first column. (rowNumber is 0 based)
>>
>>rownumber 1 would be column 1, rownumber 2 would be column 2, rownumber 3 would be column 3, 4 would be 1, 5 would be 2, 6 would be 3, 7 would be 1 etc.
>>Is there a mathematical function using rownumber that will return the column number?
int columnNumber = (row%3)+1
?

Thanks, Viv and Naomi.
I have this working.
I'm building a three column report in SSRS.
I use three identical tablix's and wanted a tablix visible or not depending on the rownumber function.
Putting this expression in the row visibility expression of the first tablix, for example, shows just rows 1, 4, 7, etc.
= IIF((RowNumber(nothing) = 1) or ((RowNumber(nothing) -1) mod 3 = 0)  ,false,true) 
I developed similar expressions for the second and third tablix and all is well.
I'm sure that there's a more elegant way to do multicolumn reports in SSRS, but I couldn't find it.
Anyone who does not go overboard- deserves to.
Malcolm Forbes, Sr.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform