Tuesday, March 27, 2012
Change image properties at runtime
I'm using Reporting Services for SQL2K. My report will need to dynamically
call a custom assembly for each row in a dataset, and then show the image
file that the custom assembly creates. I was thinking of using an Image
control in the report and then changing the path to the image file at
runtime. But I can not figure out how to access the image1.Value property.
Any tips on this or perhaps an alternative solution?
TIA
JonasI found the answer, and it was very easy ;-)
When the control is selected in the Report Designer, it it possible to edit
the properties as usual. The property for Value can also use an Expression,
and voila, this can point to a variable which contains a dynamically created
path.
Brgds
Jonas
"Jonas" <Jonas@.nospam.pl> wrote in message
news:%23z53z3cHGHA.240@.TK2MSFTNGP11.phx.gbl...
> Hi,
> I'm using Reporting Services for SQL2K. My report will need to dynamically
> call a custom assembly for each row in a dataset, and then show the image
> file that the custom assembly creates. I was thinking of using an Image
> control in the report and then changing the path to the image file at
> runtime. But I can not figure out how to access the image1.Value property.
> Any tips on this or perhaps an alternative solution?
> TIA
> Jonas
>
>
change grouping at runtime
Is there a way to give a user the option to change the grouping level at
runtime. For example if my data was grouped like this:
A
B
C
C
B
C
C
But instead of seeing the grouping broken up by "B", the user wants to view
the data without the "B" groups. They could have a drop-down list or
something that lets them switch it to be:
A
C
C
C
C
Hope this makes sense and someone has an idea.
--
Patrick StadlerHi,
I have the same functionality in some of my reports and what I end-up doing
is create a grouping parameter for my reports and use this parameter.value to
group my data within my report table ...
HTH,
Eric
"Stads" wrote:
> I have a report with a large result set that can be grouped multiple ways.
> Is there a way to give a user the option to change the grouping level at
> runtime. For example if my data was grouped like this:
> A
> B
> C
> C
> B
> C
> C
> But instead of seeing the grouping broken up by "B", the user wants to view
> the data without the "B" groups. They could have a drop-down list or
> something that lets them switch it to be:
> A
> C
> C
> C
> C
> Hope this makes sense and someone has an idea.
> --
> Patrick Stadlersql
Sunday, March 25, 2012
Change filename for flat file connection manager at runtime
I need to add the current date to the end of the filename of a flat file at runtime.
This was previously done with ActiveX script in SQL Server 2000.
oConn = DTSGlobalVariables.Parent.Connections("FlatFileConnectionManagerName")
oConn.DataSource = sNewFileName
oConn = Nothing
I would really appreciate if someone could give me some information on how to achieve this in SQL Server 2005.
Thanks in advance!
Regards,
Sara
Basically, use property expressions: http://blogs.conchango.com/jamiethomson/archive/2006/06/28/4156.aspx
-Jamie
|||
Hi Sara
I am working with SSIS packages and am having the same problem that you faced some time back
Am getting an error message in SSIS package in the following lines:
Set oConn = DTSGlobalVariables.Parent.Connections("Text File (Destination)")
oConn.DataSource = sFilename
Set oConn = Nothing
Could you tell me what you did to fix your code. Would really appreciate your time and response.
Thanks
Rishi...
|||Hi Rishi,
I did something to fix it then, but I would't solve it the same way today. The following example gets data from a file with a date in it. The date is always the current date so the Connection string needs to be updated to be able to read from the file.
I hope this gives you an idea of how to solve your problem!
Regards,
Sara
--
Script Task
Connection Manager Name: L:\VPKBA\Laddning\EDBKjerne\konto_YYYYMMDD.txt
File Name: L:\VPKBA\Laddning\EDBKjerne\konto.txt
Imports System
Imports System.IO
Imports System.Data
Imports Microsoft.SqlServer.Dts.Runtime
Public Class ScriptMain
Public Sub Main()
Dim theDate As String
Dim i As Integer
strPath = "L:\vpkba\laddning\EDBkjerne\"
theDate = Now.Year & IIf(CInt(Now.Month) < 10, "0" & Now.Month, Now.Month).ToString & IIf(CInt(Now.Day) < 10, "0" & Now.Day, Now.Day).ToString
For i = 0 To Dts.Connections.Count - 1
If Dts.Connections(i).Name.Contains("YYYYMMDD") Then
Dts.Connections.Item(i).ConnectionString = Dts.Connections.Item(i).Name.Replace("YYYYMMDD", theDate)
End If
Next
Dts.TaskResult = Dts.Results.Success
End Sub
End Class
Change filename for flat file connection manager at runtime
I need to add the current date to the end of the filename of a flat file at runtime.
This was previously done with ActiveX script in SQL Server 2000.
oConn = DTSGlobalVariables.Parent.Connections("FlatFileConnectionManagerName")
oConn.DataSource = sNewFileName
oConn = Nothing
I would really appreciate if someone could give me some information on how to achieve this in SQL Server 2005.
Thanks in advance!
Regards,
Sara
Basically, use property expressions: http://blogs.conchango.com/jamiethomson/archive/2006/06/28/4156.aspx
-Jamie
|||
Hi Sara
I am working with SSIS packages and am having the same problem that you faced some time back
Am getting an error message in SSIS package in the following lines:
Set oConn = DTSGlobalVariables.Parent.Connections("Text File (Destination)")
oConn.DataSource = sFilename
Set oConn = Nothing
Could you tell me what you did to fix your code. Would really appreciate your time and response.
Thanks
Rishi...
|||Hi Rishi,
I did something to fix it then, but I would't solve it the same way today. The following example gets data from a file with a date in it. The date is always the current date so the Connection string needs to be updated to be able to read from the file.
I hope this gives you an idea of how to solve your problem!
Regards,
Sara
--
Script Task
Connection Manager Name: L:\VPKBA\Laddning\EDBKjerne\konto_YYYYMMDD.txt
File Name: L:\VPKBA\Laddning\EDBKjerne\konto.txt
Imports System
Imports System.IO
Imports System.Data
Imports Microsoft.SqlServer.Dts.Runtime
Public Class ScriptMain
Public Sub Main()
Dim theDate As String
Dim i As Integer
strPath = "L:\vpkba\laddning\EDBkjerne\"
theDate = Now.Year & IIf(CInt(Now.Month) < 10, "0" & Now.Month, Now.Month).ToString & IIf(CInt(Now.Day) < 10, "0" & Now.Day, Now.Day).ToString
For i = 0 To Dts.Connections.Count - 1
If Dts.Connections(i).Name.Contains("YYYYMMDD") Then
Dts.Connections.Item(i).ConnectionString = Dts.Connections.Item(i).Name.Replace("YYYYMMDD", theDate)
End If
Next
Dts.TaskResult = Dts.Results.Success
End Sub
End Class
Tuesday, March 20, 2012
change Datasource at runtime
Is it possible to change the datasource dynamically in reporting services.
For example if I have a dataset named DataSet1 whose datasource1 connects to server1, how can I change the same DataSet1 to use datasource2 to points to a different server. I would like to know if this datasource change is possible out side the dataset (dynamically).
Thanks
I've had the same problem. I found that it was not possible without re-rendering the SRS code(XML). It is not possible in SRS since you can't use an expression to change the dataset. Also the field names of datasets may differ.