Cannot implicitly convert type 'int' to 'DocumentFormat.OpenXml.StringValue'

Hi,
I have a write code-behind in infopath form to convert word document using openXML
Below code i have used to convert:
I underlined the code which is getting error!!!
using Microsoft.Office.InfoPath;
using System;
using System.Xml;
using System.Xml.XPath;
using System.IO;
using System.Text;
using DocumentFormat.OpenXml.Packaging;
using DocumentFormat.OpenXml.Wordprocessing;
namespace SampleForm
    public partial class FormCode
        // Member variables are not supported in browser-enabled forms.
        // Instead, write and read these values from the FormState
        // dictionary using code such as the following:
        // private object _memberVariable
        //     get
        //         return FormState["_memberVariable"];
        //     set
        //         FormState["_memberVariable"] = value;
        // NOTE: The following procedure is required by Microsoft InfoPath.
        // It can be modified using Microsoft InfoPath.
        private TableCell createCell(string content)
            // Create a new table cell
            TableCell tc = new TableCell();
            // Specify the width of the table cell
            TableCellWidth tcw = new TableCellWidth();
            tcw.Width = 2400;
            tcw.Type = TableWidthUnitValues.Dxa;
            tc.Append(new TableCellProperties(tcw));
            // Specify the content of the table cell
            tc.Append(new Paragraph(new Run(new Text(content))));
            // Return the new table cell
            return tc;
        private TableRow createRow(string cell1, string cell2, string cell3)
            // Create a new table row
            TableRow tr = new TableRow();
            // Add the table cells to the table row
            tr.Append(createCell(cell1));
            tr.Append(createCell(cell2));
            tr.Append(createCell(cell3));
            // Return the new table row
            return tr;
        public void InternalStartup()
            ((ButtonEvent)EventManager.ControlEvents["CTRL6_5"]).Clicked += new ClickedEventHandler(CTRL6_5_Clicked);
        public void CTRL6_5_Clicked(object sender, ClickedEventArgs e)
            // Write your code here.
            // Get a reference to the main data source
            XPathNavigator root = MainDataSource.CreateNavigator();
            // Copy the template and create a new document
            string newFilePath = @"C:\NewDoc.docx";
            File.Copy(@"C:\QuickQuote.docx", newFilePath, true);
            using (WordprocessingDocument myDoc =
            WordprocessingDocument.Open(newFilePath, true))
                // Add an aFChunk part to the package
                string altChunkId = "AltChunkId1";
                MainDocumentPart mainPart = myDoc.MainDocumentPart;
                AlternativeFormatImportPart chunk = mainPart
                .AddAlternativeFormatImportPart(
                AlternativeFormatImportPartType.Xhtml, altChunkId);
                // Retrieve the rich text field contents
                // and store it into the aFChunk part
                StringBuilder sb = new StringBuilder();
                sb.Append("<html>");
                sb.Append(root.SelectSingleNode(
                "//my:RtxtField", NamespaceManager).InnerXml);
                sb.Append("</html>");
                string html = sb.ToString();
                using (MemoryStream ms =
                new MemoryStream(Encoding.UTF8.GetBytes(html)))
                    chunk.FeedData(ms);
                // Add the aFChunk to the document
                AltChunk altChunk = new AltChunk();
                altChunk.Id = altChunkId;
                mainPart.Document.Body.Append(altChunk);
                // Create an empty table and specify formatting for its borders
                Table table = new Table();
                TableBorders borders = new TableBorders();
                TopBorder tb = new TopBorder();
                tb.Val = new DocumentFormat.OpenXml
                .EnumValue<BorderValues>(BorderValues.Dashed);
                tb.Size = 24;
                borders.AppendChild<TopBorder>(tb);
                BottomBorder bb = new BottomBorder();
                bb.Val = new DocumentFormat.OpenXml
                .EnumValue<BorderValues>(BorderValues.Dashed);
                bb.Size = 24;
                borders.AppendChild<BottomBorder>(bb);
                LeftBorder lb = new LeftBorder();
                lb.Val = new DocumentFormat.OpenXml
                .EnumValue<BorderValues>(BorderValues.Dashed);
                lb.Size = 24;
                borders.AppendChild<LeftBorder>(lb);
                RightBorder rb = new RightBorder();
                rb.Val = new DocumentFormat.OpenXml
                .EnumValue<BorderValues>(BorderValues.Dashed);
                rb.Size = 24;
                borders.AppendChild<RightBorder>(rb);
                InsideHorizontalBorder ihb = new InsideHorizontalBorder();
                ihb.Val = new DocumentFormat.OpenXml
                .EnumValue<BorderValues>(BorderValues.Single);
                ihb.Size = 24;
                ihb.Color = new DocumentFormat.OpenXml.StringValue("#FF0000");
                borders.AppendChild<InsideHorizontalBorder>(ihb);
                InsideVerticalBorder ivb = new InsideVerticalBorder();
                ivb.Val = new DocumentFormat.OpenXml
                .EnumValue<BorderValues>(BorderValues.Dashed);
                ivb.Size = 24;
                borders.AppendChild<InsideVerticalBorder>(ivb);
                TableProperties tblProp = new TableProperties(borders);
                table.AppendChild<TableProperties>(tblProp);
                // Loop through the repeating table and create rows in the table
                XPathNodeIterator iter = root.Select("//my:group2",
                NamespaceManager);
                while (iter.MoveNext())
                    string cell1 = iter.Current.SelectSingleNode(
                    "my:cell1", NamespaceManager).Value;
                    string cell2 = iter.Current.SelectSingleNode(
                    "my:cell2", NamespaceManager).Value;
                    string cell3 = iter.Current.SelectSingleNode(
                    "my:cell3", NamespaceManager).Value;
                    TableRow tr = createRow(cell1, cell2, cell3);
                    table.Append(tr);
                // Add the table to the document
                mainPart.Document.Body.Append(table);
                // Save the document
                mainPart.Document.Save();

Hello Coolsweety,
Maybe this technet article is useful, at the end I see how they specify the width property:
http://msdn.microsoft.com/en-us/library/office/cc850841(v=office.15).aspx
- Dennis | Netherlands | Blog |
Twitter

Similar Messages

  • How to solve this Error?? Error_2_Cannot implicitly convert type 'int' to 'int[]'_

    Hi,
    I created a structure. It contains 1& 2 diamensional arrays. Now I want to pass values to these arrays. But at that time I got the following error.
        Error 2 Cannot implicitly convert type 'int' to 'int[]' 
            publicstructtest
              [FieldOffset(160)]
             [MarshalAs(UnmanagedType.ByValArray,
    SizeConst = 3)]
            publicint[]
    DC;
               [FieldOffset(168)]
              [MarshalAs(UnmanagedType.ByValArray,
    SizeConst = 8)]
              publicfloat[]
    IN;
               [FieldOffset(176)]
              [MarshalAs(UnmanagedType.ByValArray,
    SizeConst = 8)]
            publicbyte[,]
    us;
    privatevoidbutton1_Click(objectsender,
    EventArgse)
    //int[] T_ADC = new int[3];
                array[0].DC =12
                array[0].IN[0] = 11;
                array[0].us[0, 0] = 1;

    @DAANNIII
    >>I wrote the code as follows
    array[0].DC[0]
    =12
    but after that I got an error that  " Object reference not set to an instance of an object".Why this type of error occurs??
    Still confused about how you define variable "array[0]".
    Based on your error information, because your DC is null. As I said before, DC is an int[]. You must assign an array to DC.
    int[] array = new int[] { 2, 43 };
    test s = new test();
    s.DC = array;
    s.DC[0] = 12;//It works fine
    Best regards,
    Kristin
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Cannot implicitly convert type 'System.Data.SqlClient.SqlDataReader' to 'Microsoft.ReportingServices.DataProcessing.IDataReader'. An explicit conversion exists (are you missing a cast?)

    Cannot implicitly convert type 'System.Data.SqlClient.SqlDataReader' to 'Microsoft.ReportingServices.DataProcessing.IDataReader'. An explicit conversion exists (are you missing a cast?)
    I am getting the above error in c#. Please help me. Thanks in advance
    public IDataReader ExecuteReader(CommandBehavior behavior)
    string query = "select * from Sales.Store";
    SqlConnection readerconn = new SqlConnection("Data Source=localhost;Initial Catalog=AdventureWorks2000;Integrated Security=SSPI");
    SqlCommand readercmd = new SqlCommand(query);
    try
    readerconn.Open();
    readercmd = readerconn.CreateCommand();
    readercmd.CommandText = query;
    readercmd.CommandType = System.Data.CommandType.Text;
    SqlDataReader TestReader = readercmd.ExecuteReader();
    return TestReader; //Getting error at this line
    readerconn.Close();
    catch (Exception e)
    throw new Exception(e.Message);

    Hi,
    Please firstly take a look at the documentation:
    IDbCommand.ExecuteReader
    Method
    Users do not create an   instance of a
    DataReader   class directly. Instead, they obtain the
    DataReader   through the
    ExecuteReader   method of the Command   object. Therefore, you should mark
    DataReader   constructors as internal.
    You need to use this method to get the IDataReader object, all the IDbCommand and IDataReader are in the Microsoft.ReportingServices.DataProcessing namespace. There's another IDataReader object which is in System.Data namespace, but they're actually two different
    objects, that's why you got the exception.
    For how to properly implement this Microsoft.ReportingServices.DataProcessing.IDataReader, please check this documentation:
    Implementing a DataReader Class for a Data Processing Extension
    It also provides code samples there.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Cannot implicitly convert type 'Microsoft.SharePoint.SPListItemCollection' to 'System.Collections.Generic.List T '_

    Hi
    I want use SPListItemCollection' to 'System.Collections.Generic.List<T>'.
    How to achieve this.
    Thanks,
    Siva.

    Hi Siva,
    This is how I code it for looping all SPListItem in the SPListItemCollection using Generic List<T>
    public IEnumerable GetEnumerator()
    using (SPSite site = new SPSite(SPContext.Current.Site.Url))
    using (SPWeb web = site.OpenWeb())
    var list = web.Lists["Friends"];
    var query = new SPQuery();
    query.Query = "<FieldRef Name='ID'/>";
    IEnumerable items = list.GetItems(query);
    return items;
    Then calling the method would be
    var items = GetEnumerator();
    foreach(SPListItem item in items)
    Response.Write(item["FirstName"]);
    Murugesa Pandian| MCPD | MCTS |SharePoint 2010

  • Converting type INT to type String...possible?

    Hi
    I basically have a stored string that I want to add numbers to, like adding a phone numbers digits to eachother or a calculators numbers to eachother in seperate instances. Is this possible?
    So say I ask the user to input a number (single), can this then be added to the string field and then perhaps looped (dont tell me how to do that - I will try that myself) to create a string of 10 or more numbers?
    Thanks for any help

    Thanks but I have to start with a param of INT before
    adding it to the string, and I cant seem to do this
    with casting (String) FIELDNAME - I get the
    Inconvertible types error[url http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Integer.html#toString(int)]Integer.toString()

  • Cannot convert type class java.lang.String to class oracle.jbo.domain.Clob

    Cannot convert type class java.lang.String to class oracle.jbo.domain.ClobDomain.
    Using ADF Business Components I have a JSFF page fragment with an ADF form based on a table with has a column of type CLOB. The data is retrieved from the database and displayed correctly but when any field is changed and submitted the above error occurs. I have just used the drag and drop technique to create the ADF form with a submit button, am I missing a step?
    I am using the production release of Jdeveloper11G

    Reproduced and filed bug# 7487124
    The workaround is to add a custom converter class to your ViewController project like this
    package oow2008.view;
    import javax.faces.application.FacesMessage;
    import javax.faces.component.UIComponent;
    import javax.faces.context.FacesContext;
    import javax.faces.convert.Converter;
    import javax.faces.convert.ConverterException;
    import oracle.jbo.domain.ClobDomain;
    import oracle.jbo.domain.DataCreationException;
    public class ClobConverter implements Converter {
         public Object getAsObject(FacesContext facesContext,
                                   UIComponent uIComponent,
                                   String string) {
           try {
             return string != null ? new ClobDomain(string) : null;
           } catch (DataCreationException dce) {
             dce.setAppendCodes(false);
             FacesMessage fm =
               new FacesMessage(FacesMessage.SEVERITY_ERROR,
                                "Invalid Clob Value",
                                dce.getMessage());
             throw new ConverterException(fm);
         public String getAsString(FacesContext facesContext,
                                   UIComponent uIComponent,
                                   Object object) {
           return object != null ?
                  object.toString() :
                  null;
    }then to register the converter in faces-config.xml like this
    <faces-config version="1.2" xmlns="http://java.sun.com/xml/ns/javaee">
      <application>
        <default-render-kit-id>oracle.adf.rich</default-render-kit-id>
      </application>
      <converter>
        <converter-id>clobConverter</converter-id>
        <converter-class>oow2008.view.ClobConverter</converter-class>
      </converter>
    </faces-config>then reference this converter in the field for the ClobDomain value like this
              <af:inputText value="#{bindings.Description.inputValue}"
                            label="#{bindings.Description.hints.label}"
                            required="#{bindings.Description.hints.mandatory}"
                            columns="40"
                            maximumLength="#{bindings.Description.hints.precision}"
                            shortDesc="#{bindings.Description.hints.tooltip}"
                            wrap="soft" rows="10">
                <f:validator binding="#{bindings.Description.validator}"/>
                <f:converter converterId="clobConverter"/>
              </af:inputText>

  • BAdI error : type of EXIT_REF1 cannot be converted to the type of EXIT_REF

    Hi all,
    The below was the posted earlier for BAdI. Ihave followed all the steps. And i have written the below code. Syntactically it is not showing any errors, but when i am activating i am getting error
    like " The type of EXIT_REF1 cannot be converted to the type of EXIT_REF". where i am doing the mistake..??
    1) execute Tcode SE18.
    2) Specify a definition Name : ZBADI_SPFLI
    3) Press create
    4) Choose the attribute tab. Specify short desc for badi.. and specify the type :
    multiple use.
    5) Choose the interface tab
    6) Specify interface name: ZIF_EX_BADI_SPFLI and save.
    7) Dbl clk on interface name to start class builder . specify a method name (name,
    level, desc).
    Method level desc
    Linese;ection instance methos some desc
    8) place the cursor on the method name desc its parameters to define the interface.
    Parameter type refe field desc
    I_carrid import spfli-carrid some
    I_connid import spefi-connid some
    9) save , check and activate…adapter class proposed by system is
    ZCL_IM_IM_LINESEL is genereated.
    IMPLEMENTATION OF BADI DEFINITION
    1) EXECUTE tcode se18.choose menuitem create from the implementation menubar.
    2) Specify aname for implementation ZIM_LINESEL
    3) Specify short desc.
    4) Choose interface tab. System proposes a name fo the implementation class.
    ZCL_IM_IMLINESEL which is already generarted.
    5) Specify short desc for method
    6) Dbl clk on method to insert code..(check the code in “AAA”).
    7) Save , check and activate the code.
    REPORT ZBADI_TEST .
    tables: spfli.
    data: wa_spfli type spfli,
    it_spfli type table of spfli with key carrid connid.
    *Initialise the object of the interface.
    data: exit_ref type ref to ZCL_IM_IM_LINESEL,
    exit_ref1 type ref to ZIF_EX_BADISPFLI1.
    selection-screen begin of block b1.
    select-options: s_carr for spfli-carrid.
    selection-screen end of block b1.
    start-of-selection.
    select * from spfli into corresponding fields of table it_spfli
    where carrid in s_carr.
    end-of-selection.
    loop at it_spfli into wa_spfli.
    write:/ wa_spfli-carrid,
    wa_spfli-connid,
    wa_spfli-cityfrom,
    wa_spfli-deptime,
    wa_spfli-arrtime.
    hide: wa_spfli-carrid, wa_spfli-connid.
    endloop.
    at line-selection.
    check not wa_spfli-carrid is initial.
    create object exit_ref.
    exit_ref1 = exit_ref.   "" The type of EXIT_REF1 cannot be converted to the type of EXIT_REF"
    call method exit_ref1->lineselection
    EXPORTING
    i_carrid = wa_spfli-carrid
    i_connid = wa_spfli-connid.
    clear wa_spfli.
    Thanks in advance
    krupali.

    Hi,
    Both are of different types
    data: exit_ref type ref to ZCL_IM_IM_LINESEL,
    exit_ref1 type ref to ZIF_EX_BADISPFLI1.
    Assiging one type another type is not allowed.
    Rhea.

  • How to convert an int variable into String type

    hi everybody
    i want to know how to convert an interger variable into string variable
    i have to implement a code which goes like this
    Chioce ch;
    for(int i=0;i<32;i++)
    // here i need a code to convert the int variable i into a string variable
    ch.add(String variable);
    how do i convert that int variable i into a String type variable??
    can anyone help me?

    Different methods:
    int a;
    string s=a+"";or
    String.valueOf(int) is the better option because Int.toString() generated an intermediate object to get the endresult
    Ema

  • Conversion failed when converting the varchar value to data type int

    Hi, I am unable to resolve this error and would like some assistance please.
    The below query produces the following error message -
    Msg 245, Level 16, State 1, Line 1
    Conversion failed when converting the varchar value 'NCPR' to data type int.
    Select Pc2.Assess,
                    Select Pc1.Title
                    From Pc1
                    Where Pc1.Assess = Pc2.Assess
                ) [Title]
            From Pc2
    However, when I run the query below I get the results shown in the image . Ie. nothing. Pc1 & Pc2 are aliases and are the same table and the assess field is an int. I found NCPR in one cell but that column (prop) is not used in the query. The table
    is nearly 25k rows.
    SELECT * FROM Pc1 WHERE Pc1.Assess LIKE '%NCPR%' OR ISNUMERIC(Pc1.Assess) = 0
    Thank you

    WHERE ISNUMERIC(id) = 1 and there are obviously no 'NCPR' records in the view as per my previous post.
    That is a bad assumption - SQL Server does not have to evaluate the query in the order you are expecting it to.
    Take this simple example
    CREATE TABLE #example
    col1 VARCHAR(50) NOT NULL
    INSERT INTO #example VALUES ('1'), ('2'), ('NaN')
    SELECT * FROM
    SELECT * FROM #example
    WHERE ISNUMERIC(col1) = 1
    ) X
    (3 row(s) affected)
    col1
    1
    2
    (2 row(s) affected)
    compare to
    CREATE TABLE #example
    col1 VARCHAR(50) NOT NULL
    INSERT INTO #example VALUES ('1'), ('2'), ('NaN')
    SELECT * FROM
    SELECT * FROM #example
    WHERE ISNUMERIC(col1) = 1
    ) X
    WHERE col1 = 1
    (3 row(s) affected)
    col1
    1
    Msg 245, Level 16, State 1, Line 8
    Conversion failed when converting the varchar value 'NaN' to data type int.

  • Conversion failed when converting the varchar value to data type int error

    Hi, I am working on a report which is off of survey information and I am using dynamic pivot on multiple columns.
    I have questions like Did you use this parking tag for more than 250 hours? If yes specify number of hours.
    and the answers could be No, 302, 279, No and so on....
    All these answers are of varchar datatype and all this data comes from a partner application where we consume this data for internal reporting.
    When I am doing dynamic pivot I get the below error.
    Error: Conversion failed when converting the varchar value 'No' to data type int.
    Query
    DECLARE @Cols1 VARCHAR(MAX), @Cols0 VARCHAR(MAX), @Total VARCHAR(MAX), @SQL VARCHAR(MAX)
    SELECT @Cols1 = STUFF((SELECT ', ' + QUOTENAME(Question) FROM Question GROUP BY Question FOR XML PATH('')),1,2,'')
    SELECT @Cols0 = (SELECT ', COALESCE(' + QUOTENAME(Question) + ',0) as ' + QUOTENAME(Question) FROM Question GROUP BY Question FOR XML PATH(''))
    SET @SQL = 'SELECT QID, QNAME' + @Cols0 + '
    FROM (SELECT QID, QNAME, ANSWERS, Question
    FROM Question) T
    PIVOT (MAX(ANSWERS) FOR Question IN ('+@Cols1+')) AS P'
    EXECUTE (@SQL)
    I am using SQL Server 2008 R2.
    Please guide me to resolve this.
    Thanks in advance..........
    Ione

    create table questions (QID int, QNAME varchar(50), ANSWERS varchar(500), Question varchar(50))
    Insert into questions values(1,'a','b','c'), (2,'a2','b2','c2')
    DECLARE @Cols1 VARCHAR(MAX), @Cols0 VARCHAR(MAX), @Total VARCHAR(MAX), @SQL VARCHAR(MAX)
    SELECT @Cols1 = STUFF((SELECT ', ' + QUOTENAME(Question) FROM Questions GROUP BY Question FOR XML PATH('')),1,2,'')
    SELECT @Cols0 = (SELECT ', COALESCE(' + QUOTENAME(Question) + ',''0'') as ' + QUOTENAME(Question) FROM Questions GROUP BY Question FOR XML PATH(''))
    SET @SQL = 'SELECT QID, QNAME' + @Cols0 + '
    FROM (SELECT QID, QNAME, ANSWERS, Question
    FROM Questions) T
    PIVOT (MAX(ANSWERS) FOR Question IN ('+@Cols1+')) AS P'
    EXECUTE (@SQL)
    drop table questions

  • Field UMSA1 cannot be converted in type CURR - long Text

    Hi All,
    I am getting the following error
    Error records written to application log
    Error in an arithmetic operation in record 489
    Record 489:Contents 四川省长江滥曝扇备总 from field UMSA1 cannot
    Record 489 :Contents 四川省长江滥曝扇备总 from field UMSA1 cannot be converted in type CURR ->lo
    This happened for the customized master data Z********(customer number). Data source; 0CUSTOMER_ATTR
    I have undertaken the following actions but all failed.
    1. Replicated the data source, activated the transfer structure through a program and the load was run but the load failed with the same issue.
    2. Pushed the data till PSA and tried to edit it in the PSA, but here too the load failed with the same issue.
    It is understood that the data source 0CUSTOMER_ATTR is obtained from the Funtion Module: MDEX_CUSTOMER_MD
    Out of 5 data packages, I could find only 3 data packages in PSA which are successful, the remaining had error and could not be found in PSA. Checked in R/3 but could not catch the correct record, since, did not had proper info. UMSA1 refers to Annual Sales, which are empty in R/3 and BW as well.
    The UMSA1 field in data source 0CUSTOMER_ATTR in BW.
    Data Type: CURR, Length: 15, Decimal: 2, curr/unit: UWAER
    The UMSA1 field in R/3
    Data Type: CURR, Length: 15, Decimal: 2
    Request your timely suggestions.
    Raj

    Dear Veerandra,
    I have already checked in R/3 as you had mentioned. But as I said earlier, could not catch the correct record, since, did not had proper info. UMSA1 refers to Annual Sales, which are empty in R/3 and BW as well.
    I have undertaken the following actions but all failed.
    1. Replicated the data source, activated the transfer structure through a program and the load was run but the load failed with the same issue.
    2. Pushed the data till PSA and tried to edit it in the PSA, but here too the load failed with the same issue.
    It is understood that the data source 0CUSTOMER_ATTR is obtained from the Funtion Module: MDEX_CUSTOMER_MD
    3. Error Handling option.
    Regards.
    Raj

  • Cannot invoke toString on the primitive type int

    im trying to make a sudoku puzzle but having trouble with the arrays, ive got two arrays
    int [][] actual = new int [9][9];
        String [][] possible = new String [9][9];part of my code im trying to generate a sudoku board, this is the part of the error in
    public void possVals(int col, int row)
              if(possible[col][row].equals(""))
                   str = "123456789";
              else str = possible[col][row];
              for(r = 1; r < 9; r++)
                   if(actual[col][r] != 0)
                        str = str.Replace(actual[col][r].toString(), "");
              }could some one tell me how to fix my error of 'cannot invoke toString on the primitive type int' please

    ajp_08 wrote:
    could some one tell me how to fix my error of 'cannot invoke toString on the primitive type int' pleaseBut you can do like this
    int i = 12345;
    String s = Integer.toString(12345);So, the following should work
    str = str.Replace(Integer.toString(actual[col][r]), "");Good luck!
    Edited by: A.J.Bharanidharan on Nov 17, 2009 6:06 PM

  • Re:Contents L001 from field /BIC/NTrtc cannot be converted in type QUAN

    Hi ,
    When loading from Flat file I am getting the following error in the developement.
    Message no. RSAR198
    Diagnosis
    The value 'L001' from field /BIC/NTrtc cannot be converted into the DDIC data type QUAN of the InfoObject in data record 1. The field content could not be transferred into the communication structure format.
    System response
    The data to be loaded has a data error or field /BIC/NTrtc of the transfer structure is mapped to an unsuitable InfoObject.
    The conversion of the transfer structure into the communication structure was cancelled. The processing of data records with errors was continued with respect to the settings in the error handling of the InfoPackage (Tab Page: Update Parameters).
    Please suggest some the resolution.
    Thanks and Regards,
    Ravi.
    Assigning points is the way to say thanks in SDN.
    Edited by: Ravi Bw on Dec 21, 2007 1:45 PM
    Edited by: Ravi Bw on Dec 21, 2007 1:53 PM
    Edited by: Ravi Bw on Dec 21, 2007 2:41 PM

    can you please answer some one this is very imporant for me..
    Siri

  • Conversion failed when converting the nvarchar value to data type int when returning nvarchar(max) from stored procedure

    Thank you for your help!!! 
    I've created a stored procedure to return results as xml.  I'm having trouble figuring out why I'm getting the error message "Conversion failed when converting the nvarchar value '<tr>.....'
    to data type int.    It seems like the system doesn't know that I'm returning a string... Or, I'm doing something that I just don't see.
    ALTER PROCEDURE [dbo].[p_getTestResults]
    @xml NVARCHAR(MAX) OUTPUT
    AS
    BEGIN
    CREATE TABLE #Temp
    [TestNameId] int,
    [MaxTestDate] [DateTime],
    [Name] [nvarchar](50),
    [Duration] [varchar](10)
    DECLARE @body NVARCHAR(MAX)
    ;WITH T1 AS
    SELECT DISTINCT
    Test.TestNameId
    , replace(str(Test.TotalTime/3600,len(ltrim(Test.TotalTime/3600))+abs(sign(Test.TotalTime/359999)-1)) + ':' + str((Test.TotalTime/60)%60,2)+':' + str(Test.TotalTime%60,2),' ','0') as Duration
    ,MaxTestDate = MAX(TestDate) OVER (PARTITION BY TM.TestNameId)
    ,TestDate
    ,TM.Name
    ,Test.TotalTime
    ,RowId = ROW_NUMBER() OVER
    PARTITION BY
    TM.TestNameId
    ORDER BY
    TestDate DESC
    FROM
    Test
    inner join TestName TM on Test.TestNameID = TM.TestNameID
    where not Test.TestNameID in (24,25,26,27)
    INSERT INTO #Temp
    SELECT
    T1.TestNameId
    ,T1.MaxTestDate
    ,T1.[Name]
    ,T1.Duration
    FROM
    T1
    WHERE
    T1.RowId = 1
    ORDER BY
    T1.TestNameId
    SET @body ='<html><body><H3>TEST RESULTS INFO</H3>
    <table border = 1>
    <tr>
    <th> TestNameId </th> <th> MaxTestDate </th> <th> Name </th> <th> Duration </th></tr>'
    SET @xml = CAST((
    SELECT CAST(TestNameId AS NVARCHAR(4)) as 'td'
    , CAST([MaxTestDate] AS NVARCHAR(11)) AS 'td'
    , [Name] AS 'td'
    , CAST([Duration] AS NVARCHAR(10)) AS 'td'
    FROM #Temp
    ORDER BY TestNameId
    FOR XML PATH('tr'), ELEMENTS ) AS NVARCHAR(MAX))
    SET @body = @body + @xml +'</table></body></html>'
    DROP TABLE #Temp
    RETURN @xml
    END
    closl

    Your dont need RETURN inside SP as you've declared @xml already as an OUTPUT parameter. Also you can RETURN only integer values using RETURN statement inside stored procedure as that's default return type of SP.
    so just remove RETURN statement and it would work fine
    To retrieve value outside you need to invoke it as below
    DECLARE @ret nvarchar(max)
    EXEC dbo.[P_gettestresults] @ret OUT
    SELECT @ret
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • Not converting anything but get error: "Conversion failed converting varchar value 'X' to data type int"

    I have created the following trigger that fires instead of an UPDATE statement and copies the altered data over to an Audit table before proceeding with the requested UPDATE. After doing so, I wrote a simple UPDATE statement for testing:
    UPDATE Products
    SET ProductCode = 'XYZ 2014', ProductName = 'Special Edition Tamborine', ListPrice = 74.99, DiscountPercent = .5
    WHERE ProductID = 28;
    When I run this, I get the following message:
    Msg 245, Level 16, State 1, Procedure Products_UPDATE, Line 14
    Conversion failed when converting the varchar value 'X' to data type int.
    Here is my trigger:
    IF OBJECT_ID('Products_UPDATE') IS NOT NULL
    DROP TRIGGER Products_UPDATE; -- LINE 14
    GO
    CREATE TRIGGER Products_UPDATE
    ON Products
    INSTEAD OF UPDATE
    AS
    DECLARE @ProductID int, @CategoryID int, @ProductCode varchar, @ProductName varchar,
    @Description varchar, @ListPrice money, @DiscountPercent money, @DateUpdated datetime
    BEGIN
    SELECT @ProductID = ProductID, @CategoryID = CategoryID, @ProductCode = ProductCode,
    @ProductName = ProductName, @Description = Description, @ListPrice = ListPrice,
    @DiscountPercent = DiscountPercent, @DateUpdated = GetDate()
    FROM deleted;
    INSERT INTO ProductsAudit
    VALUES (@ProductCode, @CategoryID, @ProductCode, @ProductName, @ListPrice,
    @DiscountPercent, @DateUpdated);
    SELECT @ProductID = ProductID, @CategoryID = CategoryID, @ProductCode = ProductCode,
    @ProductName = ProductName, @Description = Description, @ListPrice = ListPrice,
    @DiscountPercent = DiscountPercent, @DateUpdated = GetDate()
    FROM inserted;
    UPDATE Products
    SET CategoryID = @CategoryID, ProductCode = @ProductCode,
    ProductName = @ProductName, Description = @Description,
    ListPrice = @ListPrice, DiscountPercent = @DiscountPercent
    WHERE ProductID = (SELECT ProductID FROM inserted)
    END
    I am confused a bit by (1) the location of the error and (2) the reason. I have looked over my defined data types and they all match.
    Could someone offer a second set of eyes on the above and perhaps guide me towards a solution?
    Thank you.

    This is an issue in this trigger. It will work for single record updates alone. Also for your requirement you dont need a INSTEAD OF TRIGGER at all.
    You just need this
    IF OBJECT_ID('Products_UPDATE') IS NOT NULL
    DROP TRIGGER Products_UPDATE;
    GO
    CREATE TRIGGER Products_UPDATE
    ON Products
    AFTER UPDATE
    AS
    BEGIN
    INSERT INTO ProductsAudit
    SELECT ProductID,
    CategoryID,
    ProductCode,
    ProductName,
    ListPrice,
    DiscountPercent,
    GetDate()
    FROM deleted;
    END
    Now, in your original posted code there was a typo ie you repeated the column ProductCode twice
    I think one should be ProductID which is why you got error due to data mismatch (ProductID is int and ProductName is varchar)
    see below modified version of your original code
    IF OBJECT_ID('Products_UPDATE') IS NOT NULL
    DROP TRIGGER Products_UPDATE; -- LINE 14
    GO
    CREATE TRIGGER Products_UPDATE
    ON Products
    INSTEAD OF UPDATE
    AS
    DECLARE @ProductID int, @CategoryID int, @ProductCode varchar, @ProductName varchar,
    @Description varchar, @ListPrice money, @DiscountPercent money, @DateUpdated datetime
    BEGIN
    SELECT @ProductID = ProductID, @CategoryID = CategoryID, @ProductCode = ProductCode,
    @ProductName = ProductName, @Description = Description, @ListPrice = ListPrice,
    @DiscountPercent = DiscountPercent, @DateUpdated = GetDate()
    FROM deleted;
    INSERT INTO ProductsAudit
    VALUES (@ProductID, @CategoryID, @ProductCode, @ProductName, @ListPrice,
    @DiscountPercent, @DateUpdated);
    SELECT @ProductID = ProductID, @CategoryID = CategoryID, @ProductCode = ProductCode,
    @ProductName = ProductName, @Description = Description, @ListPrice = ListPrice,
    @DiscountPercent = DiscountPercent, @DateUpdated = GetDate()
    FROM inserted;
    UPDATE Products
    SET CategoryID = @CategoryID, ProductCode = @ProductCode,
    ProductName = @ProductName, Description = @Description,
    ListPrice = @ListPrice, DiscountPercent = @DiscountPercent
    WHERE ProductID = (SELECT ProductID FROM inserted)
    END
    I would prefer doing it as former way though
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

Maybe you are looking for

  • Field which store the person who created the trip

    Hi guru, we can't to find which field of which table actually store the person who created the trip inbehalf of the employee. But I can only found the person who lastly change the trip in table PTRV_HEAD field UNAME. Also what is the logic of when th

  • Activity Templates - User Defined

    Hi all, I want to execute a shell from a process flow. I have created a User Defined Activity as follows: COMMAND - #!/usr/bin/ksh PARAMETER_LIST - SUCCESS_THRESHOLD - 0 SCRIPT - full path+shell_name (/folder1/folder2/file.sh) RESULT_CODE - 1 I have

  • Problem in using UTL_FILE Package

    Dear Mates, I am trying to make use of UTL_FILE for inseting data in to the tables by reading the contents of a text file. I have set the UTL_FILE_DIR parameter by giving the path. Still i am not able to insert the records to the table. The error I a

  • MDT 2012 - Application Bundle Install Issues- Logged in as Admin randomly between reboots

    Hi Everyone,  We are on MDT 2012 / WDS... Moving to SCCM soon but not soon enough. A new problem started in our environment and I'm not sure if it's a networking, storage, or wds server / settings issue. The OS deployment happens completely fine, but

  • Can I transfer a license or find out the current status of the product registration.

    Hi, I purchased your software as part of a business, I was wondering how I would either transfer the product registration, or at least find out the status of the registration. I have several different products - LabVIEW, TestStand and some other misc