Rules for Table and Column Names in DataSet Passed to Report Writer

Stimulsoft Reports.NET discussion
Post Reply
Sandy Pham
Posts: 62
Joined: Mon Dec 11, 2006 1:43 pm
Location: U.S.A.

Rules for Table and Column Names in DataSet Passed to Report Writer

Post by Sandy Pham »

I was wondering what the rules are for the names of tables and columns in a DataSet that is passed to Stimulsoft Report Writer.

In my application, each table and field has a "Name" (used for actual database table/field names) and a "Display Name" which can contain spaces, start with numbers, etc. The "Display Name" is what is shown to users. When I created my DataSet to send to the Stimulsoft Report Writer, I used my friendly "Display Name."

Names with spaces seem to work okay, but names that start with numbers do not work because this code generation fails:

Stimulsoft.Report.Dictionary.StiDataColumn("4210 Cancellation Support", "4210 Cancellation Support", "4210 Cancellation Support", typeof(bool))


Please tell me what the rules are for DataSet table and column names.

Thank you,

Sandy
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

Rules for Table and Column Names in DataSet Passed to Report Writer

Post by Edward »

Names of the Columns is converted to the properties of the .Net class, so the requirements for them are known. There are one difference. If you are using "space" character in the name of the column, then it will be automatically changed to the "_" character inside the report class.
But you can use Aliases for the Columns and here is no limitation in naming.

Change your code in the following way, please:

Stimulsoft.Report.Dictionary.StiDataColumn("NameInSource", "Cancellation Support", "4210 Cancellation Support", typeof(bool))

Here NameInSource - it is name of the Column in the real data table (in Xml file or on the Server).

"Cancellation Support" - it is name of the Column inside the report Class (will be converted in "Cancellation_Support" inside the class automatically)

"4210 Cancellation Support" - alias of the appropriate Column and could be shown to the user instead of the Column name and can contain any sequence of any characters you need.

The rule of naming of the tables is the same as for "name" of the Columns.

Thank you.
Post Reply