Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 621475
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T18:52:42+00:00 2026-05-13T18:52:42+00:00

I would like to change database column names of a BDC list webpart using

  • 0

I would like to change database column names of a BDC list webpart using an XSL file.

My SQL query is "Select BATCH_ID...", I want to change that column name "BATCH_ID" to "ID" using XSL. I also want to know how $ColName_0 is getting populated with the value 'BATCH_ID'?

Inside the dvt.headerfield template it is sorting and adding sort menu. But $ColName_0 is populated before that template is called. XSLT code is following:

<xsl:stylesheet 
  version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime"
  xmlns:asp="http://schemas.microsoft.com/ASPNET/20"
  xmlns:msxsl="urn:schemas-microsoft-com:xslt"
  xmlns:SharePoint="Microsoft.Sharepoint.WebControls"
  exclude-result-prefixes="xsl msxsl ddwrt"
>
  <xsl:output method="xml" indent="yes"/>
  <xsl:param name="dvt_partguid" />
  <xsl:param name="ColName_0"></xsl:param>

  <xsl:template name="dvt.headerfield">
    <xsl:param name="fieldname" />
    <xsl:param name="fieldtitle" />
    <xsl:param name="displayname" />
    <xsl:param name="fieldtype">0</xsl:param>

    <table CtxNum="1" cellspacing="0" class="ms-unselectedtitle" onmouseover="OnMouseOverAdHocFilter(this, '{concat($displayname,$fieldname, $fieldtype, $dvt_partguid)}')">
      <tr>
        <td width="100%" class="ms-vb" nowrap="">
          <a>
            <xsl:attribute name="href">javascript: <xsl:value-of select="ddwrt:GenFireServerEvent(('dvt_sortfield;dvt_sortdir'))" />;</xsl:attribute>
            <xsl:value-of select="$fieldtitle"/>
          </a>                  
        </td>
        <td>
          <img src="/_layouts/images/blank.gif" width="13" style="visibility: hidden" alt="" />
        </td>
      </tr>
    </table>
  </xsl:template>

  <xsl:template match="/">
    <xsl:call-template name="dvt_1" />
  </xsl:template>

  <xsl:template name="dvt_1">
    <xsl:variable name="dvt_StyleName">Table</xsl:variable>

    <table id="BdwpRows" border="0" width="100%" cellpadding="2" cellspacing="0">
      <tr valign="top">
        <th class="ms-vh" width="1" />
        <th class="ms-vh" align="left">
          <xsl:call-template name="dvt.headerfield" ddwrt:atomic="1">
            <xsl:with-param name="fieldname">@BATCH_ID</xsl:with-param>
            <xsl:with-param name="fieldtitle">
              <xsl:value-of select="$ColName_0" />
            </xsl:with-param>
            <xsl:with-param name="displayname">
              <xsl:value-of select="$ColName_0" />
            </xsl:with-param>
            <xsl:with-param name="fieldtype">text</xsl:with-param>
          </xsl:call-template>
        </th>
      </tr>         
    </table>
  </xsl:template>
</xsl:stylesheet>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T18:52:42+00:00Added an answer on May 13, 2026 at 6:52 pm

    Not sure it’s the best way, but here’s how I did it:

    Change:

    <xsl:with-param name="fieldname">@BATCH_ID</xsl:with-param> 
        <xsl:with-param name="fieldtitle"> 
            <xsl:value-of select="$ColName_0" /> 
        </xsl:with-param> 
        <xsl:with-param name="displayname"> 
            <xsl:value-of select="$ColName_0" /> 
        </xsl:with-param> 
    <xsl:with-param name="fieldtype">text</xsl:with-param> 
    

    To:

    <xsl:with-param name="fieldname">@BATCH_ID</xsl:with-param> 
        <xsl:with-param name="fieldtitle"> 
            ID 
        </xsl:with-param> 
        <xsl:with-param name="displayname"> 
            <xsl:value-of select="$ColName_0" /> 
        </xsl:with-param> 
    <xsl:with-param name="fieldtype">text</xsl:with-param> 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 312k
  • Answers 312k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer To call a function bound to Var myfn1 given the… May 13, 2026 at 10:43 pm
  • Editorial Team
    Editorial Team added an answer It is not possible to edit the content of the… May 13, 2026 at 10:43 pm
  • Editorial Team
    Editorial Team added an answer You're concatenating raw SQL statements and not escaping the backslash.… May 13, 2026 at 10:43 pm

Related Questions

First off, let me define the end goal: I'd like to Wordpress (version 2.8)
In my specific case, I am making use of a discriminator column strategy. This
(Follow-Up-Question to How to change LINQ O/R-M table name/source during runtime? ) I need
On my index/list view I have a list of records from the database, currently
I would like to rename an index. I've looked at the alter table documentation,

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.