Showing posts with label box. Show all posts
Showing posts with label box. Show all posts

Sunday, March 25, 2012

Custome code not working in Report manager

Hi all,
I have Written the Custom code to compare two different dates and
show a message Box depending on their values .It was Working Fine in
preview tab.But it is not working when i deploy to web.Only rhe message
box part is not working in Web
I do have the Custom code like this
Public Function Errorbox(ByVal s as Date,ByVal s1 as Date) As String
If s>s1 Then
System.Windows.Forms.MessageBox.Show("From Date is greater than
To Date,Please Click Ok" )
End if
Return "a"
End Function
and i gave a text box (Just a text box)
To call this custome code and i gave the expression
=Code.Errorbox(Parameters!FROM_DATE.Value,Parameters!TO_DATE.Value)
i added this Assembly also
"System.Windows.Forms"
Its not working in Report manager(web) .Can any body help me out to
knowwhat would be the Problem.i am very new to this VB Coding
Thank you
Raj Deep.AYou need to add the assembly to the following folders:
C:\Program Files\Microsoft SQL Server\80\Tools\Report Designer
C:\Program Files\Microsoft SQL Server\MSSQL\Reporting
Services\ReportServer\bin
Hope this helps.
"RajDeep" wrote:
> Hi all,
> I have Written the Custom code to compare two different dates and
> show a message Box depending on their values .It was Working Fine in
> preview tab.But it is not working when i deploy to web.Only rhe message
> box part is not working in Web
> I do have the Custom code like this
> Public Function Errorbox(ByVal s as Date,ByVal s1 as Date) As String
> If s>s1 Then
> System.Windows.Forms.MessageBox.Show("From Date is greater than
> To Date,Please Click Ok" )
> End if
> Return "a"
> End Function
> and i gave a text box (Just a text box)
> To call this custome code and i gave the expression
> =Code.Errorbox(Parameters!FROM_DATE.Value,Parameters!TO_DATE.Value)
> i added this Assembly also
> "System.Windows.Forms"
> Its not working in Report manager(web) .Can any body help me out to
> knowwhat would be the Problem.i am very new to this VB Coding
> Thank you
> Raj Deep.A
>

Wednesday, March 7, 2012

Custom DataFlow Transformation not showing up in toolbox

I've created a custom data flow tranformation and it isn't showing up in the Tool Box Items to be added under the Data Flow Items tab (right click on tool box, 'Choose Items...', then clicked Data Flow Items).

I have done the following:

signed the assembly,

added to GAC,

copied the dll to C:\Program Files\Microsoft SQL Server\90\DTS\PipelineComponents.

It worked previously when I was just starting out, however now I cannot see it. What would cause it to not show up? Everything compiles fine. How would I determine how to fix it so that it shows up?

Apart from the component being in the GAC, there are two key steps to be taken for a custom component to be recognized by the BI Studio:

placing the binary under the folder where SSIS design time checks to enumerate pipeline components, which is at <SQL Installation Folder>\90\DTS\Pipeline Components (I'd double check this on the target machine via the reg key at the very bottom, cause it could be different on a 64bit or in a production server)

Friday, February 24, 2012

custom code and messagebox popup

Hi at all,
I have custom code written the to show a message Box.
It was working fine in DotNet2005 Development enviroment preview tab.
But it is't working when i deploy this report to the web.
Please use a reference to
System.Windows.Forms, Version=2.0.0.0
Public Function Test() As String
System.Windows.Forms.MessageBox.Show("Hello")
' Or
Msgbox "Hello2"
Return "OK"
End Function
Can anyone help me
martinYou can't use System.Windows.Forms for a web page. Please see the following
URL: http://www.freevbcode.com/ShowCode.asp?ID=5918. If you don't want to
go there, use the following function to stream out a message box
Public Sub ASPNET_MsgBox(ByVal Message As String)
System.Web.HttpContext.Current.Response.Write("<SCRIPT
LANGUAGE=""JavaScript"">" & vbCrLf)
System.Web.HttpContext.Current.Response.Write("alert(""" & Message &
""")" & vbCrLf)
System.Web.HttpContext.Current.Response.Write("</SCRIPT>")
End Sub
--
================Living proof that 95% of programmers are idiots.
"Martin Jau" wrote:
> Hi at all,
> I have custom code written the to show a message Box.
> It was working fine in DotNet2005 Development enviroment preview tab.
> But it is't working when i deploy this report to the web.
> Please use a reference to
> System.Windows.Forms, Version=2.0.0.0
> Public Function Test() As String
> System.Windows.Forms.MessageBox.Show("Hello")
> ' Or
> Msgbox "Hello2"
> Return "OK"
> End Function
> Can anyone help me
> martin
>
>

Custom Code accessing Dataset

Hello

my problem is this ...i pass a parameter from an asp page to open a report which works fine, however the display name for the text box in the header of the report should be the description of the parameter not the parameter id

i would like to create a function in the custom code that passes the parameter id and returns the parameter description as the possible description values are dynamic and there are over 400 hardcoding the code is not an option

thanks in advance for any advice

I'm not clear on what you are reffering to as "parameter description"? A report parameter will have three values accessible through either custom code or through a report expression: Value, Label, and IsMultiValue. If the "parameter description" is something defeined outside of the report you can access it in cusom code just as you could in any other .NET code.

Thanks, Jon

|||

You mean that you have a parameter which includes description as text and ID as value?

You should be able to query this in the way described here:
http://msdn2.microsoft.com/en-us/library/ms157274.aspx

The Parameters collection contains the report parameter objects within the report. Parameters can be passed to queries, used in filters, or used in other functions that alter the report appearance and content based on the parameter. When you define query parameters, they are automatically added to the report parameter collection. The following table describes the properties defined on a Parameter: Count, IsMultiValue, Value and Label.

Property

Description

Count

An integer that indicates the number of parameters in the collection.

IsMultiValue

A Boolean that identifies this parameter as having a set of values.

Value

The value for the parameter. For a multivalued parameter, Value returns an array of objects.

Label

A user-friendly label for the parameter. If no label is specified, the value of the Label property equals the Value property. If more than one Label is associated with the same Value, the first matching Label is used. For a multivalued parameter, Label returns an array of objects.

Parameters can be accessed through either the property syntax or the collection syntax. The following expression shows how to access every member of the Parameters collection and, when placed in a text box in a report item, displays the contents of the parameter ProductSubCategory.

So a proper expression for e.g. a parameter called Product would be:
Parameters!Product.Label

cheers,
Markus

Custom Code

I've created a function in the code tab but when I go back to the text box
that is going to call the custom code through the expression... i type code.
and my function isn't there... anybody else see this?Hi,
"Code" or "Report" is a global object pertaining to Reporting Services.
User defined functions wont be visible since it is not a user created class.
Amarnath
"gdjoshua" wrote:
> I've created a function in the code tab but when I go back to the text box
> that is going to call the custom code through the expression... i type code.
> and my function isn't there... anybody else see this?