Showing posts with label group. Show all posts
Showing posts with label group. Show all posts

Friday, March 23, 2012

problems with Publish Reports Script File

How do i make the datasources same path for each report loaded
I have 5 group sets
I end up manually change the datasource for each one
If i can make this script files to do it

what changes do i need to make ?

__
' Publish Reports
' Adapted from Microsoft Publish Reports Sample Script File


Dim parentfolder as string
Dim definition As [Byte]() = Nothing
Dim warnings As Warning() = Nothing
Dim parentPath As String = "/" + parentFolder
Dim filePath As String

Public Sub Main()

rs.Credentials = System.Net.CredentialCache.DefaultCredentials
Dim name As String


parentfolder = "DataSources"
parentpath = "/" + parentFolder

'Create the parent folder
Try
rs.CreateFolder(parentFolder, "/", Nothing)
Console.WriteLine("Parent folder created: {0}", parentFolder)
Catch e As Exception
Console.WriteLine(e.Message)
End Try

CreateSampleDataSource()


'Publish the sample reports

parentfolder = "Polling Reports"
parentpath = "/" + parentFolder
'Create the parent folder
Try
rs.CreateFolder(parentFolder, "/", Nothing)
Console.WriteLine("Parent folder created: {0}", parentFolder)
Catch e As Exception
Console.WriteLine(e.Message)
End Try

filePath = "c:\apps\Corr6\Server\Reporting Services\Polling Reports\"


PublishReport("Polling Interest")

parentfolder = "Mail Reports"
parentpath = "/" + parentFolder
'Create the parent folder
Try
rs.CreateFolder(parentFolder, "/", Nothing)
Console.WriteLine("Parent folder created: {0}", parentFolder)
Catch e As Exception
Console.WriteLine(e.Message)
End Try

filePath = "c:\apps\Corr6\Server\Reporting Services\Mail Reports\"


PublishReport("Code Usage")
PublishReport("Communication History")
PublishReport("Mail Staff Load")
PublishReport("Outstanding Mail Staff")
PublishReport("Outstanding Mail Summary")
PublishReport("Top Code Usage")
PublishReport("Group Mail Summary")

parentfolder = "Casework Reports"
parentpath = "/" + parentFolder
'Create the parent folder
Try
rs.CreateFolder(parentFolder, "/", Nothing)
Console.WriteLine("Parent folder created: {0}", parentFolder)
Catch e As Exception
Console.WriteLine(e.Message)
End Try


filePath = "c:\apps\Corr6\Server\Reporting Services\Casework Reports\"

PublishReport("Casework Closed")
PublishReport("Casework County")
PublishReport("Casework Detail")
PublishReport("Casework Outstanding")
PublishReport("Casework Staff")
PublishReport("Casework Summary")

parentfolder = "WorkFlow Reports"
parentpath = "/" + parentFolder
'Create the parent folder
Try
rs.CreateFolder(parentFolder, "/", Nothing)
Console.WriteLine("Parent folder created: {0}", parentFolder)
Catch e As Exception
Console.WriteLine(e.Message)
End Try


filePath = "c:\apps\Corr6\Server\Reporting Services\workflow reports\"

PublishReport("Staff Productivity Report")
PublishReport("Overdue Tasks")

parentfolder = "System Reports"
parentpath = "/" + parentFolder
'Create the parent folder
Try
rs.CreateFolder(parentFolder, "/", Nothing)
Console.WriteLine("Parent folder created: {0}", parentFolder)
Catch e As Exception
Console.WriteLine(e.Message)
End Try

filePath = "c:\apps\Corr6\Server\Reporting Services\System Reports\"
PublishReport("Interest System Codes")
PublishReport("Letter System Codes")
PublishReport("Personal System Codes")
PublishReport("System Staff")

End Sub

Public Sub CreateSampleDataSource()
Dim name As String = "DataSource"
Dim parent As String = "/" + parentFolder

'Define the data source definition.
Dim definition As New DataSourceDefinition()
definition.CredentialRetrieval = CredentialRetrievalEnum.Integrated
definition.ConnectString = "data source=(local);initial catalog=cap_win"
definition.Enabled = True
definition.EnabledSpecified = True
definition.Extension = "SQL"
definition.ImpersonateUser = False
definition.ImpersonateUserSpecified = True
'Use the default prompt string.
definition.Prompt = Nothing
definition.WindowsCredentials = False

Try
rs.CreateDataSource(name, parent, False, definition, Nothing)

Catch e As Exception
Console.WriteLine(e.Message)
End Try

End Sub

Public Sub PublishReport(ByVal reportName As String)
Try
Dim stream As FileStream = File.OpenRead(filePath + reportName + ".rdl")
definition = New [Byte](stream.Length) {}
stream.Read(definition, 0, CInt(stream.Length))
stream.Close()

Catch e As IOException
Console.WriteLine(e.Message)
End Try

Try
warnings = rs.CreateReport(reportName, parentPath, False, definition, Nothing)

If Not (warnings Is Nothing) Then
Dim warning As Warning
For Each warning In warnings
Console.WriteLine(warning.Message)
Next warning

Else
Console.WriteLine("Report: {0} published successfully with no warnings", reportName)
End If

Catch e As Exception
Console.WriteLine(e.Message)
End Try
End Sub

Anybody know what to do ?|||

can it be done ?
any reference where i might get the answer ?

problems with Publish Reports Script File

How do i make the datasources same path for each report loaded
I have 5 group sets
I end up manually change the datasource for each one
If i can make this script files to do it

what changes do i need to make ?

__
' Publish Reports
' Adapted from Microsoft Publish Reports Sample Script File


Dim parentfolder as string
Dim definition As [Byte]() = Nothing
Dim warnings As Warning() = Nothing
Dim parentPath As String = "/" + parentFolder
Dim filePath As String

Public Sub Main()

rs.Credentials = System.Net.CredentialCache.DefaultCredentials
Dim name As String


parentfolder = "DataSources"
parentpath = "/" + parentFolder

'Create the parent folder
Try
rs.CreateFolder(parentFolder, "/", Nothing)
Console.WriteLine("Parent folder created: {0}", parentFolder)
Catch e As Exception
Console.WriteLine(e.Message)
End Try

CreateSampleDataSource()


'Publish the sample reports

parentfolder = "Polling Reports"
parentpath = "/" + parentFolder
'Create the parent folder
Try
rs.CreateFolder(parentFolder, "/", Nothing)
Console.WriteLine("Parent folder created: {0}", parentFolder)
Catch e As Exception
Console.WriteLine(e.Message)
End Try

filePath = "c:\apps\Corr6\Server\Reporting Services\Polling Reports\"


PublishReport("Polling Interest")

parentfolder = "Mail Reports"
parentpath = "/" + parentFolder
'Create the parent folder
Try
rs.CreateFolder(parentFolder, "/", Nothing)
Console.WriteLine("Parent folder created: {0}", parentFolder)
Catch e As Exception
Console.WriteLine(e.Message)
End Try

filePath = "c:\apps\Corr6\Server\Reporting Services\Mail Reports\"


PublishReport("Code Usage")
PublishReport("Communication History")
PublishReport("Mail Staff Load")
PublishReport("Outstanding Mail Staff")
PublishReport("Outstanding Mail Summary")
PublishReport("Top Code Usage")
PublishReport("Group Mail Summary")

parentfolder = "Casework Reports"
parentpath = "/" + parentFolder
'Create the parent folder
Try
rs.CreateFolder(parentFolder, "/", Nothing)
Console.WriteLine("Parent folder created: {0}", parentFolder)
Catch e As Exception
Console.WriteLine(e.Message)
End Try


filePath = "c:\apps\Corr6\Server\Reporting Services\Casework Reports\"

PublishReport("Casework Closed")
PublishReport("Casework County")
PublishReport("Casework Detail")
PublishReport("Casework Outstanding")
PublishReport("Casework Staff")
PublishReport("Casework Summary")

parentfolder = "WorkFlow Reports"
parentpath = "/" + parentFolder
'Create the parent folder
Try
rs.CreateFolder(parentFolder, "/", Nothing)
Console.WriteLine("Parent folder created: {0}", parentFolder)
Catch e As Exception
Console.WriteLine(e.Message)
End Try


filePath = "c:\apps\Corr6\Server\Reporting Services\workflow reports\"

PublishReport("Staff Productivity Report")
PublishReport("Overdue Tasks")

parentfolder = "System Reports"
parentpath = "/" + parentFolder
'Create the parent folder
Try
rs.CreateFolder(parentFolder, "/", Nothing)
Console.WriteLine("Parent folder created: {0}", parentFolder)
Catch e As Exception
Console.WriteLine(e.Message)
End Try

filePath = "c:\apps\Corr6\Server\Reporting Services\System Reports\"
PublishReport("Interest System Codes")
PublishReport("Letter System Codes")
PublishReport("Personal System Codes")
PublishReport("System Staff")

End Sub

Public Sub CreateSampleDataSource()
Dim name As String = "DataSource"
Dim parent As String = "/" + parentFolder

'Define the data source definition.
Dim definition As New DataSourceDefinition()
definition.CredentialRetrieval = CredentialRetrievalEnum.Integrated
definition.ConnectString = "data source=(local);initial catalog=cap_win"
definition.Enabled = True
definition.EnabledSpecified = True
definition.Extension = "SQL"
definition.ImpersonateUser = False
definition.ImpersonateUserSpecified = True
'Use the default prompt string.
definition.Prompt = Nothing
definition.WindowsCredentials = False

Try
rs.CreateDataSource(name, parent, False, definition, Nothing)

Catch e As Exception
Console.WriteLine(e.Message)
End Try

End Sub

Public Sub PublishReport(ByVal reportName As String)
Try
Dim stream As FileStream = File.OpenRead(filePath + reportName + ".rdl")
definition = New [Byte](stream.Length) {}
stream.Read(definition, 0, CInt(stream.Length))
stream.Close()

Catch e As IOException
Console.WriteLine(e.Message)
End Try

Try
warnings = rs.CreateReport(reportName, parentPath, False, definition, Nothing)

If Not (warnings Is Nothing) Then
Dim warning As Warning
For Each warning In warnings
Console.WriteLine(warning.Message)
Next warning

Else
Console.WriteLine("Report: {0} published successfully with no warnings", reportName)
End If

Catch e As Exception
Console.WriteLine(e.Message)
End Try
End Sub

Anybody know what to do ?|||

can it be done ?
any reference where i might get the answer ?

Wednesday, March 21, 2012

Problems with print layout

Hi all,

In my report I create a group of matrixes and remove the space between them. They have the same size and when I make the preview it looks just fine. They apear all together without any space between them. My problem is when I make the print layout. They appear with a huge space between them and I don't know why.
Has someone passed by the same? Any solution for this kind of problem?
Thanks in advance.

vjn

Hi,

If you check the layout in the designer, you can best select the print preview since this gives the most accurate result. Matrixes sometimes have the intention to use the maximum space (everything expanded) when printed.

A solution is to put your matrix inside a rectangle. I use rectangles all the time to format my reports.

Greetz,

Geert

Geert Verhoeven
Consultant @. Ausy Belgium

My Personal Blog

|||Thanks a lot Geert. It's a fine idea.

Best regards

vjn

Monday, March 12, 2012

Problems with GROUP BY

I have the below SELECT statement and I am having a problem:
SELECT status, SUM(NoItems) * Price AS NewRevenue
FROM orders
GROUP BY status, Price
The problem is because I need to place the Price field in the GROUP BY I
receive multiple rows. I need the result to be on one row. Any ideas on what
I am doing wrong?
Thank you
Peace in Christ
Marco Napoli
http://www.ourlovingmother.orgIs this what you're looking for?
SELECT status, SUM(NoItems * Price) AS NewRevenue
FROM orders
GROUP BY status
Hope this helps.
Dan Guzman
SQL Server MVP
"Marco Napoli" <marco@.avantitecnospam.com> wrote in message
news:uoBFPu7nFHA.1412@.TK2MSFTNGP09.phx.gbl...
>I have the below SELECT statement and I am having a problem:
> SELECT status, SUM(NoItems) * Price AS NewRevenue
> FROM orders
> GROUP BY status, Price
> The problem is because I need to place the Price field in the GROUP BY I
> receive multiple rows. I need the result to be on one row. Any ideas on
> what I am doing wrong?
> Thank you
> Peace in Christ
> Marco Napoli
> http://www.ourlovingmother.org
>

Wednesday, March 7, 2012

Problems with collation

Hi,
I have one problem with collation and asp.net 2.0 security. I wrote
about it here:
http://groups.google.com/group/micr...5b30c9eba?hl=en
Can you please look and propose solution.
Nobody from asp.net group responded so I thought that it is more to sql
that to asp.net.
Thanks in advanceHi
There are many posts about changing collation, change the collation for a
database will not change the collations for existing columns in existing
tables. Check out http://tinyurl.com/gxw63 on how to change it at column
level.
You could also run SQL profiler to see what is being executed on the server
and then re-run the statements in Query Analyser to where the error occurs.
John
"milan.letic@.gmail.com" wrote:

> Hi,
> I have one problem with collation and asp.net 2.0 security. I wrote
> about it here:
> http://groups.google.com/group/micr...5b30c9eba?hl=en
> Can you please look and propose solution.
>
> Nobody from asp.net group responded so I thought that it is more to sql
> that to asp.net.
> Thanks in advance
>

Problems with change sql permissions after migrating domain user/group accounts into root domain

I have a root domain and child domain.

After using ADMT to migrate the domain user or group into the root domain, when I use enterprise manager to try and change the permissions allocated to that domain user/group, i get the 'Error 15401 NT user or Group not found'.

This is a correct error as the user is now in the root domain, however sql (in sysxlogins) still thinks its in the child domain.

Is there a simpler way, other than collecting the users permissions, deleting the user from SQL then adding back in with the correct domain\username format, then adding the permissions back?

I tried renaming the 'name' in sysxlogins (not recommended) and while that worked, whenever I tried to add the migrated user to another database, the login name was missing and would not resolve.

I believe it is something to do with the SID not matching.

Any ideas on how to fix this ?

You're correct, different SIDs.

Here are some articles that may help.


http://www.sqlservercentral.com/columnists/cBunch/movingyouruserswiththeirdatabases.asp Moving Users
http://www.support.microsoft.com/?id=246133 How To Transfer Logins and Passwords Between SQL Servers
http://www.support.microsoft.com/?id=298897 Mapping Logins & SIDs after a Restore
http://www.dbmaint.com/SyncSqlLogins.asp Utility to map logins to users
http://support.microsoft.com/kb/274188 Troubleshooting Orphan Logins

Monday, February 20, 2012

Problems Using the SQL Server Surface Area Configuration

I am currently running a Windows Vista Enterprise OS platform using SQL Express, whenever i add a user to the administrator group using the SQL Server Surface Area Configuration UI, each time i click on the link to add New Administrator, the previous administrator i just added still appears on the left - just as if i never added this user previously.

Is there a way around this issue? or is this a SQL Express problem, because i also tried doing it with SQL Server Enterprise edition on a Win2K3 SP2 box and it gives the same results.

Feedback is greatly appreciated.

Thanks

Did you used the SQL Server provisiong tool on the Vista machine ?

Jens Suessmeyer.


http://www.sqlserver2005.de