Friday, February 17, 2012

Empty reports

In my ASP.Net application, I need to give the user an error message when
a report is empty. Sometimes there is an exception that gets thrown and
sometimes there is not. How can I tell if the stream coming back from
RS contains an empty report?In most cases even if the report contains no data the stream isn´t empty
(PDF,ect). Did you try to get a stream back that based on the CSV format ?
It don´t now whether there will be a zero byte stream returned back by the
report server, but that should be the stream with the least overhead. If you
know how many bytes an empty report contains, you could also check the size
of the stream to evaluate the minimun for it and then throw an exception if
it is below o equeals that minimun level.
(If you got your own Data service provider, but I think that isn´t in your
case you could check for the rows in the tabes of the dataset you are
apssing to the report)
--
HTH, Jens Suessmeyer.
--
http://www.sqlserver2005.de
--
"No One" <aintnoway@.blahblahblah.com> schrieb im Newsbeitrag
news:hlmnl2-ii3.ln1@.gandalf.grey-net.com...
> In my ASP.Net application, I need to give the user an error message when a
> report is empty. Sometimes there is an exception that gets thrown and
> sometimes there is not. How can I tell if the stream coming back from RS
> contains an empty report?|||There is a "No Rows" property on the table which allows the developer to
specify a string to display if no rows of data are available.
"No One" <aintnoway@.blahblahblah.com> wrote in message
news:hlmnl2-ii3.ln1@.gandalf.grey-net.com...
> In my ASP.Net application, I need to give the user an error message when
> a report is empty. Sometimes there is an exception that gets thrown and
> sometimes there is not. How can I tell if the stream coming back from
> RS contains an empty report?|||I don't want to return a "No Rows" file. I want to display that on the
browser without trying to send the user a file at all.
Jason wrote:
> There is a "No Rows" property on the table which allows the developer to
> specify a string to display if no rows of data are available.
> "No One" <aintnoway@.blahblahblah.com> wrote in message
> news:hlmnl2-ii3.ln1@.gandalf.grey-net.com...
>>In my ASP.Net application, I need to give the user an error message when
>>a report is empty. Sometimes there is an exception that gets thrown and
>>sometimes there is not. How can I tell if the stream coming back from
>>RS contains an empty report?
>
>

No comments:

Post a Comment