DateTime Parameter

Hi ,

2 things if you can help pls

1) In a Datasource Query, in the Query Wizard I'm trying to create a date paramter
I tried the following props:

Name: param1
DataType: DateTime
Default Value: [Date]
Expression: [Date]
Size: 30.

No matter what value I set for 'Default value' or 'Expression' I cannot get it to work.
I'm getting this error "Failed to convert parameter value from a Variant to a Datetime".

2). I have a databand with a Table object that prints data from a datasource as part of the ManualBuild Script Event.
In the Edit Databand window I have Data Source Set to None.
If I select the datasource in the Edit Databand window the table prints multiple times as expected.
If you have a table object in your databand that prints out a data source. Is it possible to filter this data without repeating the table?

Thanks in advance
COH

Comments

  • edited 11:04PM
    Hello,

    1) You have to set DefaultValue to something like 1/1/2000 - it must be a string value containing a valid date. The DefaultValue is used in design-time to get the table schema. In run-time (when you run a report) the Expression is used instead.

    2) If you need to filter the data you print in the TableObject, pass the filter expression in the datasource.Init method. Here is a modified example of the demo report "Table/Row Datasource":
          // get the data source by its name
          DataSourceBase rowData = Report.GetDataSource("Products");
          // init the data source
          rowData.Init("[Products.ProductName].StartsWith(\"C\")");
    
  • edited 11:04PM
    Super.

    Thanks v much.

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.