Showing posts with label runtime. Show all posts
Showing posts with label runtime. Show all posts

Friday, March 30, 2012

How to control visibility of table columns at runtime?

Hi all..

Using ReportViewer in an ASPX page, is it possible to hide certain columns of a table at runtime?

That table is databound to a business object and I'm using local reporting capabilities of Visual Studio 2005.

Thanks

Jaime

I assume you are using a "table" reportitem. In report designer you can select the entire column of a table. In the properties window (F4), you should then see a "Visibility" property. You could set the Visibility.Hidden property to e.g. =Parameters!HideColumns.Value (assuming HideColumns is a boolean report parameter).

-- Robert

|||

Hi Robert..

I meant programmatically. How can I change Visibility property of the table using code. Suppose the table is named tblDatos and report viewer control is named rptBusqueda.

Jaime

How to control visibility of table columns at runtime?

Hi all..

Using ReportViewer in an ASPX page, is it possible to hide certain columns of a table at runtime?

That table is databound to a business object and I'm using local reporting capabilities of Visual Studio 2005.

Thanks

Jaime

I assume you are using a "table" reportitem. In report designer you can select the entire column of a table. In the properties window (F4), you should then see a "Visibility" property. You could set the Visibility.Hidden property to e.g. =Parameters!HideColumns.Value (assuming HideColumns is a boolean report parameter).

-- Robert

|||

Hi Robert..

I meant programmatically. How can I change Visibility property of the table using code. Suppose the table is named tblDatos and report viewer control is named rptBusqueda.

Jaime

Wednesday, March 28, 2012

How to connection MS Access Porject (.adp) with SQL server?

Hi all,
I got the question, how can i connection MS Access Project to a SQL Server
in vba in runtime.
The situation is i create a new MS Access Project, it's didn't have any
connection with any SQL-server. It's just consist a couple of form. What i
want is that user can via an inlog form to get in the database. The
informations about the server...etc is save in the code. The user just need
to give the SQL-login and password. My code to make the connection is as
follow.
'----
--
Function GetADPConnection(strServername, strDBName As String, Optional strUN
As String, _ Optional strPW As String)
Dim strConnect as string
strConnect = "Provider=SQLOLEDB" & _
";Data Source = \10.0.0.4\" & strServername & _
";Initial Catalog =" & strDBName
strConnect = strConnect & ";UID=" & strUN
strConnect = strConnect & ";PWD=" & strPW
Application.CurrentProject.OpenConnection strConnect
End Function
'----
--
It doesn't seems to work and i get the following error messagge:
[DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or
access
denied.
Can anyone help?
Best Regards,
PatData source should be in the form of:
Servername (or IP - 10.0.0.20)
For a named instance, you can use:
Servername\InstanceName
You can find sample connection strings at:
http://www.carlprothman.net/Default.aspx?tabid=81
-Sue
On Thu, 6 Apr 2006 07:49:02 -0700, Pat
<Pat@.discussions.microsoft.com> wrote:

>Hi all,
>I got the question, how can i connection MS Access Project to a SQL Server
>in vba in runtime.
>The situation is i create a new MS Access Project, it's didn't have any
>connection with any SQL-server. It's just consist a couple of form. What i
>want is that user can via an inlog form to get in the database. The
>informations about the server...etc is save in the code. The user just need
>to give the SQL-login and password. My code to make the connection is as
>follow.
>'----
--
>Function GetADPConnection(strServername, strDBName As String, Optional strU
N
>As String, _ Optional strPW As String)
>Dim strConnect as string
> strConnect = "Provider=SQLOLEDB" & _
> ";Data Source = \10.0.0.4\" & strServername & _
> ";Initial Catalog =" & strDBName
> strConnect = strConnect & ";UID=" & strUN
> strConnect = strConnect & ";PWD=" & strPW
> Application.CurrentProject.OpenConnection strConnect
>End Function
>'----
--
>It doesn't seems to work and i get the following error messagge:
>[DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or
access
>denied.
>Can anyone help?
>Best Regards,
>Pat
>sql