Error Filtering Date Field on SQL Server 2005

Stimulsoft Reports.NET discussion
Post Reply
mace242
Posts: 43
Joined: Tue Aug 21, 2007 9:24 am

Error Filtering Date Field on SQL Server 2005

Post by mace242 »

I have a DateTime filed on a databand and when I add a filter for the band I get the following error:

---------------------------
Method : [get_Class_Attendance_Date]
Object reference not set to an instance of an object.
---------------------------

I have looked through the code of the report and cannot find the method get_Class_Attendance_Date. This only seems to be happening since the last major update. Please address this quickly as it is happening for a customer of ours and we wish to get a solution to them quickly.

Can sent the offending mrt file or anything else - just let me know what you need.

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

Error Filtering Date Field on SQL Server 2005

Post by Edward »

Yes, please send the mrt report template to support[at]stimulsoft.com with explanations about which kind of filter did you want to add.

Thank you.
mace242
Posts: 43
Joined: Tue Aug 21, 2007 9:24 am

Error Filtering Date Field on SQL Server 2005

Post by mace242 »

Edward wrote:Yes, please send the mrt report template to support[at]stimulsoft.com with explanations about which kind of filter did you want to add.

Thank you.
Sent this a while ago. Any progress?
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

Error Filtering Date Field on SQL Server 2005

Post by Edward »

Sorry but we've sent your a letter couple days ago. Please check your e-mail. We are sending the answer again.

Thank you.
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

Error Filtering Date Field on SQL Server 2005

Post by Edward »

Please try to insert the following expression in the Filter of your DataBand:

((MainData["Class_Attendance_Date"] == null)||(MainData["Class_Attendance_Date"] is System.DBNull))?false:
(((MainData.Class_Attendance_Date > new DateTime(01,01,2007))&&(MainData.Class_Attendance_Date < new DateTime(04,21,2008)))?true:false)

If the issue is still present, please save the data of your report with the following steps:

Please go to the Designer, open your report from .mrt file
(or right - Click on the StiReport component in the Visual Studio and select Design Report) it depends on the way you
design the report

In the BeforePrintEvent of the first Page in your report, please write the following code:

C#
string dataSourceName = "MainData";
DataTable dataTable = this.Dictionary.DataSources[dataSourceName].DataTable;
DataSet ds = dataTable.DataSet;
ds.WriteXmlSchema("D:\\myDataSet.xsd");
ds.WriteXml("D:\\myDataSet.xml");

Please send two files
D:\myDataSet.xsd
D:\myDataSet.xml

Thank you.
mace242
Posts: 43
Joined: Tue Aug 21, 2007 9:24 am

Error Filtering Date Field on SQL Server 2005

Post by mace242 »

Sent email - but I'll post here for future viewers of the topic.

The workaround you posted worked. I would prefer if the between date filter didn't except if it finds null values though. After all the between string filter doesn't.
Vital
Posts: 1278
Joined: Fri Jun 09, 2006 4:04 am

Error Filtering Date Field on SQL Server 2005

Post by Vital »

Hello,

We have updated our code. Patch will be available in next prerelease build build.

Thank you.
Post Reply