SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Inserting Text Rows Within Tablix tables - Can It Be Done?


Inserting Text Rows Within Tablix tables - Can It Be Done?

Author
Message
fstop
fstop
SSC Journeyman
SSC Journeyman (96 reputation)SSC Journeyman (96 reputation)SSC Journeyman (96 reputation)SSC Journeyman (96 reputation)SSC Journeyman (96 reputation)SSC Journeyman (96 reputation)SSC Journeyman (96 reputation)SSC Journeyman (96 reputation)

Group: General Forum Members
Points: 96 Visits: 316
I have a Tablix table of fixed columns that is pulling from a stored procedure. I have added a text field (varchar) as the last column of the stored proc. If this text column is not null, I want to insert a row after the Tablix has written out the row the text column resides in.

Here is an example:

The row that starts with "PFT" is the row that I want to add after the row dated 5/2/2003, as it pertains to that row. Is this even possible?
happycat59
happycat59
SSCarpal Tunnel
SSCarpal Tunnel (4.7K reputation)SSCarpal Tunnel (4.7K reputation)SSCarpal Tunnel (4.7K reputation)SSCarpal Tunnel (4.7K reputation)SSCarpal Tunnel (4.7K reputation)SSCarpal Tunnel (4.7K reputation)SSCarpal Tunnel (4.7K reputation)SSCarpal Tunnel (4.7K reputation)

Group: General Forum Members
Points: 4738 Visits: 3218
fstop (6/13/2014)
I have a Tablix table of fixed columns that is pulling from a stored procedure. I have added a text field (varchar) as the last column of the stored proc. If this text column is not null, I want to insert a row after the Tablix has written out the row the text column resides in.

Here is an example:

The row that starts with "PFT" is the row that I want to add after the row dated 5/2/2003, as it pertains to that row. Is this even possible?


For this, you will need 2 detail rows. For the second row (the row that will contain the "PFT" string), you need to do the following:
- merge all of the cells so that they whole row is a single cell
- make the visibility of the row conditional depending on whether you have a value to show, or not.



fstop
fstop
SSC Journeyman
SSC Journeyman (96 reputation)SSC Journeyman (96 reputation)SSC Journeyman (96 reputation)SSC Journeyman (96 reputation)SSC Journeyman (96 reputation)SSC Journeyman (96 reputation)SSC Journeyman (96 reputation)SSC Journeyman (96 reputation)

Group: General Forum Members
Points: 96 Visits: 316
Thanks for your suggestion. As a newbie, can you offer some detail in how to to pull and incorporate 2 detail rows in a Tablix? It seems to me that in order to merge all the columns into one field in the query, I would have to work out all the spacing in the query (which wouldn't allow for fields wrapping data in a cell, such as in the Notes column). Then I would create a one column Tablix? Would I then not be able to have column headers and cell borders? I assume I would set the Visibility based on an expression of whether the row started with PFT or not? Am I following you correctly? If not, can you elaborate? Thanks
happycat59
happycat59
SSCarpal Tunnel
SSCarpal Tunnel (4.7K reputation)SSCarpal Tunnel (4.7K reputation)SSCarpal Tunnel (4.7K reputation)SSCarpal Tunnel (4.7K reputation)SSCarpal Tunnel (4.7K reputation)SSCarpal Tunnel (4.7K reputation)SSCarpal Tunnel (4.7K reputation)SSCarpal Tunnel (4.7K reputation)

Group: General Forum Members
Points: 4738 Visits: 3218
fstop (6/16/2014)
Thanks for your suggestion. As a newbie, can you offer some detail in how to to pull and incorporate 2 detail rows in a Tablix? It seems to me that in order to merge all the columns into one field in the query, I would have to work out all the spacing in the query (which wouldn't allow for fields wrapping data in a cell, such as in the Notes column). Then I would create a one column Tablix? Would I then not be able to have column headers and cell borders? I assume I would set the Visibility based on an expression of whether the row started with PFT or not? Am I following you correctly? If not, can you elaborate? Thanks



In you tablix, the detail row will actually be 2 rows. You can do this by
- select any cell in the detail row. Just to the left of the first cell on that row, you should see an extra "field" that looks a bit like an equals sign
- right click on the that "equals" sign and then select "Insert Row" and then "Insert Group - Below"
- you should now see an additional row appear
- select every cell on the new row
- right click on the select cells and select "Merge Cells"
- you should now have a row which has a single cell in it.
- on the single cell row, set the expression for the row to be the value you want (e.g. the field contain the "PFT..." value
- select the single cell row, and in the "equals" at the left hand end of the row, select "Row Visibility..."
- in the dialog that pops up, add an expression that evaluates to True or False to "Show or hide based on an expression" field



fstop
fstop
SSC Journeyman
SSC Journeyman (96 reputation)SSC Journeyman (96 reputation)SSC Journeyman (96 reputation)SSC Journeyman (96 reputation)SSC Journeyman (96 reputation)SSC Journeyman (96 reputation)SSC Journeyman (96 reputation)SSC Journeyman (96 reputation)

Group: General Forum Members
Points: 96 Visits: 316
Thank you very much for taking the time to provide step-by-step instructions. They worked beautifully!
happycat59
happycat59
SSCarpal Tunnel
SSCarpal Tunnel (4.7K reputation)SSCarpal Tunnel (4.7K reputation)SSCarpal Tunnel (4.7K reputation)SSCarpal Tunnel (4.7K reputation)SSCarpal Tunnel (4.7K reputation)SSCarpal Tunnel (4.7K reputation)SSCarpal Tunnel (4.7K reputation)SSCarpal Tunnel (4.7K reputation)

Group: General Forum Members
Points: 4738 Visits: 3218
Great - glad to help



Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search