locked
How to change XSD string format to Crystal report number format

    Question

  • Dear all,

            I have created a Dataset XSD with one Datatable. In the datatable,there is one field named "amount" which I have set to xs:decimal. Then I used the Datatable in Crystal report for Visual studio 2008. I put the "amount" in the design pane and found it is a string format and I cannot sum this field. I have google and found some post said that I can change the field format in the design pane by right clicking on the field and select format edit to change the field format. I have right click on the field but I can only find format object and I cannot find out how to change the report field format to number in the Crystal report. I guess the field pass from XSD to Crystal report would sure be string. Is there exist some method to change the report field in the design pane to number format? Thanks.


    hon123456
    • Moved by Aspen VJ Wednesday, July 06, 2011 5:23 AM (From:Visual C# General)
    Saturday, July 02, 2011 7:24 AM

Answers

  • I'm not sure why this is happening or how to fix it.

    This link seems to be a discussion about something similar, though no solution was proposed:

    http://forums.sdn.sap.com/thread.jspa?threadID=1955618


    Brad

    http://www.renchdev.com
    Saturday, July 02, 2011 11:15 AM
  • Hi Brench,

    That post is for CR for VS 2010 and 64 bit XML datasources so I don't think it will be of much help.

    Hon123456 create a new report off your database directly and then export the file to XML format in the standalone CR designer or use the View mode in .NET IDE and export it.

    Now you can see what data types CR needs so it picks up the correct type.

    Other option is to use a formula and convert the string to a number using the "toNumber()" function.

    Then load your report and set the old report to the new report XSD file. CR also requires the structure, easiest way is after you get your data into a data set then use:

    ds.WriteXml("c:\\Reports\\abc.xml");
    ds.WriteXmlSchema("c:\\Reports\\abc.xsd");

    to write the structure and data to the files.

    Thank you

    Don


    Don Williams
    Wednesday, July 06, 2011 1:27 PM

All replies

  • I'm not sure why this is happening or how to fix it.

    This link seems to be a discussion about something similar, though no solution was proposed:

    http://forums.sdn.sap.com/thread.jspa?threadID=1955618


    Brad

    http://www.renchdev.com
    Saturday, July 02, 2011 11:15 AM
  • Hi Hon123456,

    I move this thread to Crystal Report forum. Thanks for understanding.


    Vin Jin [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Wednesday, July 06, 2011 5:22 AM
  • Hi hon123456,

    Is any progress made with brench's suggestion?
    Thanks.
    Leo Liu [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Wednesday, July 06, 2011 8:42 AM
  • Hi Brench,

    That post is for CR for VS 2010 and 64 bit XML datasources so I don't think it will be of much help.

    Hon123456 create a new report off your database directly and then export the file to XML format in the standalone CR designer or use the View mode in .NET IDE and export it.

    Now you can see what data types CR needs so it picks up the correct type.

    Other option is to use a formula and convert the string to a number using the "toNumber()" function.

    Then load your report and set the old report to the new report XSD file. CR also requires the structure, easiest way is after you get your data into a data set then use:

    ds.WriteXml("c:\\Reports\\abc.xml");
    ds.WriteXmlSchema("c:\\Reports\\abc.xsd");

    to write the structure and data to the files.

    Thank you

    Don


    Don Williams
    Wednesday, July 06, 2011 1:27 PM