Change Group By column order in ReportViewer - c#

I have a rdlc where I'm building a report.
I'm using a tablix grouping by a field of the tablix dataset, like the following:
When I fill the report with data and refresh it, it comes out like this:
Now, I want the first column(wich has the group by by the field "nome_terr") appear not in first place, but by second. The first column has to be "territorio_emp". If it was a normal column, I'd just move it, but being the Group By column I don't know how to do this.
Ideas?
Thank you.

If you know that your Territorio_Emp data is 1-1 related to your Nome_Terr column, you can just group by Territorio_Emp first, then by the Nome_Terr column.
If thats not possible, you can keep it the way it is, but make the width of the group by column 0, so its basically hidden. Just drag the column header separators.

Related

Rdlc with two "synchronized tables"

I'm using rdlc files to generate pdf files.
What I basically want to do to is to display the data of my data set on two "synchronized" tables.
The image below represents the result I would like to obtain:
The image represents one page of the pdf, on which the data is group by a certain attribute of the dataset.
Please tell me if any clarification is needed, it's hard for me to explain clearly.
How can i do that with 2 tables as a single object?
I managed to do this with a Tablix as the container. Add two lines of header and add another two Tablix to each cell of header with data. You cannot use Data row, you have to remove it. You can add a Tablix to a cell with drag and drop.
In the end, you will have something like :
Probably something alike can be achieved with subreports, but I'm not familiar with them.
EDIT:
Added screenshot
I believe this is what you want to see. 1 column, 3 rows Tablix. In Cells(1,1) and (3,1) you have other Tablix objects that you can customize.

C# iTextSharp: split table

i got my pdf like this.
https://drive.google.com/a/mahidol.edu/file/d/0B9vSVV3dDAmFZDkwWXdfYWNDc2M/view
first, on Page 1 i use rowspan on the first column when it splited, bottom line not be equal. i want the line to be equal.
second, on Page 2 when table splited, on first column, i want to repeat column value again on new page.
thank you so much.
ps: I use nest table (fill table into another table). i am not sure, this is cause of problem or not?

DataTable columns inside columns or merged row table structure

I've had a Google but I find no answer. You know how say in MS Word, when you insert a table, you can merge the columns of one single row to create a column-less row? Or have say a main header and then more columns inside it? Like so:
Merged Row:
|Column 1|Column 2|Column 3|
|Value|Value|Value|
|Merged Row|
|Value|Value|Value|
God the text formatting is awful on this web-site...and the Header Column example:
|Main Header||Another Main Header|
|Column 1|Column2||Column1|Column2|
I'm trying to achieve this in a written DataTable in C# which is being populated by an array. But I'm interested in changing its structure as one of the above, whichever is possible/easier.
So I've created my DataTable and added normal columns and rows etc. But I'd like to create either a merged row or a main header to display. Instead of having a repeated value in a single column for the values I am getting.
Can someone please provide a quick example on how I could achieve either one of those? Because repeated value will just look ugly.
Cheers.
You're talking about displaying data in a particular way but a
DataTable has nothing to do with display. It is for storage and that's
that. How you display the data is up to you. The same data can be
displayed in innumerable different ways. In a WinForms app, one of the
most common ways to display the contents of a DataTable is with a
DataGridView. You can choose which columns to display and merge cells
in that grid if desired. In short, you're looking in the wrong place
to do what you want to do. It is a presentation issue, not a data
issue. –
jmcilhinney

Automatically add an Order column into tablix in Local Report?

I can populate my own Order column in the DataSource and pass this DataSource to Tablix. But if there is a way to automatically an Order column right in Tablix at design time (such as using some variable or expression), it would be better. Here is what I want:
Order | Column 1 | Column 2
1
2
3
...
The Order column can be added at design time easily, but how to populate it with ordinal numbers when refreshing report (of course, I don't want to populate it from data source). I want some way to populate it via expression or something like that right in Local Report designer.
Your help would be highly appreciated!
Thank you very much in advance!
Yes,
Put expression =RowNumber(nothing) in Order column.
and if you want to show row number differently for group try =RowNumber("GroupName1")
=RowNumber("Group1")
it's not working with me for group numbers what i can do

Cleanest way to implement collapsable entries in a table generated via asp:Repeater?

Before anyone suggests scrapping the table tags altogether, I'm just modifying this part of a very large system, so it really wouldn't be wise for me to revise the table structure (the app is filled with similar tables).
This is a webapp in C# .NET - data comes in from a webservice and is displayed onscreen in a table. The table's rows are generated with asp:Repeaters, so that the rows alternate colers nicely. The table previously held one item of data per row. Now, essentially, the table has sub-headers... The first row is the date, the second row shows a line of data, and all the next rows are data rows until data of a new date comes in, in which case there will be another sub-header row.
At first I thought I could cheat a little and do this pretty easily to keep the current repeater structure- I just need to feed some cells the empty string so that no data appears in them. Now, however, we're considering one of those +/- collapsers next to each date, so that they can collapse all the data. My mind immediately went to hiding rows when a button is pressed... but I don't know how to hide rows from the code behind unless the row has a unique id, and I'm not sure if you can do that with repeaters.
I hope I've expressed the problem well. I'm sure I'll find a way TBH but I just saw this site on slashdot and thought I'd give it a whirl :)
When you build the row in the databinding event, you can add in a unique identifier using say the id of the data field or something else that you use to make it unique.
Then you could use a client side method to expand collapse if you want to fill it with data in the beginning, toggling the style.display setting in Javascript for the table row element.
just wrap the contents of the item template in an asp:Panel, then you have you have a unique id. Then throw in some jquery for some spice ;)
edit: just noticed that you are using a table. put the id on the row. then toggle it.

Categories

Resources