Showing posts with label basically. Show all posts
Showing posts with label basically. Show all posts

Monday, March 26, 2012

Error or Bug? Field in dataset won't display on report

I've got a report with 6 datasets. Each dataset has a field labeled LastUpdateDT which basically shows the last time data for that dataset was updated. All the datasets are called via the same stored procedure in the SQL database. I pass a value in to select the appropriate dataset to be returned. Each dataset returns the same fields, the only difference is the meaning of the data in each dataset, all field names and types are identical.

I'm having a problem with 2 of the datasets in the report. Each dataset is displayed in it's own table in the report. When I add the LastUpdateDt field for the 2 problem datasets to the tables, it ALWAYS comes back empty. If I run the stored proc, the LastUpdateDt field has data, if I query the dataset from within the RS designer, the field has data, but it will not display on the table. I've completely dropped and recreated both the table and dataset and get the same problem. I don't get any error or warnings, just no data for that field only. All the other fields for the dataset display fine. It is the last field in the dataset, but I've also tried moving it and got the same result.

Has anyone every encountered anything like this and if so, how did you fix it?

Here's the code used to display the value: (It's in the table header)

=" Last Updated Date: " & CStr(First(Fields!LastUpdateDt.Value))

I've also added the field (=Fields!LastUpdateDt.Value) to the detail row and get no data showing even though I can see it when running the query in the data tab.

Problem solved. PEBKAC error. (Problem Exists Between Keyboard and Chair)!

Wednesday, March 7, 2012

Error Messages

Does anyone know of a way to suppress the error messages while executing a stored procedure in MSSQL. Basically I don't want it yelling at me becuase the primary_key is invalid. I am using the @.@.ERROR object to do my own error catching and such. But when executing a SP from if it errors out it kills the program calling it, becuase of server error. Any help would be greatly appreciated.

ThanksGood programming practice is to check data validity before trying to insert it into a table. If a critical error occurs it will stop execution for the batch, so if you want to continue processing you need to separate batches (with GO statements) or enclose them in transactions.

blindman|||Thanks for the input. I have since added valididty checks in the code so that no critical errors should occur.