Showing posts with label reportviewer. Show all posts
Showing posts with label reportviewer. Show all posts

Friday, March 30, 2012

Invoke or detect Print Report event

Hi
I'm not sure if this is possible, but hoping that someone out there can
give some guidance.
I'm using a reporting services ReportViewer object to view reports via
an ASP.NET application. I've just upgraded to SP2 to make use of the
print functionality.
However a requirement i have is that a particular report can be printed
only once. Is there a way that i can tap into the Print Report button
event so that i can detect if the print button has been clicked?
Or alternatively is there a way i can invoke the print method from
within ASP.NET aplication?
Or maybe there is some other way to do this....all suggestions
welcome!!!!!!!
Many many thanks in advance
Cheers!!!!There is no way to do this that I know of. And what counts as once? What if
they open up IE again and view the report again? How would you know that it
is the first or second time?
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"muirboy" <gmuir@.statestreet.com> wrote in message
news:1157040604.891636.111600@.m73g2000cwd.googlegroups.com...
> Hi
> I'm not sure if this is possible, but hoping that someone out there can
> give some guidance.
> I'm using a reporting services ReportViewer object to view reports via
> an ASP.NET application. I've just upgraded to SP2 to make use of the
> print functionality.
> However a requirement i have is that a particular report can be printed
> only once. Is there a way that i can tap into the Print Report button
> event so that i can detect if the print button has been clicked?
> Or alternatively is there a way i can invoke the print method from
> within ASP.NET aplication?
> Or maybe there is some other way to do this....all suggestions
> welcome!!!!!!!
> Many many thanks in advance
> Cheers!!!!
>|||Bruce
They should be able to view it as many times as they want, therefore
coming out of IE and back in again would be fine. Essentially once
someone had clicked on the print button it would go back to the DB to
say that the report has been printed, thus locking it for anyone else.
If this sounds bizarre, its due a requirement from an external company
that only one print out should exist. There is a 'duplicate' function
which gives the user access to print the same report again, however the
word 'duplicate' would be splashed over to signify it is not the
original
So are you saying there's no way for me to detect the print function
has been invoked?
Thanks
Bruce L-C [MVP] wrote:
> There is no way to do this that I know of. And what counts as once? What if
> they open up IE again and view the report again? How would you know that it
> is the first or second time?
>|||It is a client side active X control. If you were to detect it, it would
have to be via script and I just don't know. From RS perspective it is just
another rendering request for the report. What about exporting to PDF?
Unless you turn off exporting to PDF (which cannot be done by report, only
for the complete server) then all the user has to do is export to PDF and
print (which is what my users used to do before they adding printing).
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"muirboy" <gmuir@.statestreet.com> wrote in message
news:1157044757.246385.151290@.74g2000cwt.googlegroups.com...
> Bruce
> They should be able to view it as many times as they want, therefore
> coming out of IE and back in again would be fine. Essentially once
> someone had clicked on the print button it would go back to the DB to
> say that the report has been printed, thus locking it for anyone else.
> If this sounds bizarre, its due a requirement from an external company
> that only one print out should exist. There is a 'duplicate' function
> which gives the user access to print the same report again, however the
> word 'duplicate' would be splashed over to signify it is not the
> original
> So are you saying there's no way for me to detect the print function
> has been invoked?
> Thanks
> Bruce L-C [MVP] wrote:
>> There is no way to do this that I know of. And what counts as once? What
>> if
>> they open up IE again and view the report again? How would you know that
>> it
>> is the first or second time?
>>
>

Friday, March 9, 2012

Invalid character in a report

Hi!

Trying to generate a report (using WebForm ReportViewer, from dynamically created RDL report and SQL Server 2005 OLAP cube), if a database field contains control characters (code < 0x20), Reporting Services generate following message:

' ', hexadecimal value 0x02, is an invalid character. Line 1, position 2376.

Is it possible to ignore that? I don't care if browser shows an octopus, the report must work.

Thanks, Andrei.

Could you publish RDL (or e-mail it to me)?

thanks!

|||

Lev,

I've just emailed RDL and other details to you.

I could reproduce the problem using sample AdventureWorksDW and OLAP (standard edition).

Create an OLAP table report, put e.g. Model Name in one of columns. The report works fine. Now change e.g. ModelName for one of products, to include control character(s), e.g.:

update DimProduct
set ModelName = 'Mountain-100 ' + char(31) + char(2) + ' AB'
where ProductAlternateKey = 'BK-M82S-38'

Reprocess Product dimension.

Refresh the report. Once Montain-100 model is about to be displayed on the page you should get following message:

hexadecimal value 0x1F, is an invalid character. Line 1, position 2385.

I've just noticed that after the change applied even OLAP browser of SQL Server Management Studio generates the same error if only the ModelName is about to be displayed.

So it may be Analysis Service's problem indeed.

I've tried with non-OLAP reports in Reporting Services, and they work fine, displaying square placeholders.

|||That is known AS issue. Certain control characters cannot be transmitted from server to client.

Invalid character in a report

Hi!

Trying to generate a report (using WebForm ReportViewer, from dynamically created RDL report and SQL Server 2005 OLAP cube), if a database field contains control characters (code < 0x20), Reporting Services generate following message:

' ', hexadecimal value 0x02, is an invalid character. Line 1, position 2376.

Is it possible to ignore that? I don't care if browser shows an octopus, the report must work.

Thanks, Andrei.

Could you publish RDL (or e-mail it to me)?

thanks!

|||

Lev,

I've just emailed RDL and other details to you.

I could reproduce the problem using sample AdventureWorksDW and OLAP (standard edition).

Create an OLAP table report, put e.g. Model Name in one of columns. The report works fine. Now change e.g. ModelName for one of products, to include control character(s), e.g.:

update DimProduct
set ModelName = 'Mountain-100 ' + char(31) + char(2) + ' AB'
where ProductAlternateKey = 'BK-M82S-38'

Reprocess Product dimension.

Refresh the report. Once Montain-100 model is about to be displayed on the page you should get following message:

hexadecimal value 0x1F, is an invalid character. Line 1, position 2385.

I've just noticed that after the change applied even OLAP browser of SQL Server Management Studio generates the same error if only the ModelName is about to be displayed.

So it may be Analysis Service's problem indeed.

I've tried with non-OLAP reports in Reporting Services, and they work fine, displaying square placeholders.

|||That is known AS issue. Certain control characters cannot be transmitted from server to client.