Groups | Blog | Home
all groups > sql server reporting services > july 2007 >

sql server reporting services : Using custom assembly to write to database


Stu
7/19/2007 10:02:04 AM
Hi guys,
I have created a custom assembly that writes to the database in the report
footer. I pass the Globals!ReportName and Globals!TotalPages parameters into
my custom assembly which writes to the database and returns back
Globals!TotalPages value.
The method signature is: public int InsertTocRow(TableOfContents toc).
When my report renders it consists of 7 pages. I want the custom assembly to
be called only once per report no matter how many pages it contains. So i use
this expression in the report footer to try and accomplish this.

iif( Globals!PageNumber=Globals!TotalPages,
CustomAssembly(Globals!ReportName,Globals!TotalPages) &"
TRUE",Globals!TotalPages & "FALSE")

So if on last page call my custom assembly or use Globals!TotalPages
parameter. This logically should work. Although i see FALSE, FALSE, FALSE,
FALSE, FALSE, FALSE, TRUE on the report pages. When i look in the database
there are 7 entries. So regardless of this expression my assembly is called 7
times when i only want it to be called once. Is there a solution to this
problem?
weilu NO[at]SPAM online.microsoft.com
7/20/2007 4:52:24 AM
Hello Stu,

Each time the report renders, it will call the Assembly. So I suggest you
remove your logical into the assembly and only invoke to insert the
database once.

Sincerely,

Wei Lu

Microsoft Online Community Support

==================================================

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.

==================================================
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
weilu NO[at]SPAM online.microsoft.com
7/24/2007 12:00:00 AM
Hi ,

How is everything going? Please feel free to let me know if you need any
assistance.

Sincerely,

Wei Lu
Microsoft Online Community Support

==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
AddThis Social Bookmark Button