Showing posts with label string. Show all posts
Showing posts with label string. Show all posts

Monday, March 19, 2012

Dynamic IN clause

I have a "can this be done" question...
I currently have a stored procedure that builds a string into a SQL
Statement and runs it.
This is an abreviated version as an example:
CREATE PROCEDURE stp_ClaimInfo
@.DFTAX# VARCHAR(12),
@.TCLAIM varchar(1000)
AS
BEGIN
DECLARE @.SQLstr varchar(4000)
set @.SQLstr = ' SELECT TMBR#, TCLAIM, SUM(TFLD16) AS TTFLD16 '
+ ' FROM tbl_claim_status'
+ ' WHERE DFTAX# = ''' + @.DFTAX# + ''''
+ ' AND TCLAIM IN (' + @.TCLAIM + ')'
+ ' GROUP BY TMBR#, TCLAIM'
exec(@.SQLstr)
END
And the run it as:
EXEC stp_ClaimInfo '86- 0291651','606900122,606900121,606800078'
The reason is because of the "IN" cluase. I need to pass it claim numbers,
but there can be one or more at a time, and different each time it is run.
In effect, the above query ends up as:
SELECT TMBR#, TCLAIM, SUM(TFLD16) AS TTFLD16
FROM tbl_claim_status
WHERE DFTAX# = '86-0291651'
AND TCLAIM IN (606900122,606900121,606800078)
GROUP BY TMBR#, TCLAIM
My question is how can I pass a dynamic list of values for the IN clause but
not have to write the statement as a string then execute it using
"exec(@.SQLstr)"? Can this be done?
-- AndrewUse the sp_executesql , this way you can add parameter definition. This
is an example i used in an SP with OUTPUT parameters.
---
USE OUTPUT PARAM
http://support.microsoft.com/defaul...B;EN-US;q262499
---
DECLARE @.v_sql = NVARCHAR(4000)
SET @.v_sql = N'SELECT @.v_totalrowcountOUT = isnull(count(1),0) FROM
'+@.v_tablename_vc
SET @.ParmDefinition = N'@.v_totalrowcountOUT INT OUTPUT '
EXECUTE sp_executesql @.v_sql , @.ParmDefinition , @.v_totalrowcountOUT =@.
v_totalrowcount OUTPUT
---
USE INPUT PARAM
---
/* Build the SQL string once.*/
DECLARE @.SQLString NVARCHAR(4000)
DECLARE @.IntVariable INT
SET @.IntVariable = 100
SET @.SQLString = N'SELECT * FROM pubs.dbo.employee WHERE job_lvl =
@.level'
SET @.ParmDefinition = N'@.level tinyint'
/* Execute the string with the first parameter value. */
SET @.IntVariable = 35
EXECUTE sp_executesql @.SQLString, @.ParmDefinition, @.level = @.IntVariable|||> My question is how can I pass a dynamic list of values for the IN clause
> but not have to write the statement as a string then execute it using
> "exec(@.SQLstr)"? Can this be done?
SQL Server does not know what an array is, so no, you can't fool it into
believing this string is an array of ints. You can, however, encapsulate
splitting functionality off into another object.
http://www.aspfaq.com/2248
A|||You could do something like
AND ',' + @.TCLAIM + ',' LIKE '%,' + TCLAIM + ',%'
its not pretty though
"Andrew" wrote:

> I have a "can this be done" question...
> I currently have a stored procedure that builds a string into a SQL
> Statement and runs it.
> This is an abreviated version as an example:
> CREATE PROCEDURE stp_ClaimInfo
> @.DFTAX# VARCHAR(12),
> @.TCLAIM varchar(1000)
> AS
> BEGIN
> DECLARE @.SQLstr varchar(4000)
> set @.SQLstr = ' SELECT TMBR#, TCLAIM, SUM(TFLD16) AS TTFLD16 '
> + ' FROM tbl_claim_status'
> + ' WHERE DFTAX# = ''' + @.DFTAX# + ''''
> + ' AND TCLAIM IN (' + @.TCLAIM + ')'
> + ' GROUP BY TMBR#, TCLAIM'
> exec(@.SQLstr)
> END
> And the run it as:
> EXEC stp_ClaimInfo '86- 0291651','606900122,606900121,606800078'
> The reason is because of the "IN" cluase. I need to pass it claim numbers
,
> but there can be one or more at a time, and different each time it is run.
> In effect, the above query ends up as:
> SELECT TMBR#, TCLAIM, SUM(TFLD16) AS TTFLD16
> FROM tbl_claim_status
> WHERE DFTAX# = '86-0291651'
> AND TCLAIM IN (606900122,606900121,606800078)
> GROUP BY TMBR#, TCLAIM
>
> My question is how can I pass a dynamic list of values for the IN clause b
ut
> not have to write the statement as a string then execute it using
> "exec(@.SQLstr)"? Can this be done?
> -- Andrew
>
>|||Andrew (AndrewR2k1@.hotmail.com) writes:
> My question is how can I pass a dynamic list of values for the IN clause
> but not have to write the statement as a string then execute it using
> "exec(@.SQLstr)"? Can this be done?
Indeed, this can be done in a multitude of ways. For a quick start,
look at http://www.sommarskog.se/arrays-in-...ist-of-strings.
To see more ways, read the rest of the article.
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx|||dizzler (john.dacosta@.gmail.com) writes:
> Use the sp_executesql , this way you can add parameter definition. This
> is an example i used in an SP with OUTPUT parameters.
sp_executesql does not change matters here. You would still have
to interpolate the list of values into the SQL string, you cannot
pass it as a parameter to sp_executesql.
The correct answer is that this is a task that you should not use
dynamic SQL at all for.
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx|||You do not understand SQL at all and want to keep writing BASIC. And
you use tbl- prfixes, # in names and what look like dat type prefixes
on column names. And put it in uppercase to make it harder to read. I
also loved seeing "fld_16" vague and it lets us know that you still
thinkin fields nad do not know about relational columns. You cannot
have a table named "_status" because a status is an atrribute not an
entity.
CREATE PROCEDURE GetClaimsList
(@.my_tax_nbr CHAR(10), @.p01 CHAR(9), @.p02 CHAR(9), .., @.p50 CHAR(9))
AS
SELECT member_nbr, claim_nbr SUM(fld_6) AS foobar_total
FROM Claims
WHERE df_tax_nbr = @.my_tax_nbr
AND claim_nbr IN (@.p01 CHAR(9), @.p02 CHAR(9), .. , @.p50 CHAR(9))
GROUP BY member_nbr, claim_nbr ;
Did you know that a T-SQL proc can have over 1000 parameters? Do you
eer need more than that? Wow! Compiled code that ports easily.|||dizzler,
Thank you for the reply, but I feel you missed the point of my question.
-- Andrew
"dizzler" <john.dacosta@.gmail.com> wrote in message
news:1143668337.316099.27080@.i40g2000cwc.googlegroups.com...
> Use the sp_executesql , this way you can add parameter definition. This
> is an example i used in an SP with OUTPUT parameters.
> ---
> USE OUTPUT PARAM
> http://support.microsoft.com/defaul...B;EN-US;q262499
> ---
> DECLARE @.v_sql = NVARCHAR(4000)
> SET @.v_sql = N'SELECT @.v_totalrowcountOUT = isnull(count(1),0) FROM
> '+@.v_tablename_vc
> SET @.ParmDefinition = N'@.v_totalrowcountOUT INT OUTPUT '
> EXECUTE sp_executesql @.v_sql , @.ParmDefinition , @.v_totalrowcountOUT =@.
> v_totalrowcount OUTPUT
>
> ---
> USE INPUT PARAM
> ---
> /* Build the SQL string once.*/
> DECLARE @.SQLString NVARCHAR(4000)
> DECLARE @.IntVariable INT
> SET @.IntVariable = 100
> SET @.SQLString = N'SELECT * FROM pubs.dbo.employee WHERE job_lvl =
> @.level'
> SET @.ParmDefinition = N'@.level tinyint'
> /* Execute the string with the first parameter value. */
> SET @.IntVariable = 35
> EXECUTE sp_executesql @.SQLString, @.ParmDefinition, @.level = @.IntVariable
>|||Phillip,
Thank you for the reply, but your suggestion just wouldn't work for the
situation I have as the incoming string is a comma deliminated list and
trying to break it apart outside the SQL Statement would reduce the
efficiency of the whole process. In a different situation, your suggestion
could prove to be a useful answer.
-- Andrew
"Phillip Wilson" <Phillip Wilson@.discussions.microsoft.com> wrote in message
news:12B92F8B-101B-4184-8351-365B1D786293@.microsoft.com...
> You could do something like
> AND ',' + @.TCLAIM + ',' LIKE '%,' + TCLAIM + ',%'
> its not pretty though
> "Andrew" wrote:
>|||Aaron,
Thank you for the reply, this is the answer I was looking for...fantastic
ideas here. Thank ya much!
-- Andrew
"Aaron Bertrand [SQL Server MVP]" <ten.xoc@.dnartreb.noraa> wrote in message
news:uGW%23Zo3UGHA.1688@.TK2MSFTNGP11.phx.gbl...
> SQL Server does not know what an array is, so no, you can't fool it into
> believing this string is an array of ints. You can, however, encapsulate
> splitting functionality off into another object.
> http://www.aspfaq.com/2248
> A
>

Wednesday, March 7, 2012

Dynamic datasource name

Hi
Is there a way we can define the datasource name/connection string for a
report in a config file... and read it from there so that it would make the
job of deploying across various servers easy?Various approaches for dynamic database connections in RS 2000 are
available:
* Use a custom data processing extension
http://msdn.microsoft.com/library/en-us/RSPROG/htm/rsp_prog_extend_dataproc_5c2q.asp
* Use the SOAP API by calling SetDataSourceContents:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/rsprog/htm/rsp_ref_soapapi_service_lz_2ojd.asp
* Use the linked server functionality of SQL Server - you should some
threads about it in the archives of this newsgroup.
* If the databases are on the same server, use a dynamic query text (i.e.
="select * from " & Parameters!DatabaseName.Value & "..table")
* If you're just toggling between two or three databases, you can publish
the same report 3 times with 3 different names using 3 different data
sources and write a main report that shows/hides the correct subreport based
on whatever criteria you want.
In addition, native support (expression-based connection strings) is
available in RS 2005: Finish the design of the datasets with a constant
connection string and make sure everything works. Then, go back to the data
tab and open the dataset/data source dialog and change the connection string
to be an expression. Use string concatenation to plug in the parameter
value. Here is an example of how the RDL would look for a parameter-based
connection string:
<DataSources>
<DataSource Name="Northwind">
<ConnectionProperties>
<DataProvider>SQL</DataProvider>
<ConnectString>="data source=" & Parameters!ServerName.Value
& ";initial catalog=Northwind;"</ConnectString>
<IntegratedSecurity>true</IntegratedSecurity>
</ConnectionProperties>
</DataSource>
</DataSources>
<ReportParameters>
<ReportParameter Name="ServerName">
<DataType>String</DataType>
<Prompt>ServerName</Prompt>
</ReportParameter>
</ReportParameters>
You can also check this blog posting:
http://blogs.msdn.com/bwelcker/archive/2005/04/29/413343.aspx
-- Robert
This posting is provided "AS IS" with no warranties, and confers no rights.
"PV" <PV@.discussions.microsoft.com> wrote in message
news:25C803F0-8944-4712-9A72-51F26DED394D@.microsoft.com...
> Hi
> Is there a way we can define the datasource name/connection string for a
> report in a config file... and read it from there so that it would make
> the
> job of deploying across various servers easy?

Sunday, February 26, 2012

Dynamic Data Source Expression

When i attempt to create a dynamic data source using an expression,
having tested the report with a constant data source string, the report
compilation fails with this error:
[rsUnexpectedCompilerError] An unexpected error occurred while
compiling expressions. Native compiler return value: '[BC32017]
Comma, ')', or a valid expression continuation expected.'
I am using Visual Studio 2005.
Simply changing the data source string from:
Data source = xxx;intial catalog=yyy
to:
=Data source = xxx;intial catalog=yyy
causes this error - i.e. I am not even referencing any parameters.
Has anyone encountered this before? Any resolutions?Amendment:
=Data source = xxx;intial catalog=yyy
should read:
="Data source = xxx;intial catalog=yyy"

Friday, February 24, 2012

Dynamic connection to the Database

Hi,
I want to connect to several databases, is it possible to pass the
connection string as a parameter and change connection to the database
dynamically ?
Thanks.Try this
="data source=" &Parameters!ServerName.Value & ";initial
catalog=AdventureWorks
Of course you can change anything in the connection string... In your case,
you'd provide the catalog instead of the servername...
--
Wayne Snyder MCDBA, SQL Server MVP
Mariner, Charlotte, NC
I support the Professional Association for SQL Server ( PASS) and it''s
community of SQL Professionals.
"yfat" wrote:
> Hi,
> I want to connect to several databases, is it possible to pass the
> connection string as a parameter and change connection to the database
> dynamically ?
> Thanks.|||I believe you want the SetDataSourceContents method. You can find an
explanation of it in BOL.
"yfat" wrote:
> Hi,
> I want to connect to several databases, is it possible to pass the
> connection string as a parameter and change connection to the database
> dynamically ?
> Thanks.|||Ok, I tried to create a dynamic data source with two parameters - the server
name and the database name like this :
="data source=" &Parameters!ServerName.Value & ";initial
catalog=" &Parameters!DBName.Value
but when I try to continue with that data source i get this error about
trying to connect the data base :
"A connection cannot be made to the database. Set and check the connection
string."
sice the connection is a dynamic one, I cannot know at the design time the
user and the password for the data base.
"Wayne Snyder" wrote:
> Try this
> ="data source=" &Parameters!ServerName.Value & ";initial
> catalog=AdventureWorks
>
> Of course you can change anything in the connection string... In your case,
> you'd provide the catalog instead of the servername...
> --
> Wayne Snyder MCDBA, SQL Server MVP
> Mariner, Charlotte, NC
> I support the Professional Association for SQL Server ( PASS) and it''s
> community of SQL Professionals.
>
> "yfat" wrote:
> > Hi,
> > I want to connect to several databases, is it possible to pass the
> > connection string as a parameter and change connection to the database
> > dynamically ?
> >
> > Thanks.|||I just saw that the connection string on Reporting Services version 1.0
cannot be based on expressions, Is it possible on the next version ?
"yfat" wrote:
> Ok, I tried to create a dynamic data source with two parameters - the server
> name and the database name like this :
> ="data source=" &Parameters!ServerName.Value & ";initial
> catalog=" &Parameters!DBName.Value
> but when I try to continue with that data source i get this error about
> trying to connect the data base :
> "A connection cannot be made to the database. Set and check the connection
> string."
> sice the connection is a dynamic one, I cannot know at the design time the
> user and the password for the data base.
> "Wayne Snyder" wrote:
> > Try this
> >
> > ="data source=" &Parameters!ServerName.Value & ";initial
> > catalog=AdventureWorks
> >
> >
> > Of course you can change anything in the connection string... In your case,
> > you'd provide the catalog instead of the servername...
> > --
> > Wayne Snyder MCDBA, SQL Server MVP
> > Mariner, Charlotte, NC
> >
> > I support the Professional Association for SQL Server ( PASS) and it''s
> > community of SQL Professionals.
> >
> >
> > "yfat" wrote:
> >
> > > Hi,
> > > I want to connect to several databases, is it possible to pass the
> > > connection string as a parameter and change connection to the database
> > > dynamically ?
> > >
> > > Thanks.

Dynamic Connection Strings

Hi,

I am looking to allow a user to select which database they need to connect to, and then for them to be able to use that connection string until they choose a different database. I have a separate database specifically to hold the list of databases with the respective connection strings, and various forms that are currently looking at the web.config for the connection string. Unfortunately, I can't just put all the connection strings into the web.config as the number of databases available to the user will increase on a weekly basis which will be handled by a database administrator, so I want a user to select from a list of databases (for which they have permissions), and for that connection string to remain for that user. Potentially there will be 20 or more users each connected to a different database (all SQL Express).

If anyone can provide any help on this I will be truly thankful as I've hunted on the internet for hours and have been unable to find anything that has helped.

Thanks in advance.

Paul

Try this class: SqlConnectionStringBuilder

There are versions for Oracle, OLEDB, etc.

|||

I have a very similar problem and I thought I had it cracked with the following:

Public

objClientConnectionAsNew ConnectionStringSettings

PublicSub Page_Init(ByVal senderAsObject,ByVal eAs System.EventArgs)
If Session("ClientDBConnectionString") <>""Then
objClientConnection.ConnectionString = Session("ClientDBConnectionString")
objClientConnection.Name ="ClientDBConnection"
objClientConnection.ProviderName ="System.Data.SqlClient"
Else
objClientConnection = ConfigurationManager.ConnectionStrings("WebTool1ConnectionString")
EndIf
End Sub

The session variable Session("ClientDBConnectionString") holds the client specific connection string and is populated when the user logs on. If this is not populated then the connection string defaults to one collected from web.config. This should ensure there is always a design time connection string available.

The trouble is, when I try and declare the SQL data souce like this:

<

asp:SqlDataSourceID="dsTest"runat="server"ConnectionString="<%# objClientConnection.ConnectionString %>"SelectCommand="usp_SEL_DocumentTypes"SelectCommandType="StoredProcedure"></asp:SqlDataSource>

I get an error:The ConnectionString property has not been initialized.

I have been going around in circles on this for days and would really appreciate some help. Am I on the right lines? What needs to change to make it work? Is there a better way?

Many thanks,

Cliff

|||

Thanks guys. I'll have to do some reading onSqlConnectionStringBuilder as this isn't a class I've come across before. Any pointers as to its usage in the situation I described would be really helpful. I'm also grateful to Cliff for his contribution as I'm really pleased to see somebody else struggling with the same problem, I'm not alone after all! Cliff, if / when you find a solution for your code (and likewise if I find a way around this one), I'm sure it'll help lots of developers from spending days struggling as we have, if we post the solution here.

Thanks,

Paul

|||

Hi All,

I think that I have managed to crack this one and hope that by posting the solution here it helps one or two others. I was a little worried about sessions timing out (as with the suggestion from Cliff), so have instead opted to use a profile. I'm only scratching the surface here - this all just functional. I must thank Ryan Olshan within these forums, as the one bit I couldn't get to work was the sorting and paging of the gridview as without the usual sqlDataSource, these don't work at all (the full thread for this can be found at:http://forums.asp.net/thread/1240547.aspx), so that part of the code is entirely thanks to him.

Because I want to force the user to select which database to connect to (for the purposes here they are Project1, Project2 & Project3), I have a database that has a table that holds the database names and connection strings. I have added the connection string for this in the normal way in the web.config file. So to add the profile to the web.config file:

<

connectionStrings>

<

addname="ConnectionString1"connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\TestCRM.mdf;Integrated Security=True;User Instance=True"providerName="System.Data.SqlClient" />

</

connectionStrings>

<

system.web>

<

anonymousIdentificationenabled="true"/>

<

profileenabled="true">

<

properties>

<

addname="ConnStr"allowAnonymous="true"/>

</

properties>

</

profile>

</

system.web>

Next, I have a gridview that connects to the connection string in the web.config. This allows the user to select which database to connect to (at the moment, I'm displaying the connection strings along with the other project details, and simply selecting the content of the particular selected database:

Protected

Sub GridView1_SelectedIndexChanged(ByVal senderAsObject,ByVal eAs GridViewCommandEventArgs)' Get the currently selected row using the SelectedRow property.Dim rowAs GridViewRow = GridView1.SelectedRowIf e.CommandName ="Select"Then' Convert the row index stored in the CommandArgument' property to an Integer.Dim indexAsInteger = Convert.ToInt32(e.CommandArgument)' Get the connection string from the appropriate' cell in the GridView control.Dim selectedRowAs GridViewRow = GridView1.Rows(index)Dim ConStrCellAs TableCell = selectedRow.Cells(8)Dim ConStrAsString = ConStrCell.Text

' Pass the connection string to the profile...

Profile.ConnStr = ConStr

' ... and move to the page that should utilise this connection string

Response.Redirect(

"test.aspx")EndIfEndSub

<%

@.PageLanguage="VB"AutoEventWireup="true"CodeFile="Default.aspx.vb"Inherits="_Default" %>

<!

DOCTYPEhtmlPUBLIC"-//W3C//DTD XHTML 1.1//EN""http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

<

htmlxmlns="http://www.w3.org/1999/xhtml">

<

headrunat="server"><title>Project Selector</title>

</

head>

<

body><formid="form1"runat="server"><asp:ScriptManagerID="ScriptManager1"runat="server"/><div><asp:GridViewID="GridView1"runat="server"AllowPaging="True"AllowSorting="True"AutoGenerateColumns="False"CellPadding="4"DataSourceID="SqlDataSource1"EmptyDataText="There are no data records to display."ForeColor="#333333"GridLines="None"OnRowCommand="GridView1_SelectedIndexChanged"><FooterStyleBackColor="#5D7B9D"Font-Bold="True"ForeColor="White"/><Columns><asp:ButtonFieldCommandName="Select"Text="Select"/><asp:BoundFieldDataField="ProjName"HeaderText="Project Name"SortExpression="ProjName"><HeaderStyleHorizontalAlign="Center"VerticalAlign="Middle"/></asp:BoundField><asp:BoundFieldDataField="ProjDesc"HeaderText="Project Desc"SortExpression="ProjDesc"/><asp:BoundFieldDataField="DBName"HeaderText="Database Name"SortExpression="DBName"/><asp:BoundFieldDataField="TotalHD"HeaderText="Total Half Days"SortExpression="TotalHD"/><asp:CheckBoxFieldDataField="Active"HeaderText="Active"SortExpression="Active"/><asp:BoundFieldDataField="ProjMgr"HeaderText="Project Manager"SortExpression="ProjMgr"/><asp:BoundFieldDataField="AppointTarget"HeaderText="Appointment Target"SortExpression="AppointTarget"/><asp:BoundFieldDataField="ConnectionString"HeaderText="Connection String"SortExpression="ConnectionString"/></Columns><RowStyleBackColor="#F7F6F3"ForeColor="#333333"/><EditRowStyleBackColor="#999999"/><SelectedRowStyleBackColor="#E2DED6"Font-Bold="True"ForeColor="#333333"/><PagerStyleBackColor="#284775"ForeColor="White"HorizontalAlign="Center"/><HeaderStyleBackColor="#5D7B9D"Font-Bold="True"ForeColor="White"/><AlternatingRowStyleBackColor="White"ForeColor="#284775"/></asp:GridView><asp:SqlDataSourceID="SqlDataSource1"runat="server"ConnectionString="<%$ ConnectionStrings:logiCRMConnectionString1 %>"ProviderName="<%$ ConnectionStrings:ConnectionString1.ProviderName %>"SelectCommand="SELECT [ProjectURN], [ProjName], [ProjDesc], [DBName], [TotalHD], [Active], [ProjMgr], [AppointTarget], [TMDocPath], [ExtUserName], [ExtPassword], [ConnectionString], [DateCreated], [CreatedBy], [DateAmended], [AmendedBy], [Deleted] FROM [Projects]"></asp:SqlDataSource><br/><asp:LabelID="lblMessage"runat="server"></asp:Label></div></form>

</

body>

</

html>

Notice in the code behind, the key part is where the connection string is passed to the profile in web.config... Profile.ConnStr = ConStr

This next page is able to connect to the connection string from the one held in the profile as it is added into the code behind. You should note that I have allowed sorting and paging, so the amount of code I'm showing is quite lengthy, but I've highlighted in bold text the appropriate bits:

<%

@.PageLanguage="VB"AutoEventWireup="false"CodeFile="Test.aspx.vb"Inherits="Test" %>

<!

DOCTYPEhtmlPUBLIC"-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<

htmlxmlns="http://www.w3.org/1999/xhtml">

<

headrunat="server"><title>Test connect without a DataSource control</title>

</

head>

<

body><formid="form1"runat="server"><asp:ScriptManagerID="ScriptManager1"runat="server"/><div><fieldsetid="Fieldset1"style="width: 97%;"><legendclass="legendnohelp"><span>Company List</span></legend><asp:gridviewid="GridView1"AllowSorting="true"AllowPaging="true"autogeneratecolumns="false"runat="server"PageSize="20"Width="100%"DataKeyNames="CoID"EmptyDataText="There are no Companies to display"OnPageIndexChanging="gridView_PageIndexChanging"OnSorting="gridView_Sorting"><Columns><asp:BoundFieldReadOnly="True"DataField="CoID"InsertVisible="False"Visible="False"SortExpression="CoID"HeaderText="CoID"></asp:BoundField><asp:HyperLinkFieldHeaderText="Company Name"SortExpression="CoName"Text="Detail"DataTextField="CoName"DataNavigateUrlFormatString="company.aspx?coid={0}"DataNavigateUrlFields="CoID"><ItemStyleWidth="35%"></ItemStyle></asp:HyperLinkField><asp:BoundFieldDataField="Town"SortExpression="Town"HeaderText="Town"><ItemStyleWidth="20%"></ItemStyle></asp:BoundField><asp:BoundFieldDataField="Postcode"SortExpression="Postcode"HeaderText="Postcode"><ItemStyleWidth="15%"></ItemStyle></asp:BoundField><asp:BoundFieldDataField="Telephone"SortExpression="Telephone"HeaderText="Telephone"><ItemStyleWidth="15%"Wrap="False"></ItemStyle></asp:BoundField><asp:BoundFieldDataField="Status"HeaderText="Status"SortExpression="Status"><ItemStyleWidth="15%"/></asp:BoundField></Columns></asp:gridview><asp:LabelID="lblMessage"runat="server"Width="202px"/></fieldset></div></form>

</

body>

</

html>

Imports

System.Data

Imports

System.Data.Sqlclient

Partial

Class TestInherits System.Web.UI.PageProtectedSub Page_Load(ByVal senderAsObject,ByVal eAs System.EventArgs)HandlesMe.Load

PopulateGridView()

EndSubPrivateSub PopulateGridView()Dim connectionStringAsString = DbConnectionString()Dim SQLConnectionAs SqlConnection =New SqlConnection(connectionString)

' this is just a stored procedure to recover the records to populate the gridview...

Dim sqlQueryAsString ="GetCompanies"Dim sqlCommandAs SqlCommand =New SqlCommand(sqlQuery, SQLConnection)Dim coDataAdapterAs SqlDataAdapter =New SqlDataAdapter(sqlCommand)Dim coDataTableAs DataTable =New DataTable("Companies")

coDataAdapter.Fill(coDataTable)

Dim dataTableRowCountAsInteger = coDataTable.Rows.CountIf dataTableRowCount > 0Then

GridView1.DataSource = coDataTable

GridView1.DataBind()

EndIfEndSubPrivateFunction DbConnectionString()AsStringDim DbPathAsString ="Data Source=" & Profile.ConnStr

ReturnString.Format(DbPath)

EndFunction

ProtectedFunction SortDataTable(ByVal dataTableAs DataTable,ByVal isPageIndexChangingAsBoolean)As DataViewIfNot dataTableIsNothingThenDim dataViewAs DataView =New DataView(dataTable)If GridViewSortExpression <>String.EmptyThenIf isPageIndexChangingThen

dataView.Sort =

String.Format("{0} {1}", GridViewSortExpression, GridViewSortDirection)Else

dataView.Sort =

String.Format("{0} {1}", GridViewSortExpression, GetSortDirection())EndIfEndIfReturn dataViewElseReturnNew DataView()EndIfEndFunctionProtectedSub gridView_Sorting(ByVal senderAsObject,ByVal eAs GridViewSortEventArgs)

GridViewSortExpression = e.SortExpression

Dim pageIndexAsInteger = GridView1.PageIndex

GridView1.DataSource = SortDataTable(GridView1.DataSource,

False)

GridView1.DataBind()

GridView1.PageIndex = pageIndex

EndSubProtectedSub gridView_PageIndexChanging(ByVal senderAsObject,ByVal eAs GridViewPageEventArgs)

GridView1.DataSource = SortDataTable(GridView1.DataSource,

True)

GridView1.PageIndex = e.NewPageIndex

GridView1.DataBind()

EndSubPrivateFunction GetSortDirection()AsStringSelectCase GridViewSortDirectionCase"ASC"

GridViewSortDirection =

"DESC"' breakCase"DESC"

GridViewSortDirection =

"ASC"' breakEndSelectReturn GridViewSortDirectionEndFunctionPrivateProperty GridViewSortBLOCKED EXPRESSIONAsStringGetReturn IIf(ViewState("SortExpression") =Nothing,String.Empty, ViewState("SortExpression"))EndGetSet(ByVal valueAsString)

ViewState(

"SortExpression") = valueEndSetEndPropertyPrivateProperty GridViewSortDirection()AsStringGetReturn IIf(ViewState("SortDirection") =Nothing,"ASC", ViewState("SortDirection"))EndGetSet(ByVal valueAsString)

ViewState(

"SortDirection") = valueEndSetEndProperty

End

Class

And that is all there is to it! I hope this helps a few people.

Cheers,

Paul

Dynamic Connection String with Stored Procedure FIX

Has anyone been able to find a way to use a stored procedure with a dynamic connection string?

Do you mean you want to use different connection strings with the same report i.e. different datasources?|||Yes and no. Same report, same data source, different connection strings for different people. We have been able to do this up until we hit the reporting services bug. Others on this message board have had the same problem. You get the connection string to work but every time you run the report the Command Type keeps reverting back to text instead of stored procedure so the report errors out. Others on this message board have said that they ripped the code out of the procedures and embedded it in every report because they haven't been able to get around the bug. Just checking if anyone ever got around it as we really don't want to have to do this.|||Whenever you click on view code this portion is missing after the query element, this is why it keeps erroring out and the dataset keeps reverting back to text. This is a BUG.

<CommandType>StoredProcedure</CommandType>

When we add it in the code window, the report will now run and function as it should as long as you don't click on the data tab again. If you click on the data tab again you will have to go back in and add this code in again because it will be gone.

Dynamic Connection String with Stored Procedure

Has anyone been able to find a way to use a stored procedure with a dynamic connection string?

Do you mean you want to use different connection strings with the same report i.e. different datasources?|||Yes and no. Same report, same data source, different connection strings for different people. We have been able to do this up until we hit the reporting services bug. Others on this message board have had the same problem. You get the connection string to work but every time you run the report the Command Type keeps reverting back to text instead of stored procedure so the report errors out. Others on this message board have said that they ripped the code out of the procedures and embedded it in every report because they haven't been able to get around the bug. Just checking if anyone ever got around it as we really don't want to have to do this.|||Whenever you click on view code this portion is missing after the query element, this is why it keeps erroring out and the dataset keeps reverting back to text. This is a BUG.

<CommandType>StoredProcedure</CommandType>

When we add it in the code window, the report will now run and function as it should as long as you don't click on the data tab again. If you click on the data tab again you will have to go back in and add this code in again because it will be gone.

Dynamic connection string problem in SSRS2005

Hi, I'm a newbie to SSRS, and was wondering if anybody can shed light on a problem I have. I have a report which every client uses, but each client's data is held in its own database. Rather than create many reports, is it possible to create 1 report, which all can use, passing in the different datasource? I was thinking of a hidden parameter, passed by URL. Or maybe using the report viewer control in VS2005. Can anybody please help?

Thanks

Dan

Yes, private data sources can have expression-based connection strings. Please check the following threads:

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1008518&SiteID=1
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1306007&SiteID=1

|||

Thats great, thanks. I have used a report viewer, pointing to a report on a server, with a dynamic connection string.

One more question though, I am connecting to a secure server, and need to provide a login, eg sql_user, pword. Where / how do I provide this in the code / url?

Thanks

Dan

|||How would you collect the credentials? If the user enters them before running the report you have no other way but passing them as parameters to the report (something you should avoid). If they are known values, you can save them in the Report Server web.config file as the ExpressionBasedConnection report demonstrates.|||

Oh, ok I'll try that tomorrow.

Thanks Teo.

Dynamic Connection String Problem

I need to be able to deploy my updated website to many customers on a monthly basis and dont want to be mucking around changing the connection strings each time. Some of my web servers have multiple copies of my site and DB so each website will need a different connection string.

The simplest method I could come up with is to use the Application Name field in IIS as it doesn't get overwritten by Visual Studio when I deploy the site.

I am trying to write some code to dynamically change the connection string in the web config but cannot find any way of reading the Application Name field in IIS to use in altering the connection string. I'm using the Global.asax file to change the connection string before the DB gets called.

I had tried embedding the DB in the website folder but it would overwrite the customers database.

Hi Matthew,

The only way that comes to me is that we can write a small tool that parses the web.config file as xml, and change the connection string accordingly.

HTH. If this does not answer you question, please feel free to mark it as Not Answered and post your reply. Thanks!

|||

I searched and searched and eventually found this snippet but it the last line doesn't work for me. For other people it has worked and I'm not sure what is wrong with my setup:

' Create a connectionn string element and add it to the connection strings section.Sub ChangeConnectionString(ByVal cs_nameAs String,ByVal cs_valueAs String)Try Dim webConfigAs System.Configuration.Configuration = WebConfigurationManager.OpenWebConfiguration("~")Dim dbConnStringAs ConnectionStringsSection = webConfig.ConnectionStrings'// To change existing connectionstring dbConnString.ConnectionStrings(cs_name).ConnectionString = cs_value webConfig.Save()Catch exAs ExceptionEnd Try End Sub
|||

Hi Matthew,

Could you show us the exception message?

|||

The exception is:

{System.Configuration.ConfigurationErrorsException}

An error occurred loading a configuration file: Access to the path 'C:\inetpub\wwwroot\flo_dev\6egcsvyu.tmp' is denied. (C:\inetpub\wwwroot\flo_dev\web.config)

Hope that spreads some light on what it might be.

|||

Hi Matthew,

If you're using an ASP.NET app to do this, please check if the account ASPNET do have permission to write to that file.

|||

I will check the rights of the ASPNET user. If the ASPNET user has rights to modify that file wont that allow anyone to alter the file? Or just server-side code?

Dynamic connection string in dataset?

Hi,

Since rds (dataset file) is simple XML, is it possible to change the datasource value from it and use it without deploying it on the RS server, similar as we do with the web.config?

TIA,

Tanmaya

Just changing the xml contents of a rds file in the file system won't have any effects on the report server. Shared data source settings can only be changed through the RS SOAP API methods.

-- Robert

Dynamic Connection String For ReportDatasource

Hi,

Is there any way to Dynamically change(Based on User login) Connection String for a report data source from code behind. In My application each user may have different data base. I am using a single shared data source for all the report. Please give me a solution.

Thanks

Sonu

You can use a report parameter and have the user choose from a list of different datasources and then you can use an expression for the connection string using the value of this report parameter.

Hope this helps.

|||

Hi,

Since I am using shared data source for reports I cannot write expression for connection string. So I cannot use parameter.

Thanks

Sonu

Dynamic Connection string (config file)

Hi,

I have a web application (.NET 2005), which reads data from a multi-company database either SQL 2005 or Oracle. The company_id and connection string and other information is specified through a config file. I need to display the report from the click on a menu item.

The developers design the reports using Report Designer and store the RDL file in a designated folder (configured in the config file of the website). On the click of the menu the page (.aspx) page accepts values for the parameters of the report.

1. In this scenario, can these parameters, company_id (from config file) be passed to the report (which is already designed using Report Designer) and the RDL is already generated ?
If yes, then I can programmatically publish the data source (connection string from config file) and the report (from RDL file) onto the Report server and open the report using URL re-direction and display.

If no, then do I need to edit the RDL content programmatically to include the connection string and values for the parameters etc. I mean, the developer must require the connection string and company_id and other information to design the report. Can the developer user the config file to read the information and use in the report design.

2. The report parameters can also be specified in the Report designer. Is there any performance benefit of using this method ?

Sorry for the long post, but required to explain the scenario.

Thanks in advance.There are multiple options to achieve dynamic connection strings. Below is a description of available options.

In your case, on way of doing it is to use the new VS 2005 report viewer controls (particularly the Webforms control), read the parameter from the config file and pass it on to the report viewer control which renderers the report in remote mode on a report server and displays the output locally (see http://www.gotreportviewer.com/).
For the data source connection string and command text you could use expressions to dynamically construct these from the parameters (see the bottom of this posting for a simple example).

General approaches for dynamic database connections in RS 2000 are available:
* Use a custom data processing extension
http://msdn.microsoft.com/library/en-us/RSPROG/htm/rsp_prog_extend_dataproc_5c2q.asp
* Use the SOAP API by calling SetDataSourceContents:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/rsprog/htm/rsp_ref_soapapi_service_lz_2ojd.asp
* Use the linked server functionality of SQL Server; please check BOL for more details
* If you're just toggling between two or three databases, you can publish the same report 3 times with 3 different names using 3 different data sources and write a main report that shows/hides the correct subreport based on whatever criteria you want.

In addition, native support (expression-based connection strings) is available in RS 2005: Finish the design of the datasets with a constant connection string and make sure everything works. Then, go back to the data tab and open the dataset/data source dialog and change the connection string to be an expression. Use string concatenation to plug in the parameter value. Here is an example of how the RDL would look for a parameter-based connection string:
<DataSources>
<DataSource Name="Northwind">
<ConnectionProperties>
<DataProvider>SQL</DataProvider>
<ConnectString>="data source=" &amp; Parameters!ServerName.Value &amp; ";initial catalog=Northwind;"</ConnectString>
<IntegratedSecurity>true</IntegratedSecurity>
</ConnectionProperties>
</DataSource>
</DataSources>

<ReportParameters>
<ReportParameter Name="ServerName">
<DataType>String</DataType>
<Prompt>ServerName</Prompt>
</ReportParameter>
</ReportParameters>

You can also check this blog posting: http://blogs.msdn.com/bwelcker/archive/2005/04/29/413343.aspx

-- Robert

|||

dynamic variable sql database Connection String

this is work easy

http://www.codeproject.com/useritems/PersistConnectionStrings.asp

Dynamic Connection string (config file)

Hi,

I have a web application (.NET 2005), which reads data from a multi-company database either SQL 2005 or Oracle. The company_id and connection string and other information is specified through a config file. I need to display the report from the click on a menu item.

The developers design the reports using Report Designer and store the RDL file in a designated folder (configured in the config file of the website). On the click of the menu the page (.aspx) page accepts values for the parameters of the report.

1. In this scenario, can these parameters, company_id (from config file) be passed to the report (which is already designed using Report Designer) and the RDL is already generated ?
If yes, then I can programmatically publish the data source (connection string from config file) and the report (from RDL file) onto the Report server and open the report using URL re-direction and display.

If no, then do I need to edit the RDL content programmatically to include the connection string and values for the parameters etc. I mean, the developer must require the connection string and company_id and other information to design the report. Can the developer user the config file to read the information and use in the report design.

2. The report parameters can also be specified in the Report designer. Is there any performance benefit of using this method ?

Sorry for the long post, but required to explain the scenario.

Thanks in advance.There are multiple options to achieve dynamic connection strings. Below is a description of available options.

In your case, on way of doing it is to use the new VS 2005 report viewer controls (particularly the Webforms control), read the parameter from the config file and pass it on to the report viewer control which renderers the report in remote mode on a report server and displays the output locally (see http://www.gotreportviewer.com/).
For the data source connection string and command text you could use expressions to dynamically construct these from the parameters (see the bottom of this posting for a simple example).

General approaches for dynamic database connections in RS 2000 are available:
* Use a custom data processing extension
http://msdn.microsoft.com/library/en-us/RSPROG/htm/rsp_prog_extend_dataproc_5c2q.asp
* Use the SOAP API by calling SetDataSourceContents:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/rsprog/htm/rsp_ref_soapapi_service_lz_2ojd.asp
* Use the linked server functionality of SQL Server; please check BOL for more details
* If you're just toggling between two or three databases, you can publish the same report 3 times with 3 different names using 3 different data sources and write a main report that shows/hides the correct subreport based on whatever criteria you want.

In addition, native support (expression-based connection strings) is available in RS 2005: Finish the design of the datasets with a constant connection string and make sure everything works. Then, go back to the data tab and open the dataset/data source dialog and change the connection string to be an expression. Use string concatenation to plug in the parameter value. Here is an example of how the RDL would look for a parameter-based connection string:
<DataSources>
<DataSource Name="Northwind">
<ConnectionProperties>
<DataProvider>SQL</DataProvider>
<ConnectString>="data source=" &amp; Parameters!ServerName.Value &amp; ";initial catalog=Northwind;"</ConnectString>
<IntegratedSecurity>true</IntegratedSecurity>
</ConnectionProperties>
</DataSource>
</DataSources>

<ReportParameters>
<ReportParameter Name="ServerName">
<DataType>String</DataType>
<Prompt>ServerName</Prompt>
</ReportParameter>
</ReportParameters>

You can also check this blog posting: http://blogs.msdn.com/bwelcker/archive/2005/04/29/413343.aspx

-- Robert

|||

dynamic variable sql database Connection String

this is work easy

http://www.codeproject.com/useritems/PersistConnectionStrings.asp

Dynamic Connection String

Hi, Can I pass the connection string dynamically. That means the user will specify the database, he/she wants to connects to and user name and password for the same and display and list of Models/Reports stored in that database.Yes, you can. After all the ConnectionString is just a string. So before you make an SqlConnection, you build up the ConnectionString.


string userName = "Joe";
string password = "****";
string server = "MyDatabaseServer";
string connectionString="user="+userName+";password="+password etc etc

Of course this is a ugly fasttype example. You can beautify this using StringBuilders etc.|||Thanks. But, I wanted to know how this can be passed dynamically when the user runs the report from the report server. Which means, the report is already designed and published on the report server. Firstly, can a report/report model be designed on dynamic connection string.|||I think the question was about dynamic connection strings in Reporting Services. This is a feature of SQL Server 2005 Reporting Services. There are a couple of workarounds for SQL 2000 RS (stored procs, cross database queries, etc.).

Dynamic connection string

Our Reporting Services environment uses Oracle as the data source. Based upon the user connecting to the database determines what rows they will see for various tables. How can we dynamically pass the username/password to the connection string? Background: Our users log into Active Directory and are assigned to a group. The AD group name is used to access a control table in Oracle that contains the database username/password for that group’s connection to Oracle. All subsequent connections to Oracle will use the group’s username/password from the control table. We have an ASP.NET application that works like this and stores the connection information in the session state. How can we do something similar with our connection in Reporting Services? Note: Our Oracle Database does not use Windows Integration.

You can create a private (report-level) data source that uses an expression-based connection string as the ExpressionBasedConnection report in this download demonstrates.|||Thank you Teo for your prompt reply. I will take a look at this.|||

Teo,

I looked over the files, but I can't say that the answer stands out at me. Can you tell me specifically which part that I should look at?

|||The report needs to be set up for a private data source and the data source connection string is expression-based. Look at the way the dataset data source is configured.|||

Thanks Teo. I looked into this but it does not solve our unique situation. In our reports, we logged onto our database as one user. We have other companies that need to access our reports now, but do not want them to see the same information. We are attempting to get the user information and log into the database to retrieve the password for the group that that person belongs to. Then we would like to pass back the group user name and password in our connection string so that the person running the report only sees the information that they are allowed to. Another developer wrote a DLL to attempt to do this. It passes back in the dll but does not work when we try to display the connection string on the report. Do you have any samples to make this work or any suggestions on how we might do this?

|||

Why wouldn't this approach work in your situation? Can't you call the DLL from the connection string expression in the same way and get the user-specific connection string?

As a side note, the right way probably to address a similar requirement is to pass User!UserID to your database and let the database implememt row-level security based on the user identity. With this approach you don't have to deal with connection strings at all.

|||Our biggest problem is that we need to take the ID from Active Directory and find the groups that they are assigned to. So far we have been unsuccessful in making this work.

Dynamic connection string

Our Reporting Services environment uses Oracle as the data source. Based upon the user connecting to the database determines what rows they will see for various tables. How can we dynamically pass the username/password to the connection string? Background: Our users log into Active Directory and are assigned to a group. The AD group name is used to access a control table in Oracle that contains the database username/password for that group’s connection to Oracle. All subsequent connections to Oracle will use the group’s username/password from the control table. We have an ASP.NET application that works like this and stores the connection information in the session state. How can we do something similar with our connection in Reporting Services? Note: Our Oracle Database does not use Windows Integration.

You can create a private (report-level) data source that uses an expression-based connection string as the ExpressionBasedConnection report in this download demonstrates.|||Thank you Teo for your prompt reply. I will take a look at this.|||

Teo,

I looked over the files, but I can't say that the answer stands out at me. Can you tell me specifically which part that I should look at?

|||The report needs to be set up for a private data source and the data source connection string is expression-based. Look at the way the dataset data source is configured.|||

Thanks Teo. I looked into this but it does not solve our unique situation. In our reports, we logged onto our database as one user. We have other companies that need to access our reports now, but do not want them to see the same information. We are attempting to get the user information and log into the database to retrieve the password for the group that that person belongs to. Then we would like to pass back the group user name and password in our connection string so that the person running the report only sees the information that they are allowed to. Another developer wrote a DLL to attempt to do this. It passes back in the dll but does not work when we try to display the connection string on the report. Do you have any samples to make this work or any suggestions on how we might do this?

|||

Why wouldn't this approach work in your situation? Can't you call the DLL from the connection string expression in the same way and get the user-specific connection string?

As a side note, the right way probably to address a similar requirement is to pass User!UserID to your database and let the database implememt row-level security based on the user identity. With this approach you don't have to deal with connection strings at all.

|||Our biggest problem is that we need to take the ID from Active Directory and find the groups that they are assigned to. So far we have been unsuccessful in making this work.

dynamic connection string

hi all,

i've been reading through the forum on this subject but couldn't find the solution. i'm using RS2005.

it's mentioned that dynamic connection string is not applicable for shared data source. is there a workaround for this?

thanks!

Dynamic connection strings cannot be used with shared data sources.

Other suggestions can be found in this related thread: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=16395&SiteID=1

-- Robert

|||

Thanks Robert for your reply.

however, do methods for RS2000 apply for RS2005? i've never used RS2000 before and i'm not sure where to start either.

Thanks!

|||

Yes, everything mentioned for RS 2000 works for RS 2005 the same way.
RS 2005 offers expression-based connection strings in addition.

-- Robert

|||

I wrote an application using VS2005 that has a generic report viewer and rdlc files stored in a database with the stored procedures necessary to run each report.

Then I took the report, replaced the dataset stored in the rdlc file programmatically with the generic dataset which accepts the result of the stored procedure and use it to populate the report.

It wasn't that straight forward, but now it works dynamically and I have an application now which I can add a new record to my database storing my rdlc files and stored procedure names and the list of reports that drop down in my application is completely dynamic, including parameters required appearing in a datagrid with controls for calendars and drop-down lists.

Just an idea of how you might get that dynamic dataset.

Dynamic Connection String

I've seen some threads here about Dynamic Data Sources.

I am using the ReportViewer Control for WebForms.

I simply want to say the following:

reportviewer fv = new Microsoft.Reporting.WebForms.ReportViewer();

rv.ServerReport.SetConnectionString(......);

I want to avoid using parameters to do this if I can. I've read that stored procedures don't work when you use parameters.

Is this possible?

Thanks

It sounds like you are using the ReportViewer control in LocalMode. In that case, your application has to directly provide the data as a dataset to the ReportViewer control. There is no connection string, because the ReportViewer control will never execute any queries in LocalMode. More information is available here: http://www.gotreportviewer.com/definedata/index.html and here: http://www.gotreportviewer.com/objectdatasources/index.html

If you use the ReportViewer control in ServerMode, it will just point to a report on a report server. That report is executed on the report server and could use an expression-based connection string, as discussed here: http://msdn2.microsoft.com/en-us/library/ms156450.aspx (scroll to the "Data Source expressions" section).

-- Robert

Friday, February 17, 2012

Dynamic changes of AS Connection Manager failed

Hi,

in my actual szenario I have to change the Server (Connection String) of Analysis Services Connection Manager from my testserver SERVER1 to my production server SERVER2. Nearly everything is easy...I set a variable to the correct servername and I used a expression to change the connection string of the connection manager during run-time. I used this technic serveral time with ole db and it works fine.

Debugging of the project shows that the variable is set correctly. The delay validation flag is set to true. When I run the package the connection establish a connection to the server which I use due designtime.

Does anybody have an idea how I can fix it?

Regards
Klaus Hoeltgen

Hi,

I am having the same issue as Klaus - is there no suggestion to solve that?

Or is it "just by design"?

cheers,
Markus