Columns Order in XML output of SSRS report

  • Hello Good Morning All,

    I have a SSRS report which need to output in xml format,

    in this report i have a tablis whioch contains ssn, city, state, zip columns after i run this report and save as xml
    then reopen it shows columns order as xip, state, city, ssn

    any idea how can i fix it to show as is in report design.

    also another question i have is I am setting format for ssn column and zip column when i see the report in preview it looks good
    but when i export to xml no formatting for these fields

    Can somebody please help with this? i am using ssrs 2012

    Thank you in advance
    Asita

  • i have a [tables] which contains ssn, city, state, zip columns after i run this report and save as xml 
    then reopen it shows columns order as xip, state, city, ssn...

    any idea how can i fix it to show as is in report design.

    First - careful with a report that displays SSN's. I would never do that. 

    That said, the default behavior in SSRS when exporting to XML is to do a raw XML dump where columns appear in the same order as the report. Alter this behavior you can use an XML transform (XSLT file) .The XML transform allows you to output define how the XML appears. Changing the column order should be easy once you are comfortable writing XML transforms (which is not easy). A google search for "ssrs output to xml xslt" will provide you with enough examples to hack your way through doing this.

    Once you have a transform ready you go to the properties of the report and add the location of the transform file where it reads, "data transform". Note the pic below:

    also another question i have is I am setting format for ssn column and zip column when i see the report in preview it looks good
    but when i export to xml no formatting for these fields

    This too can be handled using an XML transform.

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

  • Hi Alan

    Thank you for your input is there any why can we correct the order of fields

    when I see the out put in preview mode in SSDT it looks good but when i save it in xml it shows columns in tablix reverse from right to left? please advise

    Thank you in advance
    asita

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply