Showing posts with label treeview. Show all posts
Showing posts with label treeview. Show all posts

Friday, March 30, 2012

load CatalogItem array in treeview

Hi,

i would like to load my array 'items' in a treeview

CatalogItem[] items = rs.ListChildren("/", true);

is there anyway that automatically does the layout or do i have to check what the type is of everey object so I can indent correctly.

thanks
I'm really looking for this one :).

I'm trying to do it manually but I can't find a way to get the reports in the right structure. I'll show what I want to accomplish and how I am trying it now:

WANTED LIST:
+ Adventureworks
- Company Sales
- Employee Sales Summary
+ Subfolder
- Report from subfolder
- Report from subfolder

Code trying to get there (not thinking of subfolders yet):

rs.Credentials = System.Net.CredentialCache.DefaultCredentials;
CatalogItem[] items = rs.ListChildren("/", false);
foreach (CatalogItem ci in items)
{
cmbRapporten.Nodes.Add(ci.Name);
CatalogItem[] test = rs.ListChildren("/" + ci.Name.ToString(), false);
foreach(CatalogItem ti in test)
{
cmbRapporten.Nodes.Add(ti.Name);
}
}
EXPLANATION

I ask for the root folder's children (not recursive) and then list them in my treeview cmbRapporten then I create a new CatalogItem[] = test, where I list the children of the current folder in the CatalogItem[] items. Everything appears fine but it's all in one line down. How do I couple them with their parents folder.

greetings
|||Hi,

so I got there to fill the treeview not looking at subfolders with this code (pretty simple if you ask me ;))

[CODE]
ReportingService2005 rs = new ReportingService2005();
rs.Credentials = System.Net.CredentialCache.DefaultCredentials;
CatalogItem[] items = rs.ListChildren("/", false);
foreach (CatalogItem item in items)
{
cmbRapporten.Nodes.Add(item.Name);
if (item.Type.ToString() == "Folder")
{
CatalogItem[] childs = rs.ListChildren("/" + item.Name.ToString(), false);
foreach (CatalogItem child in childs)
{
cmbRapporten.Nodes[counter].Nodes.Add(child.Name);
}
counter++;
}
}
[/CODE]

Gives me a nice treeview in the designer but I'm still not content ;).

If one of the items in the object childs is a folder then there should be added another subnode. I'll visualize it for better understanding:

Now i support:

+ FOLDER
-REPORT
-REPORT
-SUBFOLDER
-REPORT

But I want the subfolder to display it's items too. So I will have to make a generic method and then call it with two parameters i thought. The string path wich is the path on the report server that should List it's children. Second of al I have to pass the Node number. But sometimes I will have to pass one node number while other times I will have to pass multiple node numbers... I have no idea to make such an method. Could somebody help with this.

Do I make sense or should I rephrase everything.

Greetings

Monday, March 19, 2012

List SSRS2005 items on treeview

Hi all,

I'm creating a Custom web interface for SQL Server reporting services 2005.

What I want to do is populate a "Navigation Treeview" component in asp.net 2. How would I get all the catalog items and items from the web API and populate my treeview?

Thanks

Hi Rudi,

You could use the SOAP API - ListChildren. Here is a link to defintion and code sample:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/RSPROG/htm/rsp_ref_soapapi_service_lz_2yt2.asp

|||

Hi there Brad,

Thanks alot! I'm still having some trouble though...

I'm using this code to get the list:

Try

Dim P As New ReportingService

Dim RootList As CatalogItem = P.ListChildren("/", True)

LoadTree(RootList)

Catch ex As Exception

End Try

But this is returning the error:

\\Reportserver\NetReports\Admin\Default.aspx(1): Build (web): \\Reportserver\NetReports\MasterPage.master.vb(36): error BC30311: Value of type '1-dimensional array of ReportService.CatalogItem' cannot be converted to 'ReportService.CatalogItem'.

What am I doing wrong?

Thanks

|||

Don't worry, I got it....

I didn't add the () in

Dim RootList As CatalogItem() = rs.ListChildren("/", True)

Thanks

|||Any chance you could provide the code used for LoadTree? I'm stuck trying to figure out how to programmatically build the nodes from the CatalogItem.

Thanks,
Kel

List SSRS2005 items on treeview

Hi all,

I'm creating a Custom web interface for SQL Server reporting services 2005.

What I want to do is populate a "Navigation Treeview" component in asp.net 2. How would I get all the catalog items and items from the web API and populate my treeview?

Thanks

Hi Rudi,

You could use the SOAP API - ListChildren. Here is a link to defintion and code sample:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/RSPROG/htm/rsp_ref_soapapi_service_lz_2yt2.asp

|||

Hi there Brad,

Thanks alot! I'm still having some trouble though...

I'm using this code to get the list:

Try

Dim P As New ReportingService

Dim RootList As CatalogItem = P.ListChildren("/", True)

LoadTree(RootList)

Catch ex As Exception

End Try

But this is returning the error:

\\Reportserver\NetReports\Admin\Default.aspx(1): Build (web): \\Reportserver\NetReports\MasterPage.master.vb(36): error BC30311: Value of type '1-dimensional array of ReportService.CatalogItem' cannot be converted to 'ReportService.CatalogItem'.

What am I doing wrong?

Thanks

|||

Don't worry, I got it....

I didn't add the () in

Dim RootList As CatalogItem() = rs.ListChildren("/", True)

Thanks

|||Any chance you could provide the code used for LoadTree? I'm stuck trying to figure out how to programmatically build the nodes from the CatalogItem.

Thanks,
Kel

Wednesday, March 7, 2012

List of All SSIS packages stored in MSDB

Hi,

I am writing one program in vb.Net where I need to bind a treeview with all the SSIS packages stored in SQL server MSDB database.

Is it possible to get all the SSIS packages by using T-SQL query or Object model ?

Thanks

Reference assembly Microsoft.SqlServer.ManagedDts.dll and create Application object (in Microsoft.SqlServer.Dts.Runtime namespace). To get list of packages use Application.GetPackageInfos method:

http://msdn2.microsoft.com/en-us/library/microsoft.sqlserver.dts.runtime.application.getpackageinfos(SQL.90).aspx|||

Alternatively the following query returns the list of stored packages from MSDB database:

SELECT * FROM msdb.dbo.sysdtspackages90

Thanks,
Loonysan

List of All SSIS packages stored in MSDB

Hi,

I am writing one program in vb.Net where I need to bind a treeview with all the SSIS packages stored in SQL server MSDB database.

Is it possible to get all the SSIS packages by using T-SQL query or Object model ?

Thanks

Reference assembly Microsoft.SqlServer.ManagedDts.dll and create Application object (in Microsoft.SqlServer.Dts.Runtime namespace). To get list of packages use Application.GetPackageInfos method:

http://msdn2.microsoft.com/en-us/library/microsoft.sqlserver.dts.runtime.application.getpackageinfos(SQL.90).aspx|||

Alternatively the following query returns the list of stored packages from MSDB database:

SELECT * FROM msdb.dbo.sysdtspackages90

Thanks,
Loonysan