Adding a column to a DataSet (xsd) for a Crystal Report

后端 未结 2 1976
攒了一身酷
攒了一身酷 2021-01-13 10:27

I am working on a report and need to add a column to one of my datasets and to the RPT file, but when I try to modify the Data Set, I get an error that the specified table d

相关标签:
2条回答
  • 2021-01-13 11:01

    My approach would be to actually modify the data outside of Crystal. So whether that means changing your query, or updating the .xsd, you'd add your column there. Then in Crystal Reports, you would go to "Database" in the menu bar, and choose "Verify Database" if your datasource/location hasn't changed, or "Set datasource location" if it has. Once you reverify the datasource, your new column should appear in the database fields, and you'll be able to drag it into your report.

    0 讨论(0)
  • 2021-01-13 11:24

    After several days of digging, and finding a lot of information that was not helpful, I finally managed to find the answer to my issue in a post from 2006 here:

    http://sstjean.blogspot.com/2006/12/xsdexe-and-msdatasetgenerator-operate.html

    What I did to fix my problem:

    • Manually edit the XSD file in a text editor and add the columns that I needed. This made them appear in my XSD when viewed within Visual Studio.
    • Run the specified Custom Tool for the XSD to regenerate the DataSet. In my case it was the MSDataSetGenerator. This was listed on the Properties tab in VS, and I could right click on the XSD in Solution Explorer and select Run Custom Tool.
    • Open my RPT file and run Verify Databse. This finally indicated that the database had changed and it was updating the report, and I now saw my new field in the Report Designer.
    0 讨论(0)
提交回复
热议问题