1

I know that there are lots of questions on SO very like this but none that seem to be quite the same.

I have an ASP.NET page onto which I've added a ReportViewer control to display and RDLC local report. The report's datasource is set to an SQL datasource on the page which filters for dates according to two textboxes on the page. However, the report itself has NO parameters, it contains NO fields which are date/time either displayed or in its dataset and there are NO filters at all.

When I view the page, now that today's date (15th August) is not valid as an American format date (MM/dd/yyyy) and is being used as one of the date filters I get a "String not recognized as a valid datetime" in my reportviewer. I have no idea why the report cares about the date in the textbox on the page - it's not linked to it in any way other than via the datasource.

Out of interest I've created a new datasource which has no date filters, just a plain, simple retrieval of client information and set it as the report's datasource, and I'm STILL getting the error. It's as if the reportviewer is validating the date in the textbox without being told to - and getting it wrong!

I also added a GridView to the page using the date-filtered datasource, and it works just fine, proving that the SQL datasource itself is retrieving the information from the database without a problem.

It's just the stupid reportviewer control! Is there any way to tell it to shut up and stop checking a date in a textbox which is nothing to do with it?!

3
  • Could you include the ASP code where your SQLDataSource is declared? Aug 15, 2011 at 14:25
  • It's ok, I figured this out after two days! By setting the Language in the Report's properties to 'en-GB' it stopped complaining about the format of the dates, although I still don't understand why it was checking them in the first place. I can't close my own question because I'm too new. Aug 15, 2011 at 14:56
  • 1
    Put that explanation as an Answer to your own question and mark is as the Answer. I think that's pretty standard practice around here =) Aug 15, 2011 at 14:58

2 Answers 2

2

It's ok, I figured this out after two days! By setting the Language in the Report's properties to 'en-GB' it stopped complaining about the format of the dates, although I still don't understand why it was checking them in the first place. I can't close my own question because I'm too new.

0

It has to do with the region and language settings on the computer.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.